From c9ba69debd93179e550a6f3d2864cc19857b709f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 11:33:27 +0000 Subject: [PATCH 001/151] chore(deps): bump whatwg-url from 7.1.0 to 13.0.0 Bumps [whatwg-url](https://github.com/jsdom/whatwg-url) from 7.1.0 to 13.0.0. - [Release notes](https://github.com/jsdom/whatwg-url/releases) - [Commits](https://github.com/jsdom/whatwg-url/compare/v7.1.0...v13.0.0) --- updated-dependencies: - dependency-name: whatwg-url dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5ac1585d..39c09f999 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "stream-http": "^3.2.0", "url": "^0.11.0", "uuid": "^3.4.0", - "whatwg-url": "^7.1.0" + "whatwg-url": "^13.0.0" }, "devDependencies": { "@commitlint/cli": "^17.4.2", From 88097f78daa6bff46c86f196e09bafa2a5a857a9 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:58:45 +0200 Subject: [PATCH 002/151] feat: adding helper methods to check if a service exists --- integration/nevermined/DDO.test.ts | 8 ++++++++ package.json | 2 +- src/ddo/DDO.ts | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/integration/nevermined/DDO.test.ts b/integration/nevermined/DDO.test.ts index 1a4dfee9d..ac65f30fb 100644 --- a/integration/nevermined/DDO.test.ts +++ b/integration/nevermined/DDO.test.ts @@ -104,6 +104,14 @@ describe('DDO Tests', () => { 'templateId', ] as any, ) + + assert.isTrue(ddo.serviceExists('metadata')) + assert.isTrue(ddo.serviceExists('access')) + assert.isFalse(ddo.serviceExists('compute')) + + assert.isTrue(ddo.serviceIndexExists(0)) // metadata + assert.isTrue(ddo.serviceIndexExists(3)) // access + assert.isFalse(ddo.serviceIndexExists(99)) }) it('should create correct nft DDO', async () => { diff --git a/package.json b/package.json index 14690cd90..fc9a8348a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "1.5.4", + "version": "1.5.5", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 33fda8971..174a9652c 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -151,6 +151,26 @@ export class DDO { throw new DDOServiceNotFoundError(serviceType, this.id) } + /** + * Checks if a service exists in the DDO. + * @param serviceType - Service type. + * + * @returns true if service exists. + */ + public serviceExists(serviceType: T): boolean { + return this.service.find((s) => s.type === serviceType) ? true : false + } + + /** + * Checks if a service index in the DDO. + * @param serviceIndex - Service . + * + * @returns true if service exists. + */ + public serviceIndexExists(serviceIndex: number): boolean { + return this.service.find((s) => s.index === serviceIndex) ? true : false + } + /** * Get the total price of a service. * @example From aca60044ea97e50efa7c5ee102772ea960cf9f40 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 7 Jul 2023 09:28:35 +0200 Subject: [PATCH 003/151] chore: migrating DDOHelper functions to DDO --- CHANGELOG.md | 8 +- .../nevermined/NFT721Templates.test.ts | 3 +- integration/nevermined/NFTTemplates.test.ts | 3 +- .../nevermined/SecondaryMarket.test.ts | 21 +- src/ddo/DDO.ts | 267 +++++++++++++++++- .../conditions/EscrowPaymentCondition.ts | 5 +- .../conditions/LockPaymentCondition.ts | 5 +- .../conditions/NFTs/NFT721HolderCondition.ts | 6 +- .../conditions/NFTs/NFTHolderCondition.ts | 8 +- .../NFTs/TransferNFT721Condition.ts | 5 +- .../conditions/NFTs/TransferNFTCondition.ts | 8 +- .../templates/AgreementTemplate.abstract.ts | 18 +- src/nevermined/api/AssetsApi.ts | 18 +- src/nevermined/api/ConditionsApi.ts | 4 +- src/nevermined/api/RegistryBaseApi.ts | 11 +- src/nevermined/api/SearchApi.ts | 5 +- src/nevermined/api/nfts/NFT1155Api.ts | 12 +- src/nevermined/api/nfts/NFT721Api.ts | 4 +- src/nevermined/api/nfts/NFTsBaseApi.ts | 20 +- src/services/metadata/MetadataService.ts | 4 +- src/utils/DDOHelpers.ts | 11 + 21 files changed, 347 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e0151f1..7dd5537ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1035,7 +1035,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1298,7 +1298,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1804,7 +1804,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1843,7 +1843,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index c21fdaccd..79fe24a98 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -25,7 +25,6 @@ import { import { config } from '../config' import { NFT721Api } from '../../src' import { getMetadata } from '../utils' -import { setNFTRewardsFromDDOByService } from '../../src/utils' import { BigNumber } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' @@ -784,7 +783,7 @@ describe('NFT721Templates E2E', () => { await token.balanceOf(escrowPaymentCondition.getAddress()), ), } - setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) + ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice2, collector1.getId()) }) it('As collector2 I setup an agreement for buying an NFT from collector1', async () => { const result = await nft721SalesTemplate.createAgreementFromDDO( diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index 081b452f3..c49f760af 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -24,7 +24,6 @@ import { } from '../../src/keeper' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' import { BigNumber } from '../../src/utils' -import { setNFTRewardsFromDDOByService } from '../../src/utils' import { config } from '../config' import { getMetadata } from '../utils' @@ -786,7 +785,7 @@ describe('NFTTemplates E2E', () => { await token.balanceOf(escrowPaymentCondition.getAddress()), ), } - setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) + ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice2, collector1.getId()) }) it('As collector2 I setup an agreement for buying an NFT from collector1', async () => { diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index e233815c3..d9e51a353 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -21,12 +21,6 @@ import { NFTSalesTemplate, Token, } from '../../src/keeper' -import { - fillConditionsWithDDO, - findServiceConditionByName, - getAssetPriceFromService, - setNFTRewardsFromDDOByService, -} from '../../src/utils' import { config } from '../config' import { getMetadata } from '../utils' import { BigNumber } from '../../src/utils' @@ -350,7 +344,7 @@ describe('Secondary Markets', () => { lockPaymentCondition: await token.balanceOf(lockPaymentCondition.getAddress()), escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.getAddress()), } - setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) + ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice2, collector1.getId()) }) it('As collector1 I create and store an off-chain service agreement', async () => { @@ -359,10 +353,9 @@ describe('Secondary Markets', () => { const nftSalesTemplateConditions = await nftSalesTemplate.getServiceAgreementTemplateConditions() - nftSalesServiceAgreementTemplate.conditions = fillConditionsWithDDO( + nftSalesServiceAgreementTemplate.conditions = ddo.fillConditionsWithDDO( 'nft-sales', nftSalesTemplateConditions, - ddo, assetPrice2, token.getAddress(), undefined, @@ -417,8 +410,9 @@ describe('Secondary Markets', () => { assert.isTrue(collector2BalanceBefore.eq(initialBalances.collector2.add(nftPrice2))) // After fetching the previously created sales agreement - const assetPriceFromServiceAgreement = getAssetPriceFromService(nftSalesServiceAgreement) - const payment = findServiceConditionByName(nftSalesServiceAgreement, 'lockPayment') + const assetPriceFromServiceAgreement = + DDO.getAssetPriceFromService(nftSalesServiceAgreement) + const payment = DDO.findServiceConditionByName(nftSalesServiceAgreement, 'lockPayment') const receipt = await nevermined.agreements.conditions.lockPayment( agreementId2, @@ -468,7 +462,8 @@ describe('Secondary Markets', () => { it('Collector1 and Artist get the payment', async () => { // After fetching the previously created sales agreement - const assetPriceFromServiceAgreement = getAssetPriceFromService(nftSalesServiceAgreement) + const assetPriceFromServiceAgreement = + DDO.getAssetPriceFromService(nftSalesServiceAgreement) const escrowPaymentConditionBalanceBefore = await token.balanceOf( escrowPaymentCondition.getAddress(), @@ -504,7 +499,7 @@ describe('Secondary Markets', () => { describe('As collector1 I want to give exclusive access to the collectors owning a specific NFT', () => { before(async () => { const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(collector2) - setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice3, collector2.getId()) + ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice3, collector2.getId()) await nevermined.services.marketplace.login(clientAssertion) }) diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 174a9652c..585daac28 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -8,14 +8,24 @@ import { MetaDataMain, NvmConfig, Proof, + ServiceNFTAccess, + ServiceNFTSales, + ConditionType, + ServiceAgreementTemplateCondition, + ServiceAgreementTemplateParameter, } from './types' -import { didPrefixed, getAssetPriceFromService, zeroX } from '../utils' +import { didPrefixed, zeroX } from '../utils' import { DIDRegistry } from '../keeper' import { ethers } from 'ethers' -import { NFTAttributes } from '../models' +import { AssetPrice, NFTAttributes } from '../models' import { BigNumber } from '../utils' import { DDOPriceNotFoundError, DDOServiceNotFoundError } from '../errors' +// DDO Services including a sales process +const SALES_SERVICES = ['access', 'compute', 'nft-sales'] +// Condition Names that are the final dependency for releasing the payment in a service agreement +const DEPENDENCIES_RELEASE_CONDITION = ['access', 'serviceExecution', 'transferNFT'] + /** * DID Descriptor Object. * Contains all the data related to an asset. @@ -184,7 +194,7 @@ export class DDO { */ public getPriceByService(serviceType: ServiceType = 'access'): BigNumber { const service = this.findServiceByType(serviceType) - const assetPrice = getAssetPriceFromService(service) + const assetPrice = DDO.getAssetPriceFromService(service) if (assetPrice) { return assetPrice.getTotalPrice() @@ -293,4 +303,255 @@ export class DDO { public async addSignature(nevermined: Nevermined, publicKey: string) { this.proof.signatureValue = await nevermined.utils.signature.signText(this.shortId(), publicKey) } + + // DDO Utility functions + + /** + * If fins a service condition by name + * @param service the service to search in + * @param name the name of the condition + * @returns the condition + */ + public static findServiceConditionByName( + service: Service, + name: ConditionType, + ): ServiceAgreementTemplateCondition { + return service.attributes.serviceAgreementTemplate.conditions.find((c) => c.name === name) + } + + /** + * Gets the DID in the escrowPayment condition of the service + * @param service the service to search in + * @returns the DID + */ + public static getDIDFromService(service: Service): string { + const escrowPaymentCondition = DDO.findServiceConditionByName(service, 'escrowPayment') + return ('did:nv:' + + escrowPaymentCondition.parameters.find((p) => p.name === '_did').value) as string + } + + /** + * Gets the NFT Holder in the transferNFT condition of the service + * @param service the service to search in + * @returns the NFT Holder address + */ + public static getNftHolderFromService(service: Service): string { + const nftTransferCondition = DDO.findServiceConditionByName(service, 'transferNFT') + return nftTransferCondition.parameters.find((p) => p.name === '_nftHolder').value as string + } + + /** + * Gets the number of NFTs in the transferNFT condition of the service + * @param service the service to search in + * @returns the number of NFTs + */ + public static getNftAmountFromService(service: Service): BigNumber { + const nftTransferCondition = DDO.findServiceConditionByName(service, 'transferNFT') + return BigNumber.from( + nftTransferCondition.parameters.find((p) => p.name === '_numberNfts').value, + ) + } + + /** + * Gets the NFT Contract address used in the NFT Access or NFT Sales service + * @param service the service to search in + * @returns the NFT contract address + */ + public static getNftContractAddressFromService( + service: ServiceNFTAccess | ServiceNFTSales, + ): string { + const paramName = '_contractAddress' + const conditionName = service.type === 'nft-access' ? 'nftHolder' : 'transferNFT' + const nftTransferCondition = DDO.findServiceConditionByName(service, conditionName) + return nftTransferCondition.parameters.find((p) => p.name === paramName).value as string + } + + /** + * It gets the AssetPrice from a service with escrowPayment condition + * @param service the service to search in + * @returns the AssetPrice object + */ + public static getAssetPriceFromService(service: Service): AssetPrice { + const escrowPaymentCondition = DDO.findServiceConditionByName(service, 'escrowPayment') + if (!escrowPaymentCondition) { + return + } + + const amounts = escrowPaymentCondition.parameters.find((p) => p.name === '_amounts') + .value as string[] + const receivers = escrowPaymentCondition.parameters.find((p) => p.name === '_receivers') + .value as string[] + + const rewardsMap = new Map() + + for (let i = 0; i < amounts.length; i++) + rewardsMap.set(receivers[i], BigNumber.from(amounts[i])) + + return new AssetPrice(rewardsMap) + } + + /** + * It gets the AssetPrice from a service given the serviceType + * @param service the service to search in + * @returns the AssetPrice object + */ + public getAssetPriceFromDDOByServiceType(service: ServiceType): AssetPrice { + return DDO.getAssetPriceFromService(this.findServiceByType(service)) + } + + /** + * Given a service type, it sets the AssetPrice in the escrowPayment condition + * @param serviceType the service to search in + * @param rewards the AssetPrice object to set + * @returns + */ + public setAssetPriceFromDDOByService(serviceType: ServiceType, rewards: AssetPrice) { + const service = this.findServiceByType(serviceType) + const escrowPaymentCondition = DDO.findServiceConditionByName(service, 'escrowPayment') + if (!escrowPaymentCondition) { + return + } + const amounts = escrowPaymentCondition.parameters.find((p) => p.name === '_amounts') + const receivers = escrowPaymentCondition.parameters.find((p) => p.name === '_receivers') + amounts.value = Array.from(rewards.getAmounts(), (v) => v.toString()) + receivers.value = rewards.getReceivers() + } + + /** + * Given the service type it sets the AssetPrice and NFT holder + * @param serviceType the service type to search in + * @param rewards the AssetPrice object to set + * @param holderAddress the NFT Holder address to set + * @returns + */ + public setNFTRewardsFromDDOByService( + serviceType: ServiceType, + rewards: AssetPrice, + holderAddress: string, + ) { + this.setAssetPriceFromDDOByService(serviceType, rewards) + const service = this.findServiceByType(serviceType) + const transferCondition = DDO.findServiceConditionByName(service, 'transferNFT') + if (!transferCondition) { + return + } + const holder = transferCondition.parameters.find((p) => p.name === '_nftHolder') + holder.value = holderAddress + } + + /** + * Fills and return the conditions with the values given + * @param serviceType the service type + * @param conditions array of conditions + * @param assetPrice AssetPrice object + * @param erc20TokenContract the erc20 contract address + * @param nftTokenContract the nft contract address + * @param nftHolder the NFT holder address + * @param nftAmount the number of NFTs + * @param nftTransfer if is a NFT transfer or a NFT mint + * @param duration duration of the subscription + * @param fulfillAccessTimeout access timeout of the access condition + * @param fulfillAccessTimelock access time lock of the access condition + * @returns array of ServiceAgreementTemplateConditions + */ + public fillConditionsWithDDO( + serviceType: ServiceType, + conditions: ServiceAgreementTemplateCondition[], + assetPrice: AssetPrice = new AssetPrice(), + erc20TokenContract?: string, + nftTokenContract?: string, + nftHolder?: string, + nftAmount?: BigNumber, + nftTransfer = false, + duration = 0, + fulfillAccessTimeout = 0, + fulfillAccessTimelock = 0, + ): ServiceAgreementTemplateCondition[] { + return conditions + .map((condition) => { + if ( + DEPENDENCIES_RELEASE_CONDITION.includes(condition.name) && + SALES_SERVICES.includes(serviceType) + ) { + condition.timeout = fulfillAccessTimeout + condition.timelock = fulfillAccessTimelock + } + return condition + }) + .map((condition) => ({ + ...condition, + parameters: condition.parameters.map((parameter) => ({ + ...this.fillParameterWithDDO( + parameter, + assetPrice, + erc20TokenContract, + nftTokenContract, + nftHolder, + nftAmount, + nftTransfer, + duration, + ), + })), + })) + } + + /** + * If fills and get a ServiceAgreementTemplateParameter with the values of the DDO + * @param parameter parameter + * @param assetPrice AssetPrice object + * @param erc20TokenContract ERC20 contract address + * @param nftTokenContract NFT contract address + * @param nftHolder NFT Holder + * @param nftAmount Number of NFTs + * @param nftTransfer If is a NFT Transfer or a NFT mint + * @param duration Duration of the subscription + * @returns ServiceAgreementTemplateParameter + */ + fillParameterWithDDO( + parameter: ServiceAgreementTemplateParameter, + assetPrice: AssetPrice = new AssetPrice(), + erc20TokenContract?: string, + nftTokenContract?: string, + nftHolder?: string, + nftAmount: BigNumber = BigNumber.from(1), + nftTransfer = false, + duration = 0, + ): ServiceAgreementTemplateParameter { + const getValue = (name) => { + switch (name) { + case 'amounts': + return Array.from(assetPrice.getAmounts(), (v) => v.toString()) + case 'receivers': + return assetPrice.getReceivers() + case 'amount': + case 'price': + return String(assetPrice.getTotalPrice()) + case 'assetId': + case 'documentId': + case 'documentKeyId': + case 'did': + return this.shortId() + case 'rewardAddress': + return this.publicKey[0].owner + case 'numberNfts': + return String(nftAmount) + case 'tokenAddress': + return erc20TokenContract + case 'contract': + case 'contractAddress': + return nftTokenContract ? nftTokenContract : '' + case 'nftHolder': + return nftHolder ? nftHolder : '' + case 'nftTransfer': + return String(nftTransfer) + case 'duration': + return String(duration) + } + + return '' + } + const value = getValue(parameter.name.replace(/^_/, '')) + + return { ...parameter, value } + } } diff --git a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts index 6ea9e1470..63f1b4bd6 100644 --- a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts +++ b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts @@ -4,11 +4,12 @@ import { ConditionInstanceSmall, ProviderCondition, } from './Condition.abstract' -import { didZeroX, findServiceConditionByName, zeroX } from '../../../utils' +import { didZeroX, zeroX } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' import { Account } from '../../../nevermined' import { TxParameters } from '../ContractBase' import { BigNumber } from '../../../utils' +import { DDO } from '../../../ddo/DDO' export interface EscrowPaymentConditionContext extends ConditionContext { consumerId: string @@ -43,7 +44,7 @@ export class EscrowPaymentCondition extends ProviderCondition { public static async getInstance(config: InstantiableConfig): Promise { @@ -29,7 +30,7 @@ export class LockPaymentCondition extends ConsumerCondition { } public async paramsFromDDO({ ddo, service, price: rewards }: ConditionContext) { - const payment = findServiceConditionByName(service, 'lockPayment') + const payment = DDO.findServiceConditionByName(service, 'lockPayment') return this.params( ddo.shortId(), this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), diff --git a/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts b/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts index b96c9c121..50b2047e1 100644 --- a/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts +++ b/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts @@ -1,9 +1,9 @@ import { InstantiableConfig } from '../../../../Instantiable.abstract' -import { didZeroX, findServiceConditionByName, zeroX } from '../../../../utils' +import { didZeroX, zeroX } from '../../../../utils' import { Condition, ConditionContext, ConsumerCondition } from '../Condition.abstract' import { Account } from '../../../../nevermined' import { TxParameters } from '../../ContractBase' -import { ServiceCommon } from '../../../../ddo' +import { DDO, ServiceCommon } from '../../../../ddo' export interface NFT721HolderConditionContext extends ConditionContext { holderAddress: string @@ -30,7 +30,7 @@ export class NFT721HolderCondition extends ConsumerCondition p.name === '_contractAddress').value as string } diff --git a/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts b/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts index b0dd82087..ec26e2869 100644 --- a/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts +++ b/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts @@ -1,10 +1,10 @@ import { InstantiableConfig } from '../../../../Instantiable.abstract' -import { didZeroX, findServiceConditionByName, zeroX } from '../../../../utils' +import { didZeroX, zeroX } from '../../../../utils' import { Condition, ConditionContext, ConsumerCondition } from '../Condition.abstract' import { Account } from '../../../../nevermined' import { TxParameters } from '../../ContractBase' import { BigNumber } from '../../../../utils' -import { ServiceCommon } from '../../../../ddo' +import { DDO, ServiceCommon } from '../../../../ddo' export interface NFTHolderConditionContext extends ConditionContext { holderAddress: string @@ -43,13 +43,13 @@ export class NFTHolderCondition extends ConsumerCondition p.name === '_numberNfts').value) } public nftContractFromService(service: ServiceCommon): string { - const holder = findServiceConditionByName(service, 'nftHolder') + const holder = DDO.findServiceConditionByName(service, 'nftHolder') if (!holder) throw new Error('Holder condition not found!') const res = holder.parameters.find((p) => p.name === '_contractAddress').value as string return res || this.nevermined.keeper.nftUpgradeable.address diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts index 5aacd1093..5ce8e31ec 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts @@ -1,5 +1,5 @@ import { InstantiableConfig } from '../../../../Instantiable.abstract' -import { didZeroX, findServiceConditionByName, zeroX } from '../../../../utils' +import { didZeroX, zeroX } from '../../../../utils' import { Condition, ConditionContext, @@ -9,6 +9,7 @@ import { } from '../Condition.abstract' import { Account } from '../../../../nevermined' import { TxParameters } from '../../ContractBase' +import { DDO } from '../../../../ddo/DDO' export interface TransferNFT721ConditionContext extends ConditionContext { consumerId: string @@ -82,7 +83,7 @@ export class TransferNFT721Condition extends ProviderCondition p.name === '_contractAddress') diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts index c81120e22..c041e6d01 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts @@ -1,5 +1,5 @@ import { InstantiableConfig } from '../../../../Instantiable.abstract' -import { didZeroX, findServiceConditionByName, zeroX } from '../../../../utils' +import { didZeroX, zeroX } from '../../../../utils' import { Condition, ConditionContext, @@ -10,7 +10,7 @@ import { import { Account } from '../../../../nevermined' import { TxParameters } from '../../ContractBase' import { BigNumber } from '../../../../utils' -import { ServiceCommon } from '../../../..' +import { DDO, ServiceCommon } from '../../../..' export interface TransferNFTConditionContext extends ConditionContext { providerId: string @@ -83,7 +83,7 @@ export class TransferNFTCondition extends ProviderCondition p.name === '_contractAddress')?.value as string return res || this.nevermined.keeper.nftUpgradeable.address @@ -93,7 +93,7 @@ export class TransferNFTCondition extends ProviderCondition p.name === '_nftHolder').value as string) diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index c6c3430a8..2cd546e84 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -7,13 +7,7 @@ import { conditionStateNames, } from '../conditions' import { DDO, ServiceAgreementTemplate, Service, ServiceType } from '../../../ddo' -import { - didZeroX, - findServiceConditionByName, - getAssetPriceFromService, - ZeroAddress, - zeroX, -} from '../../../utils' +import { didZeroX, ZeroAddress, zeroX } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' import { AssetPrice, BabyjubPublicKey } from '../../../models' import { Account, OrderProgressStep } from '../../../nevermined' @@ -83,8 +77,8 @@ export abstract class AgreementTemplate extends ContractBase { } public paymentData(service: Service): PaymentData { - const assetPrice = getAssetPriceFromService(service) - const payment = findServiceConditionByName(service, 'lockPayment') + const assetPrice = DDO.getAssetPriceFromService(service) + const payment = DDO.findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') return { rewardAddress: this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), @@ -205,7 +199,7 @@ export abstract class AgreementTemplate extends ContractBase { public standardContext(ddo: DDO, creator: string): ConditionContext { const service = ddo.findServiceByType(this.service()) - const rewards = getAssetPriceFromService(service) + const rewards = DDO.getAssetPriceFromService(service) return { ddo, service, price: rewards, creator } } @@ -269,8 +263,8 @@ export abstract class AgreementTemplate extends ContractBase { ) const service = ddo.findServiceByType(this.service()) - const assetPrice = getAssetPriceFromService(service) - const payment = findServiceConditionByName(service, 'lockPayment') + const assetPrice = DDO.getAssetPriceFromService(service) + const payment = DDO.findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') const rewardAddress = this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress() const tokenAddress = payment.parameters.find((p) => p.name === '_tokenAddress').value as string diff --git a/src/nevermined/api/AssetsApi.ts b/src/nevermined/api/AssetsApi.ts index c3892359f..768d2a059 100644 --- a/src/nevermined/api/AssetsApi.ts +++ b/src/nevermined/api/AssetsApi.ts @@ -1,10 +1,10 @@ import { DDO, MetaData, ServiceNFTAccess, ServiceNFTSales, ServiceType } from '../../ddo' import { Account } from '../Account' -import { SubscribablePromise, didZeroX, getNftContractAddressFromService } from '../../utils' +import { SubscribablePromise, didZeroX } from '../../utils' import { InstantiableConfig } from '../../Instantiable.abstract' import { TxParameters, RoyaltyScheme } from '../../keeper' import { AssetError, DDOError } from '../../errors' -import { Nevermined } from '../../sdk' +import { Nevermined, apiPath } from '../../sdk' import { ContractReceipt } from 'ethers' import { DIDResolvePolicy, RegistryBaseApi } from './RegistryBaseApi' import { CreateProgressStep, OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' @@ -346,7 +346,15 @@ export class AssetsApi extends RegistryBaseApi { const { attributes } = ddo.findServiceByType('metadata') const { files } = attributes.main - const { serviceEndpoint, index } = ddo.findServiceByType(serviceType) + let serviceEndpoint, index + if (ddo.serviceExists(serviceType)) { + const service = ddo.findServiceByType(serviceType) + serviceEndpoint = service.serviceEndpoint + index = service.index + } else { + serviceEndpoint = `${this.config.marketplaceUri}/${apiPath}/${did}` + index = 0 + } if (!serviceEndpoint) { throw new AssetError( @@ -441,9 +449,9 @@ export class AssetsApi extends RegistryBaseApi { public getNftContractAddress(ddo: DDO, serviceType: ServiceType = 'nft-access') { const service = ddo.findServiceByType(serviceType) if (service.type === 'nft-access') - return getNftContractAddressFromService(service as ServiceNFTAccess) + return DDO.getNftContractAddressFromService(service as ServiceNFTAccess) else if (service.type === 'nft-sales') - return getNftContractAddressFromService(service as ServiceNFTSales) + return DDO.getNftContractAddressFromService(service as ServiceNFTSales) throw new DDOError(`Unable to find NFT contract address in service ${serviceType}`) } } diff --git a/src/nevermined/api/ConditionsApi.ts b/src/nevermined/api/ConditionsApi.ts index a3426ff3b..e2b955061 100644 --- a/src/nevermined/api/ConditionsApi.ts +++ b/src/nevermined/api/ConditionsApi.ts @@ -1,7 +1,7 @@ import { Account } from '../Account' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { DDO } from '../../ddo' -import { findServiceConditionByName, ZeroAddress } from '../../utils' +import { ZeroAddress } from '../../utils' import { Token, CustomToken, TxParameters as txParams } from '../../keeper' import { AssetPrice } from '../../models' import { KeeperError } from '../../errors/KeeperError' @@ -355,7 +355,7 @@ export class ConditionsApi extends Instantiable { const { nft721HolderCondition } = this.nevermined.keeper.conditions const accessService = ddo.findServiceByType('nft-access') - const holder = findServiceConditionByName(accessService, 'nftHolder') + const holder = DDO.findServiceConditionByName(accessService, 'nftHolder') const contractReceipt: ContractReceipt = await nft721HolderCondition.fulfill( agreementId, diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index fe3a38b2f..cb928f877 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -10,13 +10,7 @@ import { import { AssetAttributes, NFTAttributes } from '../../models' import { Account, CreateProgressStep, DID } from '../../nevermined' import { TxParameters, ServiceAaveCredit, DEFAULT_REGISTRATION_ACTIVITY_ID } from '../../keeper' -import { - SubscribablePromise, - zeroX, - generateId, - fillConditionsWithDDO, - ZeroAddress, -} from '../../utils' +import { SubscribablePromise, zeroX, generateId, ZeroAddress } from '../../utils' import { PublishMetadata } from './AssetsApi' import { OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' import { AssetError } from '../../errors/AssetError' @@ -147,10 +141,9 @@ export abstract class RegistryBaseApi extends Instantiable { } = nftAttributes || {} const sat: ServiceAgreementTemplate = service.attributes.serviceAgreementTemplate - sat.conditions = fillConditionsWithDDO( + sat.conditions = ddo.fillConditionsWithDDO( name, sat.conditions, - ddo, assetAttributes.price, tokenAddress, nftContractAddress, diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 03f737c74..a236def0f 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -8,7 +8,6 @@ import { EventOptions, NeverminedNFT721Type, SearchQuery, - getNftContractAddressFromService, } from '../../sdk' const EMPTY_RESULT: QueryResult = { @@ -498,7 +497,7 @@ export class SearchApi extends Instantiable { return EMPTY_RESULT } - const nftContractAddress = getNftContractAddressFromService(nftSalesService) + const nftContractAddress = DDO.getNftContractAddressFromService(nftSalesService) return this.servicesByNftContract( nftContractAddress, @@ -628,7 +627,7 @@ export class SearchApi extends Instantiable { return EMPTY_RESULT } - const nftContractAddress = getNftContractAddressFromService(nftSalesService) + const nftContractAddress = DDO.getNftContractAddressFromService(nftSalesService) return this.datasetsByNftContract( nftContractAddress, diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index d6f57231d..27a33860f 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -1,12 +1,6 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { AssetAttributes, NFTAttributes } from '../../../models' -import { - generateId, - getDIDFromService, - getNftAmountFromService, - SubscribablePromise, - zeroX, -} from '../../../utils' +import { generateId, SubscribablePromise, zeroX } from '../../../utils' import { PublishMetadata } from '../AssetsApi' import { Account } from '../../Account' import { TxParameters, Nft1155Contract } from '../../../keeper' @@ -498,8 +492,8 @@ export class NFT1155Api extends NFTsBaseApi { txParams?: TxParameters, ): Promise { const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) - const did = getDIDFromService(service) - const nftAmount = getNftAmountFromService(service) + const did = DDO.getDIDFromService(service) + const nftAmount = DDO.getNftAmountFromService(service) const ddo = await this.nevermined.assets.resolve(did) ddo.updateService(this.nevermined, service) const agreementId = await this.nevermined.keeper.agreementStoreManager.agreementId( diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index cdfffb901..cd95889e9 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -1,7 +1,7 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { DDO } from '../../../ddo' import { NFTAttributes, AssetAttributes } from '../../../models' -import { generateId, getDIDFromService, SubscribablePromise, zeroX } from '../../../utils' +import { generateId, SubscribablePromise, zeroX } from '../../../utils' import { Account } from '../../Account' import { Nft721Contract, TxParameters } from '../../../keeper' import { PublishMetadata } from '../AssetsApi' @@ -511,7 +511,7 @@ export class NFT721Api extends NFTsBaseApi { txParams?: TxParameters, ): Promise { const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) - const did = getDIDFromService(service) + const did = DDO.getDIDFromService(service) const ddo = await this.nevermined.assets.resolve(did) ddo.updateService(this.nevermined, service) const agreementId = await this.nevermined.keeper.agreementStoreManager.agreementId( diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 61e1b5771..b6631a110 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -1,12 +1,5 @@ import { DDO, ServiceType } from '../../../ddo' -import { - fillConditionsWithDDO, - findServiceConditionByName, - getAssetPriceFromService, - getDIDFromService, - getNftHolderFromService, - zeroX, -} from '../../../utils' +import { zeroX } from '../../../utils' import { AssetPrice, Babysig, ERCType } from '../../../models' import { RoyaltyKind } from '../AssetsApi' import { Account } from '../../Account' @@ -247,10 +240,9 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { const nftSalesTemplateConditions = await nftSalesTemplate.getServiceAgreementTemplateConditions() - nftSalesServiceAgreementTemplate.conditions = fillConditionsWithDDO( + nftSalesServiceAgreementTemplate.conditions = ddo.fillConditionsWithDDO( serviceType, nftSalesTemplateConditions, - ddo, assetPrice, token.getAddress(), undefined, @@ -321,10 +313,10 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { ): Promise { const { nftSalesTemplate } = this.nevermined.keeper.templates const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) - const assetPrice = getAssetPriceFromService(service) + const assetPrice = DDO.getAssetPriceFromService(service) // has no privkeys, so we can't sign - const currentNftHolder = new Account(getNftHolderFromService(service)) - const did = getDIDFromService(service) + const currentNftHolder = new Account(DDO.getNftHolderFromService(service)) + const did = DDO.getDIDFromService(service) const ddo = await this.nevermined.assets.resolve(did) ddo.updateService(this.nevermined, service) @@ -340,7 +332,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { if (!agreementId) throw new Error('Creating buy agreement failed') - const payment = findServiceConditionByName(service, 'lockPayment') + const payment = DDO.findServiceConditionByName(service, 'lockPayment') const receipt = await this.nevermined.agreements.conditions.lockPayment( agreementId, diff --git a/src/services/metadata/MetadataService.ts b/src/services/metadata/MetadataService.ts index ba82729ba..ddfd76415 100644 --- a/src/services/metadata/MetadataService.ts +++ b/src/services/metadata/MetadataService.ts @@ -4,8 +4,8 @@ import { MarketplaceApi } from './MarketplaceAPI' import { ApiError, HttpError } from '../../errors' import { SearchQuery } from '../../common/interfaces' -const apiPath = '/api/v1/metadata/assets/ddo' -const servicePath = '/api/v1/metadata/assets/service' +export const apiPath = '/api/v1/metadata/assets/ddo' +export const servicePath = '/api/v1/metadata/assets/service' export interface QueryResult { results: DDO[] diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 74199bc14..f8598bacf 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -16,6 +16,7 @@ const SALES_SERVICES = ['access', 'compute', 'nft-sales'] // Condition Names that are the final dependency for releasing the payment in a service agreement const DEPENDENCIES_RELEASE_CONDITION = ['access', 'serviceExecution', 'transferNFT'] +// @deprecated Use `DDO.fillParameterWithDDO` function fillParameterWithDDO( parameter: ServiceAgreementTemplateParameter, ddo: DDO, @@ -77,6 +78,7 @@ function fillParameterWithDDO( * * @returns Filled conditions. */ +// @deprecated Use `fillConditionsWithDDO` export function fillConditionsWithDDO( serviceType: ServiceType, conditions: ServiceAgreementTemplateCondition[], @@ -120,6 +122,7 @@ export function fillConditionsWithDDO( })) } +// @deprecated Use `DDO.findServiceConditionByName` instead export function findServiceConditionByName( service: Service, name: ConditionType, @@ -127,10 +130,12 @@ export function findServiceConditionByName( return service.attributes.serviceAgreementTemplate.conditions.find((c) => c.name === name) } +// @deprecated Use `DDO.getAssetPriceFromDDOByServiceType` instead export function getAssetPriceFromDDOByService(ddo: DDO, service: ServiceType): AssetPrice { return getAssetPriceFromService(ddo.findServiceByType(service)) } +// @deprecated Use `DDO.setNFTRewardsFromDDOByService` instead export function setNFTRewardsFromDDOByService( ddo: DDO, serviceType: ServiceType, @@ -147,6 +152,7 @@ export function setNFTRewardsFromDDOByService( holder.value = holderAddress } +// @deprecated Use `DDO.setAssetPriceFromDDOByService` instead export function setAssetPriceFromDDOByService( ddo: DDO, serviceType: ServiceType, @@ -163,6 +169,7 @@ export function setAssetPriceFromDDOByService( receivers.value = rewards.getReceivers() } +// @deprecated Use `DDO.getAssetPriceFromService` instead export function getAssetPriceFromService(service: Service): AssetPrice { const escrowPaymentCondition = findServiceConditionByName(service, 'escrowPayment') if (!escrowPaymentCondition) { @@ -181,22 +188,26 @@ export function getAssetPriceFromService(service: Service): AssetPrice { return new AssetPrice(rewardsMap) } +// @deprecated Use `DDO.getDIDFromService` instead export function getDIDFromService(service: Service): string { const escrowPaymentCondition = findServiceConditionByName(service, 'escrowPayment') return ('did:nv:' + escrowPaymentCondition.parameters.find((p) => p.name === '_did').value) as string } +// @deprecated Use `DDO.getNftHolderFromService` instead export function getNftHolderFromService(service: Service): string { const nftTransferCondition = findServiceConditionByName(service, 'transferNFT') return nftTransferCondition.parameters.find((p) => p.name === '_nftHolder').value as string } +// @deprecated Use `DDO.getNftAmountFromService` instead export function getNftAmountFromService(service: Service): BigNumber { const nftTransferCondition = findServiceConditionByName(service, 'transferNFT') return BigNumber.from(nftTransferCondition.parameters.find((p) => p.name === '_numberNfts').value) } +// @deprecated Use `DDO.getNftContractAddressFromService` instead export function getNftContractAddressFromService( service: ServiceNFTAccess | ServiceNFTSales, ): string { From e97a378dfdc86d99e5f392010b7c5e08e51c4e5b Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:07:03 +0200 Subject: [PATCH 004/151] feat: adding function to get values from conditions --- src/ddo/DDO.ts | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 585daac28..66fb9dc23 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -325,9 +325,7 @@ export class DDO { * @returns the DID */ public static getDIDFromService(service: Service): string { - const escrowPaymentCondition = DDO.findServiceConditionByName(service, 'escrowPayment') - return ('did:nv:' + - escrowPaymentCondition.parameters.find((p) => p.name === '_did').value) as string + return `did:nv:${DDO.getParameterFromCondition(service, 'escrowPayment', '_did') as string}` } /** @@ -336,8 +334,7 @@ export class DDO { * @returns the NFT Holder address */ public static getNftHolderFromService(service: Service): string { - const nftTransferCondition = DDO.findServiceConditionByName(service, 'transferNFT') - return nftTransferCondition.parameters.find((p) => p.name === '_nftHolder').value as string + return DDO.getParameterFromCondition(service, 'transferNFT', '_nftHolder') as string } /** @@ -346,10 +343,23 @@ export class DDO { * @returns the number of NFTs */ public static getNftAmountFromService(service: Service): BigNumber { - const nftTransferCondition = DDO.findServiceConditionByName(service, 'transferNFT') - return BigNumber.from( - nftTransferCondition.parameters.find((p) => p.name === '_numberNfts').value, - ) + return BigNumber.from(DDO.getParameterFromCondition(service, 'transferNFT', '_numberNfts')) + } + + /** + * Given a service, condition and param name it returns the value + * @param service The service where the condition is + * @param conditionType the condition type + * @param paramName the param name + * @returns the value + */ + public static getParameterFromCondition( + service: Service, + conditionType: ConditionType, + paramName: string, + ): string | number | string[] { + const nftTransferCondition = DDO.findServiceConditionByName(service, conditionType) + return nftTransferCondition.parameters.find((p) => p.name === paramName).value } /** From ad2d1b4eb25772a589fb4cd0ab26007bbc7af74a Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 7 Jul 2023 17:56:10 +0200 Subject: [PATCH 005/151] feat: allow the registration of multiple services of the same type --- integration/external/Datasets.e2e.test.ts | 10 ++- integration/external/Services.e2e.test.ts | 14 +++- integration/nevermined/Arweave.test.ts | 7 +- integration/nevermined/Assets.test.ts | 70 +++++++++++++++++-- .../nevermined/AssetsPriceQuery.test.ts | 18 ++++- .../ClaimPaymentAbortedAgreement.test.ts | 11 ++- integration/nevermined/ConsumeAsset.test.ts | 10 ++- .../nevermined/ConsumeAssetViaNode.test.ts | 7 +- .../ConsumeExternalDDOAsset.test.ts | 7 +- integration/nevermined/DDO.test.ts | 42 ++++++++--- integration/nevermined/MetaTx.test.ts | 2 +- integration/nevermined/Metadata.test.ts | 7 +- integration/nevermined/NFT.test.ts | 19 +++-- integration/nevermined/NFT1155.test.ts | 11 ++- integration/nevermined/NFT1155Api.e2e.test.ts | 41 ++++++++--- integration/nevermined/NFT721.test.ts | 31 ++++++-- integration/nevermined/NFT721Api.e2e.test.ts | 12 +++- .../nevermined/NFT721Templates.test.ts | 22 ++++-- integration/nevermined/NFTTemplates.test.ts | 33 +++++++-- .../nevermined/NFTTemplatesWithEther.test.ts | 11 ++- integration/nevermined/Poap.test.ts | 15 +++- .../nevermined/RegisterAccessTemplate.test.ts | 10 ++- ...sterEscrowComputeExecutionTemplate.test.ts | 12 +++- .../nevermined/SecondaryMarket.test.ts | 11 ++- .../nevermined/SubscriptionDuration.test.ts | 42 ++++++++--- .../nevermined/Subscriptions.e2e.test.ts | 22 ++++-- integration/resources/ddo-algorithm.json | 4 +- integration/resources/ddo-compute.json | 10 +-- integration/resources/ddo-dataset.json | 4 +- integration/resources/ddo-nft.json | 6 +- integration/resources/ddo-workflow.json | 4 +- src/ddo/DDO.ts | 25 ++++++- src/ddo/types.ts | 6 ++ .../templates/AgreementTemplate.abstract.ts | 2 +- .../templates/BaseTemplate.abstract.ts | 3 +- src/models/AssetAttributes.ts | 34 ++++++--- src/models/AssetPrice.ts | 16 +++-- src/nevermined/api/ComputeApi.ts | 8 ++- src/nevermined/api/RegistryBaseApi.ts | 33 +++++---- src/nevermined/api/nfts/NFT1155Api.ts | 2 +- src/nevermined/api/nfts/NFT721Api.ts | 2 +- src/nevermined/api/nfts/NFTsBaseApi.ts | 2 +- 42 files changed, 518 insertions(+), 140 deletions(-) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index 01abdf6fa..359a5a893 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -177,8 +177,12 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { subscriptionMetadata = getMetadata(undefined, 'Service Subscription NFT') const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: subscriptionMetadata, - price: assetPrice, - serviceTypes: ['nft-sales'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + }, + ], providers: [neverminedNodeAddress], duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, @@ -197,7 +201,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata: datasetMetadata, - serviceTypes: ['nft-access'], + services: [{ serviceType: 'nft-access' }], providers: [neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint, diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index 1221a41f0..2056060c3 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -237,8 +237,12 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { subscriptionMetadata.main.type = 'subscription' const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: subscriptionMetadata, - price: assetPrice, - serviceTypes: ['nft-sales'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + }, + ], providers: [neverminedNodeAddress], duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, @@ -268,7 +272,11 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata: serviceMetadata, - serviceTypes: ['nft-access'], + services: [ + { + serviceType: 'nft-access', + }, + ], providers: [neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint, diff --git a/integration/nevermined/Arweave.test.ts b/integration/nevermined/Arweave.test.ts index 494c807b9..2657d3ee8 100644 --- a/integration/nevermined/Arweave.test.ts +++ b/integration/nevermined/Arweave.test.ts @@ -23,7 +23,12 @@ describe.skip('Get DDO status', () => { it('should get the external status of an asset', async () => { const assetAttributes = AssetAttributes.getInstance({ metadata: getMetadata(), - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], }) const ddo = await nevermined.assets.create(assetAttributes, publisher) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index 918c821f1..be3667b0f 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -34,7 +34,12 @@ describe('Assets', () => { metadata.userId = payload.sub const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], }) ddoBefore = await nevermined.assets.create(assetAttributes, publisher) }) @@ -49,7 +54,12 @@ describe('Assets', () => { const assetAttributes = AssetAttributes.getInstance({ metadata: createdMetadata, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], }) ddo = await nevermined.assets.create(assetAttributes, publisher, PublishMetadata.IPFS) @@ -66,6 +76,41 @@ describe('Assets', () => { assert.equal(metadata.attributes.main.ercType, 721) assert.equal(metadata.attributes.additionalInformation.tags[0], 'test') }) + + it('register with multiple services of the same service type', async () => { + const nonce = Math.random() + createdMetadata = getMetadata(nonce, `Immutable Multiple Services Test ${nonce}`) + + createdMetadata.main.ercType = 721 + createdMetadata.additionalInformation.tags = ['test'] + + const assetAttributes = AssetAttributes.getInstance({ + metadata: createdMetadata, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + { + serviceType: 'access', + price: assetPrice, + }, + ], + }) + ddo = await nevermined.assets.create(assetAttributes, publisher, PublishMetadata.IPFS) + + assert.isDefined(ddo) + console.log(ddo.id) + + const accessServices = ddo.getServicesByType('access') + assert.equal(accessServices.length, 2) + assert.equal(accessServices[0].index, 2) + assert.equal(accessServices[1].index, 3) + + const metadata = ddo.findServiceByType('metadata') + assert.equal(metadata.attributes.main.ercType, 721) + assert.equal(metadata.attributes.additionalInformation.tags[0], 'test') + }) }) describe('#resolve()', () => { @@ -240,7 +285,12 @@ describe('Assets', () => { // Create 1 asset with appId-test1 const assetAttributes = AssetAttributes.getInstance({ metadata: metadata1, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], appId: appId1, }) ddoBefore = await neverminedApp1.assets.create(assetAttributes, publisher) @@ -249,7 +299,12 @@ describe('Assets', () => { // Create 2 assets with appId-test2 const assetAttributes2 = AssetAttributes.getInstance({ metadata: metadata2, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], appId: appId2, }) ddoBefore = await neverminedApp2.assets.create(assetAttributes2, publisher) @@ -257,7 +312,12 @@ describe('Assets', () => { const assetAttributes22 = AssetAttributes.getInstance({ metadata: metadata22, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], appId: appId2, }) ddoBefore = await neverminedApp2.assets.create(assetAttributes22, publisher) diff --git a/integration/nevermined/AssetsPriceQuery.test.ts b/integration/nevermined/AssetsPriceQuery.test.ts index d7ea8ba58..55b5efe86 100644 --- a/integration/nevermined/AssetsPriceQuery.test.ts +++ b/integration/nevermined/AssetsPriceQuery.test.ts @@ -44,7 +44,12 @@ describe('Assets Query by Price', () => { const _attributes = AssetAttributes.getInstance({ metadata, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], appId, }) ddoAccess = await nevermined.assets.create(_attributes, account) @@ -62,8 +67,15 @@ describe('Assets Query by Price', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + }, + { + serviceType: 'nft-access', + }, + ], appId, }) const nftAttributes = NFTAttributes.getNFT1155Instance({ diff --git a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts index 1e2b8795f..251065ea8 100644 --- a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts +++ b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts @@ -108,9 +108,16 @@ describe('Claim aborted agreements End-to-End', () => { it('I want to register a new asset and tokenize (via NFT). The sales agreement expires in a few blocks', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, - price: assetPrice1, providers: [neverminedNodeAddress], - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], nftContractAddress: nftContract.address, fulfillAccessTimeout: accessTimeout, fulfillAccessTimelock: accessTimelock, diff --git a/integration/nevermined/ConsumeAsset.test.ts b/integration/nevermined/ConsumeAsset.test.ts index f6147ebd7..78e02ec75 100644 --- a/integration/nevermined/ConsumeAsset.test.ts +++ b/integration/nevermined/ConsumeAsset.test.ts @@ -51,7 +51,15 @@ describe('Consume Asset', () => { it('should register an asset', async () => { ddo = await nevermined.assets.create( - AssetAttributes.getInstance({ metadata, price: assetPrice }), + AssetAttributes.getInstance({ + metadata, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], + }), publisher, ) diff --git a/integration/nevermined/ConsumeAssetViaNode.test.ts b/integration/nevermined/ConsumeAssetViaNode.test.ts index 09b72de68..c895674e2 100644 --- a/integration/nevermined/ConsumeAssetViaNode.test.ts +++ b/integration/nevermined/ConsumeAssetViaNode.test.ts @@ -67,7 +67,12 @@ describe('Consume Asset (Nevermined Node)', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], providers: [config.neverminedNodeAddress], }) ddo = await nevermined.assets diff --git a/integration/nevermined/ConsumeExternalDDOAsset.test.ts b/integration/nevermined/ConsumeExternalDDOAsset.test.ts index 3d0b92022..c41c380d3 100644 --- a/integration/nevermined/ConsumeExternalDDOAsset.test.ts +++ b/integration/nevermined/ConsumeExternalDDOAsset.test.ts @@ -50,7 +50,12 @@ describe('Consume Asset (Documentation example)', () => { ddo = await nevermined.assets.create( AssetAttributes.getInstance({ metadata, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], }), publisher, ) diff --git a/integration/nevermined/DDO.test.ts b/integration/nevermined/DDO.test.ts index ac65f30fb..cd1b0b5f0 100644 --- a/integration/nevermined/DDO.test.ts +++ b/integration/nevermined/DDO.test.ts @@ -74,7 +74,12 @@ describe('DDO Tests', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price, + services: [ + { + serviceType: 'access', + price, + }, + ], providers: [config.neverminedNodeAddress], }) @@ -110,7 +115,7 @@ describe('DDO Tests', () => { assert.isFalse(ddo.serviceExists('compute')) assert.isTrue(ddo.serviceIndexExists(0)) // metadata - assert.isTrue(ddo.serviceIndexExists(3)) // access + assert.isTrue(ddo.serviceIndexExists(2)) // access assert.isFalse(ddo.serviceIndexExists(99)) }) @@ -141,8 +146,15 @@ describe('DDO Tests', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price, + }, + { + serviceType: 'nft-access', + }, + ], providers: [config.neverminedNodeAddress], }) const royaltyAttributes = getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, 100000) @@ -218,7 +230,12 @@ describe('DDO Tests', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price, + services: [ + { + serviceType: 'access', + price, + }, + ], providers: [config.neverminedNodeAddress], }) @@ -304,7 +321,12 @@ describe('DDO Tests', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price, + services: [ + { + serviceType: 'access', + price, + }, + ], providers: [config.neverminedNodeAddress], }) @@ -362,8 +384,12 @@ describe('DDO Tests', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price, - serviceTypes: ['compute'], + services: [ + { + serviceType: 'compute', + price: price, + }, + ], providers: [config.neverminedNodeAddress], }) diff --git a/integration/nevermined/MetaTx.test.ts b/integration/nevermined/MetaTx.test.ts index cab9a1c82..e2f8e5fff 100644 --- a/integration/nevermined/MetaTx.test.ts +++ b/integration/nevermined/MetaTx.test.ts @@ -47,7 +47,7 @@ describe.skip('MetaTx test with nfts', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ metadata, - serviceTypes: ['nft-sales', 'nft-access'], + services: [{ serviceType: 'nft-sales' }, { serviceType: 'nft-access' }], nftContractAddress: nevermined.nfts1155.nftContract.address, cap: BigNumber.from(10), royaltyAttributes, diff --git a/integration/nevermined/Metadata.test.ts b/integration/nevermined/Metadata.test.ts index 445b9a488..b96009c09 100644 --- a/integration/nevermined/Metadata.test.ts +++ b/integration/nevermined/Metadata.test.ts @@ -26,7 +26,12 @@ describe('Get DDO status', () => { const ddo = await nevermined.assets.create( AssetAttributes.getInstance({ metadata, - price: assetPrice, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], }), publisher, ) diff --git a/integration/nevermined/NFT.test.ts b/integration/nevermined/NFT.test.ts index 179469239..85412df10 100644 --- a/integration/nevermined/NFT.test.ts +++ b/integration/nevermined/NFT.test.ts @@ -36,7 +36,7 @@ describe('Nfts operations', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ metadata, - serviceTypes: ['nft-sales', 'nft-access'], + services: [{ serviceType: 'nft-sales' }, { serviceType: 'nft-access' }], nftContractAddress: nevermined.nfts1155.nftContract.address, cap: BigNumber.from(10), royaltyAttributes, @@ -85,7 +85,7 @@ describe('Nfts operations', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ metadata, - serviceTypes: ['nft-sales', 'nft-access'], + services: [{ serviceType: 'nft-sales' }, { serviceType: 'nft-access' }], nftContractAddress: nevermined.nfts1155.nftContract.address, cap: BigNumber.from(10), royaltyAttributes, @@ -118,10 +118,17 @@ describe('Nfts operations', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ metadata, - serviceTypes: ['nft-sales', 'nft-access'], - price: new AssetPrice(artist.getId(), BigNumber.parseEther('0.1')).setTokenAddress( - ZeroAddress, - ), + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice(artist.getId(), BigNumber.parseEther('0.1')).setTokenAddress( + ZeroAddress, + ), + }, + { + serviceType: 'nft-access', + }, + ], nftContractAddress: nevermined.nfts1155.nftContract.address, cap: BigNumber.from(10), royaltyAttributes, diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 2e2a348d6..bb094916b 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -107,8 +107,15 @@ describe('NFT1155 End-to-End', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index b6ddb4973..f9d6298f7 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -151,8 +151,15 @@ function makeTest(isCustom) { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], providers: [config.neverminedNodeAddress], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ @@ -319,8 +326,15 @@ function makeTest(isCustom) { const assetAttributes = AssetAttributes.getInstance({ metadata: newMetadata, - serviceTypes: ['nft-sales', 'nft-access'], - price: assetPrice1, + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, @@ -388,8 +402,15 @@ function makeTest(isCustom) { const assetAttributes = AssetAttributes.getInstance({ metadata: newMetadata, - serviceTypes: ['nft-sales', 'nft-access'], - price: assetPrice1, + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, @@ -477,8 +498,12 @@ function makeTest(isCustom) { const assetAttributes = AssetAttributes.getInstance({ metadata: getMetadata(), - serviceTypes: ['nft-sales'], - price: new AssetPrice(artist.getId(), BigNumber.from(0)), + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice(artist.getId(), BigNumber.from(0)), + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, diff --git a/integration/nevermined/NFT721.test.ts b/integration/nevermined/NFT721.test.ts index 32e0aafab..f566f1d68 100644 --- a/integration/nevermined/NFT721.test.ts +++ b/integration/nevermined/NFT721.test.ts @@ -72,7 +72,14 @@ describe('Nfts721 operations', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + }, + { + serviceType: 'nft-access', + }, + ], nftContractAddress: nft.address, }) assert.equal(nftAttributes.fulfillAccessTimelock, 0) @@ -128,8 +135,15 @@ describe('Nfts721 operations', async () => { // artist creates the nft const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, - price: new AssetPrice().setTokenAddress(token.getAddress()), - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice().setTokenAddress(token.getAddress()), + }, + { + serviceType: 'nft-access', + }, + ], nftContractAddress: nft.address, preMint: false, }) @@ -170,8 +184,15 @@ describe('Nfts721 operations', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, - price: assetPrice, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + }, + { + serviceType: 'nft-access', + }, + ], nftContractAddress: nft.address, preMint: false, }) diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index 18b20b8fd..458977f61 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -111,8 +111,15 @@ describe('NFTs721 Api End-to-End', () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], nftContractAddress: nftContract.address, }) ddo = await nevermined.nfts721.create(nftAttributes, artist) @@ -147,6 +154,7 @@ describe('NFTs721 Api End-to-End', () => { agreementId = await nevermined.nfts721.order(ddo.id, collector1) + console.log(`DID: ${ddo.id}`) assert.isDefined(agreementId) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 79fe24a98..4e9e53f8b 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -194,8 +194,15 @@ describe('NFT721Templates E2E', () => { const nftAttributes = NFTAttributes.getInstance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], ercType: 721, nftType: NeverminedNFT721Type.nft721, nftContractAddress: nft.address, @@ -639,8 +646,15 @@ describe('NFT721Templates E2E', () => { const nftAttributes = NFTAttributes.getInstance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], ercType: 721, nftType: NeverminedNFT721Type.nft721, nftContractAddress: nft.address, diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index c49f760af..6ca3face1 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -169,8 +169,15 @@ describe('NFTTemplates E2E', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, @@ -624,8 +631,15 @@ describe('NFTTemplates E2E', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, @@ -924,8 +938,15 @@ describe('NFTTemplates E2E', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index 16210b4ad..460eddb3f 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -165,8 +165,15 @@ describe('NFTTemplates With Ether E2E', async () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, diff --git a/integration/nevermined/Poap.test.ts b/integration/nevermined/Poap.test.ts index da4179770..832c55761 100644 --- a/integration/nevermined/Poap.test.ts +++ b/integration/nevermined/Poap.test.ts @@ -69,8 +69,19 @@ describe('POAPs with Assets', () => { it('editor should be able to register poap', async () => { const nftAttributes = NFTAttributes.getPOAPInstance({ metadata, - price: new AssetPrice(editor.getId(), BigNumber.from(0), nevermined.utils.token.getAddress()), - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice( + editor.getId(), + BigNumber.from(0), + nevermined.utils.token.getAddress(), + ), + }, + { + serviceType: 'nft-access', + }, + ], providers: [gatewayAddress], nftContractAddress: poapContract.address, preMint: false, diff --git a/integration/nevermined/RegisterAccessTemplate.test.ts b/integration/nevermined/RegisterAccessTemplate.test.ts index 4067cc626..0749af568 100644 --- a/integration/nevermined/RegisterAccessTemplate.test.ts +++ b/integration/nevermined/RegisterAccessTemplate.test.ts @@ -258,7 +258,15 @@ describe('Register Escrow Access Template', () => { ) ddo = await nevermined.assets.create( - AssetAttributes.getInstance({ metadata, price: assetPrice }), + AssetAttributes.getInstance({ + metadata, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], + }), publisher, ) }) diff --git a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts index 73195d269..7f63e1f66 100644 --- a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts @@ -282,8 +282,16 @@ describe('Register Escrow Compute Execution Template', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice, - serviceTypes: ['access', 'compute'], + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + { + serviceType: 'compute', + price: assetPrice, + }, + ], }) ddo = await nevermined.assets.create(assetAttributes, publisher) }) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index d9e51a353..c5d16861b 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -175,8 +175,15 @@ describe('Secondary Markets', () => { const assetAttributes = AssetAttributes.getInstance({ metadata, - price: assetPrice1, - serviceTypes: ['nft-sales', 'nft-access'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + { + serviceType: 'nft-access', + }, + ], }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, diff --git a/integration/nevermined/SubscriptionDuration.test.ts b/integration/nevermined/SubscriptionDuration.test.ts index dbfe1e37e..2394b1376 100644 --- a/integration/nevermined/SubscriptionDuration.test.ts +++ b/integration/nevermined/SubscriptionDuration.test.ts @@ -48,8 +48,12 @@ describe('Subscription Durations', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(publisher.getId(), BigNumber.from(0)), - serviceTypes: ['nft-sales'], + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + }, + ], providers: [config.neverminedNodeAddress], duration: 0, nftContractAddress: subscriptionNFT.address, @@ -63,7 +67,11 @@ describe('Subscription Durations', () => { it('The publisher creates a dataset to associate to the subscription', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata: getMetadata(), - serviceTypes: ['nft-access'], + services: [ + { + serviceType: 'nft-access', + }, + ], providers: [config.neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint: false, @@ -133,8 +141,12 @@ describe('Subscription Durations', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(publisher.getId(), BigNumber.from(0)), - serviceTypes: ['nft-sales'], + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + }, + ], providers: [config.neverminedNodeAddress], duration: 1000, nftContractAddress: subscriptionNFT.address, @@ -148,7 +160,11 @@ describe('Subscription Durations', () => { it('The publisher creates a dataset to associate to the subscription', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata: getMetadata(), - serviceTypes: ['nft-access'], + services: [ + { + serviceType: 'nft-access', + }, + ], providers: [config.neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint: false, @@ -218,8 +234,12 @@ describe('Subscription Durations', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(publisher.getId(), BigNumber.from(0)), - serviceTypes: ['nft-sales'], + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + }, + ], providers: [config.neverminedNodeAddress], duration: 1, nftContractAddress: subscriptionNFT.address, @@ -233,7 +253,11 @@ describe('Subscription Durations', () => { it('The publisher creates a dataset to associate to the subscription', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata: getMetadata(), - serviceTypes: ['nft-access'], + services: [ + { + serviceType: 'nft-access', + }, + ], providers: [config.neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint: false, diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index dd77cb1c9..d0b0cf750 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -132,8 +132,12 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: subscriptionMetadata, - price: assetPrice1, - serviceTypes: ['nft-sales'], + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + }, + ], providers: [neverminedNodeAddress], duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, @@ -160,7 +164,11 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { it('I want to register a new asset and tokenize (via NFT)', async () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: assetMetadata, - serviceTypes: ['nft-access'], + services: [ + { + serviceType: 'nft-access', + }, + ], providers: [neverminedNodeAddress], duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, @@ -304,8 +312,12 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(editor.getId(), BigNumber.from(0)), - serviceTypes: ['nft-sales'], + services: [ + { + serviceType: 'nft-sales', + price: new AssetPrice(editor.getId(), BigNumber.from(0)), + }, + ], providers: [neverminedNodeAddress], duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, diff --git a/integration/resources/ddo-algorithm.json b/integration/resources/ddo-algorithm.json index 954199fdf..b60630012 100644 --- a/integration/resources/ddo-algorithm.json +++ b/integration/resources/ddo-algorithm.json @@ -63,7 +63,7 @@ }, { "type": "authorization", - "index": 2, + "index": 1, "serviceEndpoint": "http://node.nevermined.localnet", "attributes": { "main": { @@ -75,7 +75,7 @@ }, { "type": "access", - "index": 3, + "index": 2, "serviceEndpoint": "http://node.nevermined.localnet/api/v1/node/services/access", "templateId": "0x37cB53b6e0224b03D2cD11b68ea5Df6141D95a1e", "attributes": { diff --git a/integration/resources/ddo-compute.json b/integration/resources/ddo-compute.json index 4d196823a..277e8052d 100644 --- a/integration/resources/ddo-compute.json +++ b/integration/resources/ddo-compute.json @@ -51,7 +51,7 @@ }, { "type": "authorization", - "index": 2, + "index": 1, "serviceEndpoint": "http://node.nevermined.localnet", "attributes": { "main": { @@ -63,17 +63,19 @@ }, { "type": "compute", - "index": 4, + "index": 2, "serviceEndpoint": "http://node.nevermined.localnet/api/v1/node/services/compute", "templateId": "0x9F204302bEB97Bd34148EC620F5cc44635f0b05c", "attributes": { "main": { "creator": "0xe2DD09d719Da89e5a3D0F2549c7E24566e947260", "datePublished": "2023-01-01T00:00:00Z", - "name": "EscrowComputeExecutionAgreement" + "name": "EscrowComputeExecutionAgreement", + "price": "1" }, "additionalInformation": { - "description": "Compute execution agreement" + "description": "Compute execution agreement", + "priceHighestDenomination": 1e-18 }, "serviceAgreementTemplate": { "contractName": "EscrowComputeExecutionTemplate", diff --git a/integration/resources/ddo-dataset.json b/integration/resources/ddo-dataset.json index 2d76815e9..80a039fe6 100644 --- a/integration/resources/ddo-dataset.json +++ b/integration/resources/ddo-dataset.json @@ -51,7 +51,7 @@ }, { "type": "authorization", - "index": 2, + "index": 1, "serviceEndpoint": "http://node.nevermined.localnet", "attributes": { "main": { @@ -63,7 +63,7 @@ }, { "type": "access", - "index": 3, + "index": 2, "serviceEndpoint": "http://node.nevermined.localnet/api/v1/node/services/access", "templateId": "0xb761bE571673A8f93DADe4D9D64618e3Eb989477", "attributes": { diff --git a/integration/resources/ddo-nft.json b/integration/resources/ddo-nft.json index 45257766c..4beb8f821 100644 --- a/integration/resources/ddo-nft.json +++ b/integration/resources/ddo-nft.json @@ -53,7 +53,7 @@ }, { "type": "authorization", - "index": 2, + "index": 1, "serviceEndpoint": "http://localhost:8030", "attributes": { "main": { @@ -65,7 +65,7 @@ }, { "type": "nft-sales", - "index": 6, + "index": 2, "serviceEndpoint": "http://localhost:8030/api/v1/node/services/nft-sales", "templateId": "0x91A362A6FC973647a6C7E54a5b8371228cD72661", "attributes": { @@ -268,7 +268,7 @@ }, { "type": "nft-access", - "index": 7, + "index": 3, "serviceEndpoint": "http://localhost:8030/api/v1/node/services/nft-access", "templateId": "0xF474fC9C472A6Df8D01bd06376c794B22C51ea93", "attributes": { diff --git a/integration/resources/ddo-workflow.json b/integration/resources/ddo-workflow.json index 8b4f146d3..ea2fd0423 100644 --- a/integration/resources/ddo-workflow.json +++ b/integration/resources/ddo-workflow.json @@ -72,7 +72,7 @@ }, { "type": "authorization", - "index": 2, + "index": 1, "serviceEndpoint": "http://node.nevermined.localnet", "attributes": { "main": { @@ -84,7 +84,7 @@ }, { "type": "access", - "index": 3, + "index": 2, "serviceEndpoint": "http://node.nevermined.localnet/api/v1/node/services/access", "templateId": "0x37cB53b6e0224b03D2cD11b68ea5Df6141D95a1e", "attributes": { diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 66fb9dc23..e721fbf2c 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -146,7 +146,7 @@ export class DDO { } /** - * Finds a service of a DDO by type. + * Finds the first service of a DDO by type. * @param serviceType - Service type. * * @throws {@link DDOServiceNotFoundError} If the service is not in the DDO. @@ -161,6 +161,16 @@ export class DDO { throw new DDOServiceNotFoundError(serviceType, this.id) } + /** + * Gets all the services of a DDO with a specific type. + * @param serviceType - Service type. + * + * @returns {@link Service}. + */ + public getServicesByType(serviceType: T): Service[] { + return this.service.filter((s) => s.type === serviceType).map((s) => s as Service) + } + /** * Checks if a service exists in the DDO. * @param serviceType - Service type. @@ -245,7 +255,16 @@ export class DDO { this.proof = await this.generateProof(publicKey) } + public reorderServices(): void { + this.service.sort((a, b) => (a.index > b.index ? 1 : -1)) + for (let i = 0; i < this.service.length; i++) { + this.service[i].index = i + } + this.service.sort((a, b) => (a.index > b.index ? 1 : -1)) + } + public async addService(service: any): Promise { + // console.log(`Adding service: ${service.type}} with price: ${JSON.stringify(service.attributes.serviceAgreementTemplate)}`) this.service.push(service) } @@ -284,8 +303,8 @@ export class DDO { return metadataService.attributes.main } - public async updateService(nevermined: Nevermined, service: any): Promise { - this.service[0] = service + public updateService(service: any, serviceIndex = 0) { + this.service[serviceIndex] = service } public async assignDid(didSeed: string, didRegistry: DIDRegistry, publisher: Account) { diff --git a/src/ddo/types.ts b/src/ddo/types.ts index 6fd84460a..48268c6d9 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -595,6 +595,12 @@ export interface Proof { checksum: any } +export interface ServiceAttributes { + serviceType: ServiceType + serviceIndex?: number + price?: AssetPrice +} + export interface ServiceAuthorization extends ServiceCommon { type: 'authorization' service: 'None' | 'RSAES-OAEP' diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index 00b7ada9c..f0013e1fa 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -248,7 +248,7 @@ export abstract class AgreementTemplate extends ContractBase { parameters: Params, consumer: Account, from: Account, - timeOuts?: number[], + _timeOuts?: number[], txParams?: TxParameters, observer?: (OrderProgressStep) => void, ): Promise { diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 889823a7d..236d6d0a7 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -69,7 +69,7 @@ export abstract class BaseTemplate priceData = await this.getPriced(assetPrice, erc20TokenAddress) } - return { + const service = { type: this.service(), index: serviceIndex[this.service()], serviceEndpoint: this.nevermined.services.node.getServiceEndpoint(this.serviceEndpoint()), @@ -88,6 +88,7 @@ export abstract class BaseTemplate serviceAgreementTemplate, }, } as S + return service } /** diff --git a/src/models/AssetAttributes.ts b/src/models/AssetAttributes.ts index a181266c6..728ebf0af 100644 --- a/src/models/AssetAttributes.ts +++ b/src/models/AssetAttributes.ts @@ -1,4 +1,4 @@ -import { Service, ServiceType, MetaData } from '../ddo' +import { Service, MetaData, ServiceAttributes, ServiceType } from '../ddo' import { EncryptionMethod } from '../services' import { ZeroAddress } from '../utils' import { AssetPrice } from './AssetPrice' @@ -12,11 +12,11 @@ export class AssetAttributes { */ metadata: MetaData - /** - * It allows to specify the price of an asset - * @see {@link AssetPrice} - */ - price?: AssetPrice + // /** + // * It allows to specify the price of an asset + // * @see {@link AssetPrice} + // */ + // price?: AssetPrice /** * When an asset is published in a Nevermined network, some internal Metadata attributes are encrypted so they can't be accessed. @@ -25,11 +25,17 @@ export class AssetAttributes { */ encryptionMethod?: EncryptionMethod + // /** + // * List of services offered by an asset. + // * @see {@link ServiceType} + // */ + // serviceTypes?: ServiceType[] + /** - * List of services offered by an asset. - * @see {@link ServiceType} + * List of services and their attributes offered by an asset. + * @see {@link ServiceAttributes} */ - serviceTypes?: ServiceType[] + services?: ServiceAttributes[] /** * List of additional asset services to be included as part of an asset @@ -73,9 +79,15 @@ export class AssetAttributes { fulfillAccessTimelock?: number static defaultValues = { - price: new AssetPrice().setTokenAddress(process.env.TOKEN_ADDRESS || ZeroAddress), // It means there is no payment required + // price: new AssetPrice().setTokenAddress(process.env.TOKEN_ADDRESS || ZeroAddress), // It means there is no payment required encryptionMethod: AssetAttributes.DEFAULT_ENCRYPTION_METHOD, // The default encryption method for the internal metadata attributes is PSK-RSA - serviceTypes: ['access'] as ServiceType[], // By default it will be added an access service + services: [ + { + serviceType: 'access' as ServiceType, + price: new AssetPrice().setTokenAddress(process.env.TOKEN_ADDRESS || ZeroAddress), // It means there is no payment required + }, + ], // By default it will be added an access service + // serviceTypes: ['access'] as ServiceType[], // By default it will be added an access service predefinedAssetServices: [] as Service[], // By default there in additional services to add to the asset providers: [], // By default there are no addresses registered as providers for the asset appId: '', // No appId by default diff --git a/src/models/AssetPrice.ts b/src/models/AssetPrice.ts index e93cd8c9e..70f1afe00 100644 --- a/src/models/AssetPrice.ts +++ b/src/models/AssetPrice.ts @@ -68,12 +68,6 @@ export class AssetPrice { return this.tokenAddress } - public getAmountsString(): string { - return this.rewards.size - ? JSON.stringify(Array.from(this.rewards.values()).map((value) => value.toString())) - : '[]' - } - /** * It adds network fees on top of the already configured asset rewards * @param feeReceiver - the address receiving the fees @@ -113,8 +107,18 @@ export class AssetPrice { return this } + public getAmountsString(): string { + return this.rewards.size + ? JSON.stringify(Array.from(this.rewards.values()).map((value) => value.toString())) + : '[]' + } + public getReceiversString(): string { if (this.rewards.size == 0) return '[]' return '["' + Array.from(this.rewards.keys()).join('","') + '"]' } + + public toString(): string { + return this.getAmountsString() + this.getReceiversString() + } } diff --git a/src/nevermined/api/ComputeApi.ts b/src/nevermined/api/ComputeApi.ts index ef15e4dbc..ee6ebf452 100644 --- a/src/nevermined/api/ComputeApi.ts +++ b/src/nevermined/api/ComputeApi.ts @@ -46,8 +46,12 @@ export class ComputeApi extends RegistryBaseApi { publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, txParams?: TxParameters, ): SubscribablePromise { - if (!assetAttributes.serviceTypes.includes('compute')) - assetAttributes.serviceTypes = [...assetAttributes.serviceTypes, 'compute'] + const computeService = assetAttributes.services.find((service) => { + service.serviceType = 'compute' + }) + if (!computeService) { + assetAttributes.services = [...assetAttributes.services, { serviceType: 'compute' }] + } return this.registerNeverminedAsset( assetAttributes, publisherAccount, diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index cb928f877..3c4e94384 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -59,8 +59,8 @@ export abstract class RegistryBaseApi extends Instantiable { return new SubscribablePromise(async (observer) => { const { neverminedNodeUri } = this.config const { didRegistry } = this.nevermined.keeper - const tokenAddress = - assetAttributes.price.getTokenAddress() || this.nevermined.utils.token.getAddress() + // const tokenAddress = + // assetAttributes.price.getTokenAddress() || this.nevermined.utils.token.getAddress() // create ddo itself const ddo = DDO.getInstance( @@ -95,25 +95,27 @@ export abstract class RegistryBaseApi extends Instantiable { nftAttributes, ) - for (const name of assetAttributes.serviceTypes) { - const plugin = this.servicePlugin[name] + for (const serviceAttributes of assetAttributes.services) { + const plugin = this.servicePlugin[serviceAttributes.serviceType] if (plugin) { await ddo.addService( await plugin.createService( publisher, assetAttributes.metadata, - assetAttributes.price, - tokenAddress, + serviceAttributes.price, + serviceAttributes.price?.getTokenAddress() || + this.nevermined.utils.token.getAddress(), + serviceAttributes.price ? true : false, ), ) } } + ddo.reorderServices() + this.logger.log('Services Added') observer.next(CreateProgressStep.ServicesAdded) - ddo.service.sort((a, b) => (a.index > b.index ? 1 : -1)) - this.logger.log('Generating proof') observer.next(CreateProgressStep.GeneratingProof) @@ -129,8 +131,11 @@ export abstract class RegistryBaseApi extends Instantiable { this.logger.log('Proof generated') observer.next(CreateProgressStep.ProofGenerated) - for (const name of assetAttributes.serviceTypes) { - const service = ddo.findServiceByType(name) + for (const serviceAttributes of assetAttributes.services) { + let service + if (serviceAttributes.serviceIndex) + service = ddo.findServiceById(serviceAttributes.serviceIndex) + else service = ddo.findServiceByType(serviceAttributes.serviceType) const { nftContractAddress, amount, @@ -142,10 +147,10 @@ export abstract class RegistryBaseApi extends Instantiable { const sat: ServiceAgreementTemplate = service.attributes.serviceAgreementTemplate sat.conditions = ddo.fillConditionsWithDDO( - name, + serviceAttributes.serviceType, sat.conditions, - assetAttributes.price, - tokenAddress, + serviceAttributes.price, + serviceAttributes.price?.getTokenAddress() || this.nevermined.utils.token.getAddress(), nftContractAddress, publisher.getId(), amount, @@ -185,7 +190,7 @@ export abstract class RegistryBaseApi extends Instantiable { let serviceEndpoint = this.nevermined.services.metadata.getServiceEndpoint(DID.parse(ddo.id)) - await ddo.updateService(this.nevermined, { + ddo.updateService({ type: 'metadata', index: 0, serviceEndpoint, diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index 27a33860f..dbd73532e 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -495,7 +495,7 @@ export class NFT1155Api extends NFTsBaseApi { const did = DDO.getDIDFromService(service) const nftAmount = DDO.getNftAmountFromService(service) const ddo = await this.nevermined.assets.resolve(did) - ddo.updateService(this.nevermined, service) + ddo.updateService(service) const agreementId = await this.nevermined.keeper.agreementStoreManager.agreementId( agreementIdSeed, consumer.getId(), diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index cd95889e9..121a4bd87 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -513,7 +513,7 @@ export class NFT721Api extends NFTsBaseApi { const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) const did = DDO.getDIDFromService(service) const ddo = await this.nevermined.assets.resolve(did) - ddo.updateService(this.nevermined, service) + ddo.updateService(service) const agreementId = await this.nevermined.keeper.agreementStoreManager.agreementId( agreementIdSeed, account.getId(), diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index b6631a110..4a19636d7 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -318,7 +318,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { const currentNftHolder = new Account(DDO.getNftHolderFromService(service)) const did = DDO.getDIDFromService(service) const ddo = await this.nevermined.assets.resolve(did) - ddo.updateService(this.nevermined, service) + ddo.updateService(service) const agreementId = await nftSalesTemplate.createAgreementFromDDO( agreementIdSeed, From 4ed4b51fad163e189e52b97b965e6ab878017b01 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Tue, 11 Jul 2023 18:22:17 +0200 Subject: [PATCH 006/151] feat: replace BigNumber class with ES2020 BigInt --- package.json | 6 +- src/Instantiable.abstract.ts | 2 +- src/ddo/DDO.ts | 9 +-- src/ddo/types.ts | 3 +- src/events/ContractEvent.ts | 14 +--- src/keeper/ContractHandler.ts | 14 ++-- src/keeper/contracts/ContractBase.ts | 15 ++-- src/keeper/contracts/DIDRegistry.ts | 11 +-- src/keeper/contracts/Dispenser.ts | 12 +-- src/keeper/contracts/NFTContractsBase.ts | 16 ++-- src/keeper/contracts/Nft1155Contract.ts | 9 +-- src/keeper/contracts/Nft721Contract.ts | 17 ++-- src/keeper/contracts/Token.ts | 14 ++-- .../conditions/EscrowPaymentCondition.ts | 5 +- .../conditions/LockPaymentCondition.ts | 5 +- .../conditions/NFTs/NFTHolderCondition.ts | 16 ++-- .../conditions/NFTs/NFTLockCondition.ts | 3 +- .../conditions/NFTs/TransferNFTCondition.ts | 9 +-- .../contracts/defi/AaveCreditTemplate.ts | 7 +- .../contracts/governance/NeverminedConfig.ts | 3 +- .../contracts/royalties/RewardsDistributor.ts | 3 +- .../templates/AgreementTemplate.abstract.ts | 5 +- .../templates/BaseTemplate.abstract.ts | 5 +- .../contracts/templates/NFTAccessTemplate.ts | 5 +- .../contracts/templates/NFTSalesTemplate.ts | 5 +- src/models/AssetPrice.ts | 51 +++++------- src/models/NFTAttributes.ts | 9 +-- src/models/types.ts | 7 +- src/nevermined/Account.ts | 15 ++-- src/nevermined/Token.ts | 5 +- src/nevermined/api/ConditionsApi.ts | 13 ++- src/nevermined/api/nfts/NFT1155Api.ts | 21 +++-- src/nevermined/api/nfts/NFT721Api.ts | 5 +- src/nevermined/api/nfts/NFTsBaseApi.ts | 14 ++-- src/sdk.ts | 3 +- src/services/aave/AaveCredit.ts | 23 +++--- src/services/node/NeverminedNode.ts | 3 +- src/utils/BigNumber.ts | 80 ------------------- src/utils/DDOHelpers.ts | 15 ++-- src/utils/UnitConversion.ts | 77 ++++++++++++++++++ src/utils/index.ts | 2 +- tsconfig.json | 2 +- 42 files changed, 245 insertions(+), 313 deletions(-) delete mode 100644 src/utils/BigNumber.ts create mode 100644 src/utils/UnitConversion.ts diff --git a/package.json b/package.json index 14690cd90..d774d58dd 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "codegen-graph-ts": "npm:@nevermined-io/codegen-graph-ts@0.1.4", "crypto-browserify": "^3.12.0", "deprecated-decorator": "^0.1.6", - "ethers": "^5.6.9", + "ethers": "^6.6.2", "https-browserify": "^1.0.0", "jose": "^4.5.1", "js-file-download": "^0.4.12", @@ -111,10 +111,10 @@ "eslint-plugin-tsdoc": "^0.2.16", "express": "^4.18.2", "ganache": "^7.0.2", - "husky": "^8.0.3", "http-proxy": "^1.18.1", - "lint-staged": "^13.0.4", + "husky": "^8.0.3", "lcov-result-merger": "^3.1.0", + "lint-staged": "^13.0.4", "mocha": "^7.2.0", "mock-local-storage": "^1.1.15", "nyc": "^14.1.1", diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index 28094e8f4..184cdd281 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -7,7 +7,7 @@ import { ethers } from 'ethers' export interface InstantiableConfig { nevermined: Nevermined config?: NeverminedOptions - web3?: ethers.providers.JsonRpcProvider + web3?: ethers.JsonRpcProvider logger?: Logger artifactsFolder?: string circuitsFolder?: string diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 33fda8971..1063685df 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -13,7 +13,6 @@ import { didPrefixed, getAssetPriceFromService, zeroX } from '../utils' import { DIDRegistry } from '../keeper' import { ethers } from 'ethers' import { NFTAttributes } from '../models' -import { BigNumber } from '../utils' import { DDOPriceNotFoundError, DDOServiceNotFoundError } from '../errors' /** @@ -160,9 +159,9 @@ export class DDO { * @param serviceType - Service type * * @throws {@link DDOPriceNotFoundError} - * @returns {@link BigNumber} + * @returns {@link bigint} */ - public getPriceByService(serviceType: ServiceType = 'access'): BigNumber { + public getPriceByService(serviceType: ServiceType = 'access'): bigint { const service = this.findServiceByType(serviceType) const assetPrice = getAssetPriceFromService(service) @@ -173,9 +172,7 @@ export class DDO { } public checksum(seed: string): string { - return ethers.utils - .keccak256(ethers.utils.toUtf8Bytes(seed)) - .replace(/^0x([a-f0-9]{64})(:!.+)?$/i, '0x$1') + return ethers.keccak256(ethers.toUtf8Bytes(seed)).replace(/^0x([a-f0-9]{64})(:!.+)?$/i, '0x$1') } /** diff --git a/src/ddo/types.ts b/src/ddo/types.ts index 6fd84460a..3766d581c 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -1,6 +1,5 @@ import { AaveConditionType, ServiceAaveCredit, TxParameters } from '../keeper' import { Account } from '../sdk' -import { BigNumber } from 'ethers' import { ERCType, NeverminedNFTType, AssetPrice, Babysig } from '../models' export interface Authentication { @@ -712,7 +711,7 @@ export interface ValidationParams { consumer_address?: string buyer?: string babysig?: Babysig - nft_amount?: BigNumber + nft_amount?: bigint nft_holder?: string expiration?: number } diff --git a/src/events/ContractEvent.ts b/src/events/ContractEvent.ts index aff05709d..796fe04a8 100644 --- a/src/events/ContractEvent.ts +++ b/src/events/ContractEvent.ts @@ -1,4 +1,4 @@ -import { EventEmitter, EventOptions, EventResult, Filter, NeverminedEvent } from './NeverminedEvent' +import { EventEmitter, EventOptions, EventResult, NeverminedEvent } from './NeverminedEvent' import { ContractBase } from '../keeper' import { KeeperError } from '../errors' import { Nevermined } from '../nevermined' @@ -9,7 +9,7 @@ export class ContractEvent extends NeverminedEvent { contract: ContractBase, eventEmitter: EventEmitter, nevermined: Nevermined, - web3: ethers.providers.JsonRpcProvider, + web3: ethers.JsonRpcProvider, ): ContractEvent { const instance = new ContractEvent(contract, eventEmitter) instance.setInstanceConfig({ @@ -26,10 +26,7 @@ export class ContractEvent extends NeverminedEvent { `Event "${options.eventName}" not found on contract "${this.contract.contractName}"`, ) } - const args = this.filterToArgs(options.eventName, options.filterJsonRpc) - const eventFilter: ethers.EventFilter = this.contract.contract.filters[options.eventName]( - ...args, - ) + const eventFilter: ethers.ContractEventName = options.eventName return this.contract.contract.queryFilter(eventFilter, options.fromBlock, options.toBlock) } @@ -59,9 +56,4 @@ export class ContractEvent extends NeverminedEvent { private eventExists(eventName: string): boolean { return !!this.contract.contract.interface.getEvent(eventName) } - - private filterToArgs(eventName: string, filter: Filter): Array { - const event = this.contract.contract.interface.getEvent(eventName) - return event.inputs.filter((i) => i.indexed).map((i) => filter[i.name]) - } } diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index fd384b0c2..3b64367b9 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -3,7 +3,7 @@ import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { KeeperError } from '../errors/KeeperError' import { ApiError } from '../errors/ApiError' import { Account } from '../nevermined' -import { BigNumber, ContractReceipt, ethers } from 'ethers' +import { ContractReceipt, ethers } from 'ethers' import { TransactionResponse } from '@ethersproject/abstract-provider' let fetch @@ -124,7 +124,7 @@ export class ContractHandler extends Instantiable { const feeData = await this.getFeeData() const extraParams = { ...feeData, - gasLimit: BigNumber.from('10000000'), + gasLimit: 10000000n, } contractInstance = await contract.deploy(...argument, extraParams) @@ -250,11 +250,7 @@ export class ContractHandler extends Instantiable { } } - public async getFeeData( - gasPrice?: BigNumber, - maxFeePerGas?: BigNumber, - maxPriorityFeePerGas?: BigNumber, - ) { + public async getFeeData(gasPrice?: bigint, maxFeePerGas?: bigint, maxPriorityFeePerGas?: bigint) { // Custom gas fee for polygon networks const networkId = await this.nevermined.keeper.getNetworkId() if (networkId === 137 || networkId === 80001) { @@ -295,8 +291,8 @@ export class ContractHandler extends Instantiable { } // get max fees from gas station - let maxFeePerGas = ethers.BigNumber.from(40000000000) // fallback to 40 gwei - let maxPriorityFeePerGas = ethers.BigNumber.from(40000000000) // fallback to 40 gwei + let maxFeePerGas = 40000000000n // fallback to 40 gwei + let maxPriorityFeePerGas = 40000000000n // fallback to 40 gwei try { const response = await this.nevermined.utils.fetch.get(gasStationUri) const data = await response.json() diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 5414877e7..b43f0ca2f 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -4,11 +4,10 @@ import { ContractEvent, EventHandler, SubgraphEvent } from '../../events' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { KeeperError } from '../../errors' import { ContractReceipt, ethers } from 'ethers' -import { BigNumber } from '../../utils' - +import { parseUnits } from '../../sdk' export interface TxParameters { value?: string - gasLimit?: BigNumber + gasLimit?: bigint gasMultiplier?: number gasPrice?: string maxPriorityFeePerGas?: string @@ -212,9 +211,9 @@ export abstract class ContractBase extends Instantiable { // get correct fee data const feeData = await this.nevermined.utils.contractHandler.getFeeData( - gasPrice && BigNumber.from(gasPrice), - maxFeePerGas && BigNumber.from(maxFeePerGas), - maxPriorityFeePerGas && BigNumber.from(maxPriorityFeePerGas), + gasPrice && BigInt(gasPrice), + maxFeePerGas && BigInt(maxFeePerGas), + maxPriorityFeePerGas && BigInt(maxPriorityFeePerGas), ) const txparams = { @@ -280,7 +279,7 @@ export abstract class ContractBase extends Instantiable { from: string, value: string, gasMultiplier?: number, - ): Promise { + ): Promise { let gasLimit = await contract.estimateGas[methodSignature](...args, { from, value, @@ -289,7 +288,7 @@ export abstract class ContractBase extends Instantiable { gasMultiplier = gasMultiplier || this.config.gasMultiplier if (gasMultiplier) { - const gasMultiplierParsed = BigNumber.parseUnits(gasMultiplier.toString(), 2) + const gasMultiplierParsed = parseUnits(gasMultiplier.toString(), 2) gasLimit = gasLimit.mul(gasMultiplierParsed).div(100) } diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index 4e1eac69d..b081bfd22 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -2,7 +2,6 @@ import ContractBase, { TxParameters as txParams } from './ContractBase' import { zeroX, didPrefixed, didZeroX, eventToObject, ZeroAddress } from '../../utils' import { InstantiableConfig } from '../../Instantiable.abstract' import { ContractReceipt, ethers } from 'ethers' -import { BigNumber } from '../../utils' import { NFTAttributes } from '../../models' import { AssetError } from '../../errors/AssetError' import { @@ -303,7 +302,7 @@ export class DIDRegistry extends ContractBase { checksum: string owner: string providers: string[] - royalties: BigNumber + royalties: bigint immutableUrl: string nftInitialized: boolean }> { @@ -317,9 +316,7 @@ export class DIDRegistry extends ContractBase { checksum: registeredValues[1], owner: registeredValues[0], providers: registeredValues[5], - // nftSupply: BigNumber.from(registeredValues[6]), - // mintCap: BigNumber.from(registeredValues[7]), - royalties: BigNumber.from(registeredValues[6]), + royalties: BigInt(registeredValues[6]), immutableUrl: registeredValues[7], nftInitialized: registeredValues[8], } @@ -605,11 +602,11 @@ export class DIDRegistry extends ContractBase { return this.call('getProvenanceOwner', [didZeroX(did)]) } - public async mint(did: string, amount: BigNumber, from: string, params?: txParams) { + public async mint(did: string, amount: bigint, from: string, params?: txParams) { return this.send('mint', from, [didZeroX(did), String(amount)], params) } - public async burn(did: string, amount: BigNumber, from: string, params?: txParams) { + public async burn(did: string, amount: bigint, from: string, params?: txParams) { return this.send('burn', from, [didZeroX(did), String(amount)], params) } diff --git a/src/keeper/contracts/Dispenser.ts b/src/keeper/contracts/Dispenser.ts index 69deba0b0..421f84ebe 100644 --- a/src/keeper/contracts/Dispenser.ts +++ b/src/keeper/contracts/Dispenser.ts @@ -1,7 +1,6 @@ import ContractBase, { TxParameters } from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' -import { BigNumber } from '../../utils' - +import { parseUnits } from '../../sdk' export class Dispenser extends ContractBase { public static async getInstance(config: InstantiableConfig): Promise { const dispenser: Dispenser = new Dispenser('Dispenser') @@ -10,15 +9,10 @@ export class Dispenser extends ContractBase { } public async requestTokens( - amount: number | string | BigNumber, + amount: number | string | bigint, receiverAddress: string, txParams?: TxParameters, ) { - return this.send( - 'requestTokens', - receiverAddress, - [BigNumber.parseUnits(amount.toString(), 0)], - txParams, - ) + return this.send('requestTokens', receiverAddress, [parseUnits(amount.toString(), 0)], txParams) } } diff --git a/src/keeper/contracts/NFTContractsBase.ts b/src/keeper/contracts/NFTContractsBase.ts index d9bb423f3..8d7209354 100644 --- a/src/keeper/contracts/NFTContractsBase.ts +++ b/src/keeper/contracts/NFTContractsBase.ts @@ -1,7 +1,7 @@ import ContractBase, { TxParameters } from './ContractBase' import { didZeroX, zeroX } from '../../utils' import { Account } from '../../nevermined' -import { BigNumber, ContractReceipt } from 'ethers' +import { ContractReceipt } from 'ethers' import { KeeperError } from '../../errors' export class NFTContractsBase extends ContractBase { @@ -29,7 +29,7 @@ export class NFTContractsBase extends ContractBase { name: string, symbol: string, uri: string, - cap: BigNumber | undefined, + cap: bigint | undefined, operators: string[] = [], from?: Account, txParams?: TxParameters, @@ -70,8 +70,8 @@ export class NFTContractsBase extends ContractBase { public async getNFTAttributes(did: string): Promise<{ nftInitialized: boolean - nftSupply: BigNumber - mintCap: BigNumber + nftSupply: bigint + mintCap: bigint nftURI: string }> { const registeredValues = await this.call('getNFTAttributes', [didZeroX(did)]) @@ -80,16 +80,16 @@ export class NFTContractsBase extends ContractBase { // It could be also a ERC-721 NFT return { nftInitialized: false, - nftSupply: BigNumber.from(0), - mintCap: BigNumber.from(0), + nftSupply: 0n, + mintCap: 0n, nftURI: '', } } return { nftInitialized: registeredValues[0], - nftSupply: BigNumber.from(registeredValues[1]), - mintCap: BigNumber.from(registeredValues[2]), + nftSupply: BigInt(registeredValues[1]), + mintCap: BigInt(registeredValues[2]), nftURI: registeredValues[3], } } diff --git a/src/keeper/contracts/Nft1155Contract.ts b/src/keeper/contracts/Nft1155Contract.ts index 46f82bc5c..7660a5019 100644 --- a/src/keeper/contracts/Nft1155Contract.ts +++ b/src/keeper/contracts/Nft1155Contract.ts @@ -2,7 +2,6 @@ import { InstantiableConfig } from '../../Instantiable.abstract' import { didZeroX, zeroX } from '../../utils' import { Account } from '../../nevermined' import { TxParameters } from './ContractBase' -import { BigNumber } from '../../utils' import { ethers } from 'ethers' import { NFTContractsBase } from './NFTContractsBase' import { ContractHandler } from '../ContractHandler' @@ -88,7 +87,7 @@ export class Nft1155Contract extends NFTContractsBase { * @param did - The NFT id * @returns */ - public async balance(address: string, did: string): Promise { + public async balance(address: string, did: string): Promise { return this.call('balanceOf', [zeroX(address), didZeroX(did)]) } @@ -105,7 +104,7 @@ export class Nft1155Contract extends NFTContractsBase { public async transferNft( did: string, to: string, - amount: BigNumber, + amount: bigint, from: string, txParams?: TxParameters, ) { @@ -126,7 +125,7 @@ export class Nft1155Contract extends NFTContractsBase { public async mint( to: string, did: string, - amount: BigNumber, + amount: bigint, from: string, data?: string, txParams?: TxParameters, @@ -143,7 +142,7 @@ export class Nft1155Contract extends NFTContractsBase { * @param txParams - Transaction additional parameters * @returns Contract Receipt */ - public async burn(from: string, did: string, amount: BigNumber, txParams?: TxParameters) { + public async burn(from: string, did: string, amount: bigint, txParams?: TxParameters) { return this.send('burn', from, [from, didZeroX(did), amount], txParams) } diff --git a/src/keeper/contracts/Nft721Contract.ts b/src/keeper/contracts/Nft721Contract.ts index d27dd942f..2804c036e 100644 --- a/src/keeper/contracts/Nft721Contract.ts +++ b/src/keeper/contracts/Nft721Contract.ts @@ -3,7 +3,6 @@ import { InstantiableConfig } from '../../Instantiable.abstract' import { didZeroX, zeroX } from '../../utils' import { Account } from '../../nevermined' import { ethers } from 'ethers' -import { BigNumber } from '../../utils' import { ContractEvent, EventHandler } from '../../events' import { NFTContractsBase } from './NFTContractsBase' import { ContractHandler } from '../ContractHandler' @@ -65,7 +64,7 @@ export class Nft721Contract extends NFTContractsBase { name: string, symbol: string, uri: string, - cap: BigNumber, + cap: bigint, operators: string[] = [], from?: Account, txParams?: TxParameters, @@ -112,7 +111,7 @@ export class Nft721Contract extends NFTContractsBase { return this.call('isApprovedForAll', [didZeroX(accountAddress), didZeroX(operatorAddress)]) } - public async balanceOf(owner: string): Promise { + public async balanceOf(owner: string): Promise { return this.call('balanceOf', [owner]) } @@ -130,9 +129,9 @@ export class Nft721Contract extends NFTContractsBase { const entries: MintedEntry[] = [] for (let i = 0; i < minted.length; i++) { entries.push({ - tokenId: BigNumber.from(minted[i][0]), - expirationBlock: BigNumber.from(minted[i][1]), - mintBlock: BigNumber.from(minted[i][2]), + tokenId: BigInt(minted[i][0]), + expirationBlock: BigInt(minted[i][1]), + mintBlock: BigInt(minted[i][2]), }) } return entries @@ -140,7 +139,7 @@ export class Nft721Contract extends NFTContractsBase { } export interface MintedEntry { - tokenId: BigNumber - expirationBlock: BigNumber - mintBlock: BigNumber + tokenId: bigint + expirationBlock: bigint + mintBlock: bigint } diff --git a/src/keeper/contracts/Token.ts b/src/keeper/contracts/Token.ts index 6027690af..484139ff6 100644 --- a/src/keeper/contracts/Token.ts +++ b/src/keeper/contracts/Token.ts @@ -1,7 +1,7 @@ import ContractBase, { TxParameters } from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' import { Account } from '../../nevermined' -import { BigNumber } from '../../utils' +import { formatEther } from '../../sdk' export class Token extends ContractBase { static ERC20_ABI = [ @@ -24,7 +24,7 @@ export class Token extends ContractBase { return token } - public async approve(to: string, price: BigNumber, from?: Account, txParams?: TxParameters) { + public async approve(to: string, price: bigint, from?: Account, txParams?: TxParameters) { return this.sendFrom('approve', [to, price.toString()], from, txParams) } @@ -32,15 +32,15 @@ export class Token extends ContractBase { return this.call('decimals', []) } - public async balanceOfConverted(address: string): Promise { - return BigNumber.from(BigNumber.formatEther(await this.call('balanceOf', [address]))) + public async balanceOfConverted(address: string): Promise { + return BigInt(formatEther(await this.call('balanceOf', [address]))) } public async strBalanceOf(address: string): Promise { return this.call('balanceOf', [address]) } - public async balanceOf(address: string): Promise { + public async balanceOf(address: string): Promise { return this.call('balanceOf', [address]) } @@ -52,11 +52,11 @@ export class Token extends ContractBase { return this.call('name', []) } - public async totalSupply(): Promise { + public async totalSupply(): Promise { return this.call('totalSupply', []) } - public async transfer(to: string, amount: BigNumber, from: string, txParams?: TxParameters) { + public async transfer(to: string, amount: bigint, from: string, txParams?: TxParameters) { return this.send('transfer', from, [to, amount.toString()], txParams) } } diff --git a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts index 6ea9e1470..64c4f6517 100644 --- a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts +++ b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts @@ -8,7 +8,6 @@ import { didZeroX, findServiceConditionByName, zeroX } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' import { Account } from '../../../nevermined' import { TxParameters } from '../ContractBase' -import { BigNumber } from '../../../utils' export interface EscrowPaymentConditionContext extends ConditionContext { consumerId: string @@ -21,7 +20,7 @@ export class EscrowPaymentCondition extends ProviderCondition { public static async getInstance(config: InstantiableConfig): Promise { @@ -14,7 +13,7 @@ export class LockPaymentCondition extends ConsumerCondition { did: string, rewardAddress: string, tokenAddress: string, - amounts: BigNumber[], + amounts: bigint[], receivers: string[], ) { const amountsString = amounts.map((v) => v.toString()) @@ -44,7 +43,7 @@ export class LockPaymentCondition extends ConsumerCondition { did: string, rewardAddress: string, tokenAddress: string, - amounts: BigNumber[], + amounts: bigint[], receivers: string[], from?: Account, txParams?: TxParameters, diff --git a/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts b/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts index b0dd82087..b06e61d3a 100644 --- a/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts +++ b/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts @@ -3,12 +3,11 @@ import { didZeroX, findServiceConditionByName, zeroX } from '../../../../utils' import { Condition, ConditionContext, ConsumerCondition } from '../Condition.abstract' import { Account } from '../../../../nevermined' import { TxParameters } from '../../ContractBase' -import { BigNumber } from '../../../../utils' import { ServiceCommon } from '../../../../ddo' export interface NFTHolderConditionContext extends ConditionContext { holderAddress: string - amount?: BigNumber + amount?: bigint } /** @@ -28,12 +27,7 @@ export class NFTHolderCondition extends ConsumerCondition p.name === '_numberNfts').value) + return BigInt(holder.parameters.find((p) => p.name === '_numberNfts').value as string) } public nftContractFromService(service: ServiceCommon): string { @@ -81,7 +75,7 @@ export class NFTHolderCondition extends ConsumerCondition agreementId: string, did: string, rewardAddress: string, - amount: BigNumber, + amount: bigint, from?: Account, txParams?: TxParameters, ) { diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts index c81120e22..3508960dc 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts @@ -9,13 +9,12 @@ import { } from '../Condition.abstract' import { Account } from '../../../../nevermined' import { TxParameters } from '../../ContractBase' -import { BigNumber } from '../../../../utils' import { ServiceCommon } from '../../../..' export interface TransferNFTConditionContext extends ConditionContext { providerId: string consumerId: string - nftAmount: BigNumber + nftAmount: bigint } /** @@ -42,7 +41,7 @@ export class TransferNFTCondition extends ProviderCondition]> { - const _collateralAmount = BigNumber.parseEther(collateralAmount.toString()) + const _collateralAmount = parseEther(collateralAmount.toString()) - const _delegatedAmount = BigNumber.parseEther(delegatedAmount.toString()) + const _delegatedAmount = parseEther(delegatedAmount.toString()) const data = await this.instanceFromDDO( agreementIdSeed, diff --git a/src/keeper/contracts/governance/NeverminedConfig.ts b/src/keeper/contracts/governance/NeverminedConfig.ts index 6ac0de99d..37206d6e9 100644 --- a/src/keeper/contracts/governance/NeverminedConfig.ts +++ b/src/keeper/contracts/governance/NeverminedConfig.ts @@ -1,7 +1,6 @@ import ContractBase, { TxParameters } from '../ContractBase' import { InstantiableConfig } from '../../../Instantiable.abstract' import { Account } from '../../../nevermined' -import { BigNumber } from '../../../utils' export default class NeverminedConfig extends ContractBase { templates: any @@ -16,7 +15,7 @@ export default class NeverminedConfig extends ContractBase { return this.call('owner', []) } - public async getNetworkFee(): Promise { + public async getNetworkFee(): Promise { return this.call('getMarketplaceFee', []) } diff --git a/src/keeper/contracts/royalties/RewardsDistributor.ts b/src/keeper/contracts/royalties/RewardsDistributor.ts index 323d560b3..a1ee6aea0 100644 --- a/src/keeper/contracts/royalties/RewardsDistributor.ts +++ b/src/keeper/contracts/royalties/RewardsDistributor.ts @@ -2,7 +2,6 @@ import ContractBase, { TxParameters as txParams } from '../ContractBase' import { InstantiableConfig } from '../../../Instantiable.abstract' import { Account } from '../../../nevermined' import { didZeroX, zeroX } from '../../../utils' -import { BigNumber } from '../../../utils' export class RewardsDistributor extends ContractBase { public static async getInstance(config: InstantiableConfig): Promise { @@ -20,7 +19,7 @@ export class RewardsDistributor extends ContractBase { public claimReward( agreementId: string, did: string, - amounts: BigNumber[], + amounts: bigint[], receivers: string[], returnAddress: string, lockPaymentAddress: string, diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index c6c3430a8..26e0a897b 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -19,7 +19,6 @@ import { AssetPrice, BabyjubPublicKey } from '../../../models' import { Account, OrderProgressStep } from '../../../nevermined' import { CustomToken } from '../CustomToken' import { Token } from '../Token' -import { BigNumber } from '../../../utils' export interface AgreementConditionsStatus { [condition: string]: { @@ -50,7 +49,7 @@ export interface AgreementInstance { export interface PaymentData { rewardAddress: string tokenAddress: string - amounts: BigNumber[] + amounts: bigint[] receivers: string[] } @@ -129,7 +128,7 @@ export abstract class AgreementTemplate extends ContractBase { condIdx: number, rewardAddress: string, tokenAddress: string, - amounts: BigNumber[], + amounts: bigint[], receivers: string[], from?: Account, txParams?: TxParameters, diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 889823a7d..c9b1f3e16 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -1,5 +1,5 @@ import { AgreementTemplate } from './AgreementTemplate.abstract' -import { ZeroAddress, zeroX } from '../../../utils' +import { ZeroAddress, formatUnits, zeroX } from '../../../utils' import { Priced, Service, @@ -11,7 +11,6 @@ import { import { Account, Condition, MetaData, AssetPrice } from '../../../sdk' import { TxParameters } from '../ContractBase' import { ConditionInstance, ConditionState } from '../conditions' -import { BigNumber } from '../../../utils' export abstract class BaseTemplate extends AgreementTemplate @@ -42,7 +41,7 @@ export abstract class BaseTemplate } const price = assetPrice.getTotalPrice().toString() - const priceHighestDenomination = +BigNumber.formatUnits(assetPrice.getTotalPrice(), decimals) + const priceHighestDenomination = +formatUnits(assetPrice.getTotalPrice(), decimals) return { attributes: { main: { diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index 7c0e9ed7c..705456fcb 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -10,11 +10,10 @@ import { AgreementInstance, AgreementTemplate } from './AgreementTemplate.abstra import { BaseTemplate } from './BaseTemplate.abstract' import { nftAccessTemplateServiceAgreementTemplate } from './NFTAccessTemplate.serviceAgreementTemplate' import { NFTAccessCondition, NFTHolderCondition } from '../conditions' -import { BigNumber } from '../../../utils' export interface NFTAccessTemplateParams { holderAddress: string - amount: BigNumber + amount: bigint grantee: string } @@ -33,7 +32,7 @@ export class NFTAccessTemplate extends BaseTemplate { diff --git a/src/keeper/contracts/templates/NFTSalesTemplate.ts b/src/keeper/contracts/templates/NFTSalesTemplate.ts index a8df0b16e..535119ab6 100644 --- a/src/keeper/contracts/templates/NFTSalesTemplate.ts +++ b/src/keeper/contracts/templates/NFTSalesTemplate.ts @@ -10,12 +10,11 @@ import { AgreementInstance, AgreementTemplate } from './AgreementTemplate.abstra import { BaseTemplate } from './BaseTemplate.abstract' import { nftSalesTemplateServiceAgreementTemplate } from './NFTSalesTemplate.serviceAgreementTemplate' import { EscrowPaymentCondition, LockPaymentCondition, TransferNFTCondition } from '../conditions' -import { BigNumber } from '../../../utils' export interface NFTSalesTemplateParams { consumerId: string providerId: string - nftAmount: BigNumber + nftAmount: bigint } export class NFTSalesTemplate extends BaseTemplate { @@ -36,7 +35,7 @@ export class NFTSalesTemplate extends BaseTemplate + private rewards: Map private tokenAddress?: string public constructor() - public constructor(_rewards: Map) - public constructor(address: string, amount: BigNumber) - public constructor(address: string, amount: BigNumber, tokenAddress: string) + public constructor(_rewards: Map) + public constructor(address: string, amount: bigint) + public constructor(address: string, amount: bigint, tokenAddress: string) public constructor(..._params: any[]) { - this.totalPrice = BigNumber.from(0) + this.totalPrice = 0n this.rewards = new Map() if (_params.length === 1) { const [rewards] = _params - this.rewards = rewards as Map - this.rewards.forEach((v) => (this.totalPrice = this.totalPrice.add(v))) + this.rewards = rewards as Map + this.rewards.forEach((v) => (this.totalPrice = this.totalPrice + v)) } else if (_params.length === 2) { const [address, amount] = _params this.rewards.set(address, amount) @@ -33,19 +31,19 @@ export class AssetPrice { } } - public static sumAmounts(amounts: BigNumber[]) { - return amounts.reduce((a, b) => b.add(a), BigNumber.from(0)) + public static sumAmounts(amounts: bigint[]) { + return amounts.reduce((a, b) => b + a, 0n) } - public getTotalPrice(): BigNumber { + public getTotalPrice(): bigint { return this.totalPrice } - public getRewards(): Map { + public getRewards(): Map { return this.rewards } - public getAmounts(): BigNumber[] { + public getAmounts(): bigint[] { return [...Array.from(this.rewards.values())] } @@ -53,7 +51,7 @@ export class AssetPrice { return [...Array.from(this.rewards.keys())] } - public setReceiver(receiver: string, amount: BigNumber): AssetPrice { + public setReceiver(receiver: string, amount: bigint): AssetPrice { this.rewards.set(receiver, amount) this.totalPrice = AssetPrice.sumAmounts(this.getAmounts()) return this @@ -80,10 +78,10 @@ export class AssetPrice { * @param networkFeePercent - the percent of fees to receive, it uses the contract denominator @see AssetPrice.NETWORK_FEE_DENOMINATOR * @returns the asset rewards object */ - public addNetworkFees(feeReceiver: string, networkFeePercent: BigNumber): AssetPrice { + public addNetworkFees(feeReceiver: string, networkFeePercent: bigint): AssetPrice { return this.setReceiver( feeReceiver, - this.totalPrice.mul(networkFeePercent).div(AssetPrice.NETWORK_FEE_DENOMINATOR).div(100), + (this.totalPrice * networkFeePercent) / AssetPrice.NETWORK_FEE_DENOMINATOR / 100n, ) } @@ -93,18 +91,13 @@ export class AssetPrice { * @param networkFeePercent - the percent of fees to receive, it uses the contract denominator @see AssetPrice.NETWORK_FEE_DENOMINATOR * @returns the asset rewards object */ - public adjustToIncludeNetworkFees(feeReceiver: string, networkFeePercent: BigNumber): AssetPrice { - const feesToInclude = this.totalPrice - .mul(networkFeePercent) - .div(AssetPrice.NETWORK_FEE_DENOMINATOR) - .div(100) + public adjustToIncludeNetworkFees(feeReceiver: string, networkFeePercent: bigint): AssetPrice { + const feesToInclude = + (this.totalPrice * networkFeePercent) / AssetPrice.NETWORK_FEE_DENOMINATOR / 100n - const newRewards: Map = new Map() + const newRewards: Map = new Map() this.rewards.forEach((k, v) => { - newRewards.set( - v, - k.sub(k.mul(networkFeePercent).div(AssetPrice.NETWORK_FEE_DENOMINATOR).div(100)), - ) + newRewards.set(v, k - (k * networkFeePercent) / AssetPrice.NETWORK_FEE_DENOMINATOR / 100n) }) newRewards.set(feeReceiver, feesToInclude) this.rewards = newRewards diff --git a/src/models/NFTAttributes.ts b/src/models/NFTAttributes.ts index 6ff53ec68..bbffbd279 100644 --- a/src/models/NFTAttributes.ts +++ b/src/models/NFTAttributes.ts @@ -1,5 +1,4 @@ import { RoyaltyAttributes } from '../nevermined' -import BigNumber from '../utils/BigNumber' import { AssetAttributes } from './AssetAttributes' import { ERCType, NeverminedNFTType, NeverminedNFT1155Type, NeverminedNFT721Type } from './' @@ -26,7 +25,7 @@ export class NFTAttributes extends AssetAttributes { /** * Max number of nfts that can be minted, 0 means uncapped */ - cap?: BigNumber + cap?: bigint /** * If the asset is pre-minted @@ -56,7 +55,7 @@ export class NFTAttributes extends AssetAttributes { /** * Number of editions */ - amount?: BigNumber + amount?: bigint /** * Attributes describing the royalties attached to the NFT in the secondary market @@ -65,13 +64,13 @@ export class NFTAttributes extends AssetAttributes { static defaultValues = { ...AssetAttributes.defaultValues, - cap: BigNumber.from(0), // Cap equals to 0 means the NFT is uncapped + cap: 0n, // Cap equals to 0 means the NFT is uncapped preMint: true, // It means the NFT will mint all the editions defined in the `amount` attributed during the registration nftMetadataUrl: '', // Url to the metadata describing the NFT OpenSea style nftTransfer: true, // The NFT will use transfers isSubscription: false, // By default the asset doesn't represent a subscription duration: 0, // Because it's not a subscription it doesn't have a duration - amount: BigNumber.from(1), // By default just one edition + amount: 1n, // By default just one edition royaltyAttributes: undefined, // No royalty attributes by default what means no royalties } diff --git a/src/models/types.ts b/src/models/types.ts index c02478060..654ceb655 100644 --- a/src/models/types.ts +++ b/src/models/types.ts @@ -1,5 +1,3 @@ -import { BigNumber } from '../utils' - export interface AaveConfig { lendingPoolAddress: string dataProviderAddress: string @@ -83,7 +81,6 @@ export interface Babysig { } export interface Balance { - eth: BigNumber - - nevermined: BigNumber + eth: bigint + nevermined: bigint } diff --git a/src/nevermined/Account.ts b/src/nevermined/Account.ts index 60ecb7d1e..aa7c9725b 100644 --- a/src/nevermined/Account.ts +++ b/src/nevermined/Account.ts @@ -3,7 +3,7 @@ import { Balance } from '../models' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { TxParameters } from '../keeper' import { KeeperError } from '../errors' -import { BigNumber } from '../utils' +import { BigNumberish } from '../sdk' /** * Account information. @@ -56,17 +56,17 @@ export class Account extends Instantiable { * Balance of Nevermined Token. * @returns */ - public async getNeverminedBalance(): Promise { + public async getNeverminedBalance(): Promise { const { token } = this.nevermined.keeper - if (!token) return BigNumber.from(0) - return (await token.balanceOf(this.id)).div(10).mul(await token.decimals()) + if (!token) return 0n + return ((await token.balanceOf(this.id)) / 10n) * BigInt(await token.decimals()) } /** * Balance of Ether. * @returns */ - public async getEtherBalance(): Promise { + public async getEtherBalance(): Promise { return this.web3.getBalance(this.id) } @@ -87,10 +87,7 @@ export class Account extends Instantiable { * @param txParams - Transaction parameters * @returns */ - public async requestTokens( - amount: number | string | BigNumber, - txParams?: TxParameters, - ): Promise { + public async requestTokens(amount: BigNumberish, txParams?: TxParameters): Promise { if (!this.nevermined.keeper.dispenser) { throw new KeeperError('Dispenser not available on this network.') } diff --git a/src/nevermined/Token.ts b/src/nevermined/Token.ts index a45d447c2..e5073a32b 100644 --- a/src/nevermined/Token.ts +++ b/src/nevermined/Token.ts @@ -1,7 +1,6 @@ import { Account } from './Account' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { TxParameters as txParams } from '../keeper' -import { BigNumber } from '../utils' /** * Tokens submodule of Nevermined. @@ -42,7 +41,7 @@ export class TokenUtils extends Instantiable { /** * Get token total supply */ - public async getTotalSupply(): Promise { + public async getTotalSupply(): Promise { return await this.nevermined.keeper.token.totalSupply() } @@ -56,7 +55,7 @@ export class TokenUtils extends Instantiable { */ public async transfer( to: string, - amount: BigNumber, + amount: bigint, from: Account, txParams?: txParams, ): Promise { diff --git a/src/nevermined/api/ConditionsApi.ts b/src/nevermined/api/ConditionsApi.ts index a3426ff3b..0fd08a23c 100644 --- a/src/nevermined/api/ConditionsApi.ts +++ b/src/nevermined/api/ConditionsApi.ts @@ -6,7 +6,6 @@ import { Token, CustomToken, TxParameters as txParams } from '../../keeper' import { AssetPrice } from '../../models' import { KeeperError } from '../../errors/KeeperError' import { ContractReceipt } from 'ethers' -import { BigNumber } from '../../utils' /** * Nevermined Conditions API. It the interaction with the Smart Contracts building the conditions attached @@ -39,7 +38,7 @@ export class ConditionsApi extends Instantiable { public async lockPayment( agreementId: string, did: string, - amounts: BigNumber[], + amounts: bigint[], receivers: string[], erc20TokenAddress?: string, from?: Account, @@ -171,7 +170,7 @@ export class ConditionsApi extends Instantiable { */ public async releaseReward( agreementId: string, - amounts: BigNumber[], + amounts: bigint[], receivers: string[], returnAddress: string, did: string, @@ -230,7 +229,7 @@ export class ConditionsApi extends Instantiable { public async releaseNftReward( agreementId: string, ddo: DDO, - nftAmount: BigNumber, + nftAmount: bigint, publisher: Account, from?: Account, txParams?: txParams, @@ -316,7 +315,7 @@ export class ConditionsApi extends Instantiable { agreementId: string, did: string, holder: string, - nftAmount: BigNumber, + nftAmount: bigint, contractAddress?: string, from?: Account, params?: txParams, @@ -408,7 +407,7 @@ export class ConditionsApi extends Instantiable { public async transferNft( agreementId: string, ddo: DDO, - nftAmount: BigNumber, + nftAmount: bigint, from?: Account, txParams?: txParams, ) { @@ -446,7 +445,7 @@ export class ConditionsApi extends Instantiable { public async transferNftForDelegate( agreementId: string, ddo: DDO, - nftAmount: BigNumber, + nftAmount: bigint, from?: Account, params?: txParams, ) { diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index d6f57231d..0f4866479 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -12,7 +12,6 @@ import { Account } from '../../Account' import { TxParameters, Nft1155Contract } from '../../../keeper' import { DDO } from '../../../ddo' import { NFTError } from '../../../errors' -import { BigNumber } from '../../../utils' import { NFTsBaseApi } from './NFTsBaseApi' import { ContractReceipt } from 'ethers' import { CreateProgressStep, OrderProgressStep } from '../../ProgressSteps' @@ -128,7 +127,7 @@ export class NFT1155Api extends NFTsBaseApi { * ```ts * await nevermined.nfts1155.mint( * did, - * BigNumber.from(10), + * 10n, * artist * ) * ``` @@ -144,7 +143,7 @@ export class NFT1155Api extends NFTsBaseApi { */ public async mint( did: string, - nftAmount: BigNumber, + nftAmount: bigint, receiver: string | undefined, account: Account, data?: string, @@ -170,7 +169,7 @@ export class NFT1155Api extends NFTsBaseApi { * ```ts * await nevermined.nfts1155.burn( * did, - * BigNumber.from(2), + * 2n, * artist * ) * ``` @@ -182,7 +181,7 @@ export class NFT1155Api extends NFTsBaseApi { * * @returns The {@link ethers.ContractReceipt} */ - public async burn(did: string, nftAmount: BigNumber, account: Account, txParams?: TxParameters) { + public async burn(did: string, nftAmount: bigint, account: Account, txParams?: TxParameters) { return await this.nftContract.burn(account.getId(), did, nftAmount, txParams) } @@ -209,7 +208,7 @@ export class NFT1155Api extends NFTsBaseApi { */ public order( did: string, - numberEditions: BigNumber, + numberEditions: bigint, consumer: Account, txParams?: TxParameters, ): SubscribablePromise { @@ -255,7 +254,7 @@ export class NFT1155Api extends NFTsBaseApi { * agreementId, * editor.getId(), * subscriber.getId(), - * BigNumber.from(1) + * 1n * ) * ``` * @@ -271,7 +270,7 @@ export class NFT1155Api extends NFTsBaseApi { agreementId: string, nftHolder: string, nftReceiver: string, - numberEditions: BigNumber = BigNumber.from(1), + numberEditions = 1n, did?: string, ): Promise { return await this.claimNFT(agreementId, nftHolder, nftReceiver, numberEditions, 1155, did) @@ -308,7 +307,7 @@ export class NFT1155Api extends NFTsBaseApi { public async transfer( agreementId: string, did: string, - nftAmount: BigNumber, + nftAmount: bigint, publisher: Account, txParams?: TxParameters, ): Promise { @@ -360,7 +359,7 @@ export class NFT1155Api extends NFTsBaseApi { public async releaseRewards( agreementId: string, did: string, - nftAmount: BigNumber, + nftAmount: bigint, publisher: Account, txParams?: TxParameters, ): Promise { @@ -397,7 +396,7 @@ export class NFT1155Api extends NFTsBaseApi { * * @returns The number of editions of a NFT owned by the account/address. */ - public async balance(did: string, account: Account | string): Promise { + public async balance(did: string, account: Account | string): Promise { return await this.nftContract.balance( account instanceof Account ? account.getId() : account, did, diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index cdfffb901..e9cb41180 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -8,7 +8,6 @@ import { PublishMetadata } from '../AssetsApi' import { NFTError } from '../../../errors/NFTError' import { ContractReceipt, ethers } from 'ethers' import { NFTsBaseApi } from './NFTsBaseApi' -import { BigNumber } from '../../../utils' import { CreateProgressStep, OrderProgressStep } from '../../ProgressSteps' import { SubscriptionToken } from '../../../services' @@ -188,7 +187,7 @@ export class NFT721Api extends NFTsBaseApi { nftReceiver: string, did?: string, ): Promise { - return await this.claimNFT(agreementId, nftHolder, nftReceiver, BigNumber.from(1), 721, did) + return await this.claimNFT(agreementId, nftHolder, nftReceiver, 1n, 721, did) } /** @@ -481,7 +480,7 @@ export class NFT721Api extends NFTsBaseApi { * * @returns The balance of NFTs owned by the account. */ - public async balanceOf(account: Account | string): Promise { + public async balanceOf(account: Account | string): Promise { const _address = account instanceof Account ? account.getId() : account return await this.nftContract.balanceOf(_address) } diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 61e1b5771..dd6176c76 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -13,7 +13,7 @@ import { Account } from '../../Account' import { Token, TxParameters } from '../../../keeper' import { ServiceSecondary } from '../../../ddo' import { NFTError } from '../../../errors' -import { BigNumber, generateId } from '../../../utils' +import { generateId } from '../../../utils' import { RegistryBaseApi } from '../RegistryBaseApi' /** @@ -56,7 +56,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { agreementId: string, nftHolder: string, nftReceiver: string, - numberEditions: BigNumber = BigNumber.from(1), + numberEditions = 1n, ercType: ERCType = 1155, did?: string, ): Promise { @@ -145,8 +145,8 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { } const nftInfo = await this.nevermined.keeper.didRegistry.getNFTInfo(did) - let nftSupply = BigNumber.from(0) - let mintCap = BigNumber.from(0) + let nftSupply = 0n + let mintCap = 0n let nftURI = '' if (nftInfo[1]) { @@ -235,7 +235,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { public async listOnSecondaryMarkets( ddo: DDO, assetPrice: AssetPrice, - nftAmount: BigNumber, + nftAmount: bigint, provider: string, token: Token, owner: string, @@ -298,7 +298,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { * ```ts * const result = await nevermined.nfts1155.buySecondaryMarketNft( * collector, - * BigNumber.from(1), + * 1n, * agreementId * ) * ``` @@ -314,7 +314,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { */ public async buySecondaryMarketNft( consumer: Account, - nftAmount: BigNumber = BigNumber.from(1), + nftAmount = 1n, agreementIdSeed: string, conditionsTimeout: number[] = [86400, 86400, 86400], txParams?: TxParameters, diff --git a/src/sdk.ts b/src/sdk.ts index ba36004d7..1eb738b39 100644 --- a/src/sdk.ts +++ b/src/sdk.ts @@ -2,7 +2,6 @@ import { LoggerInstance as Logger } from './utils' export { ClientError } from './errors' import * as subgraphs from './subgraphs' -import BigNumber from './utils/BigNumber' export * from './common' export * from './ddo' @@ -15,4 +14,4 @@ export * from './keeper' export * from './Instantiable.abstract' export * from './errors' -export { Logger, subgraphs, BigNumber } +export { Logger, subgraphs } diff --git a/src/services/aave/AaveCredit.ts b/src/services/aave/AaveCredit.ts index f8102bcb1..62b9b3f05 100644 --- a/src/services/aave/AaveCredit.ts +++ b/src/services/aave/AaveCredit.ts @@ -11,9 +11,8 @@ import { AgreementInstance, } from '../../keeper' import { AaveConfig } from '../../models' -import { didZeroX, generateId, zeroX } from '../../utils' +import { didZeroX, formatEther, generateId, parseEther, zeroX } from '../../utils' import { ContractReceipt, ethers } from 'ethers' -import { BigNumber } from '../../utils' /** * AaveCredit allows taking loans from Aave protocol using NFT tokens as collateral @@ -188,7 +187,7 @@ export class AaveCredit extends Instantiable { ) await erc20Token.approve( this.nevermined.keeper.conditions.aaveCollateralDepositCondition.address, - BigNumber.parseEther(collateralAmount.toString()), + parseEther(collateralAmount.toString()), from, ) } @@ -234,7 +233,7 @@ export class AaveCredit extends Instantiable { if (!did) { did = agreementData.did } - const amount = BigNumber.parseEther(delegatedAmount.toString()).toString() + const amount = parseEther(delegatedAmount.toString()).toString() const contractReceipt: ContractReceipt = await this.nevermined.keeper.conditions.aaveBorrowCondition.fulfill( @@ -277,7 +276,7 @@ export class AaveCredit extends Instantiable { const erc20Token = await CustomToken.getInstanceByAddress(this.instanceConfig, delegatedAsset) const totalDebt = await this.getTotalActualDebt(agreementId, from, vaultAddress) const allowanceAmount = totalDebt + (totalDebt / 10000) * 10 - const weiAllowanceAmount = BigNumber.parseEther(allowanceAmount.toString()) + const weiAllowanceAmount = parseEther(allowanceAmount.toString()) // Verify that the borrower has sufficient balance for the repayment const weiBalance = await erc20Token.balanceOf(from.getId()) @@ -295,7 +294,7 @@ export class AaveCredit extends Instantiable { from, ) - const weiAmount = BigNumber.parseEther(delegatedAmount.toString()).toString() + const weiAmount = parseEther(delegatedAmount.toString()).toString() // use the aaveRepayCondition to apply the repayment const contractReceipt: ContractReceipt = await this.nevermined.keeper.conditions.aaveRepayCondition.fulfill( @@ -415,8 +414,8 @@ export class AaveCredit extends Instantiable { from.getId(), vaultAddress, ) - const totalDebt: BigNumber = await vault.call('getTotalActualDebt', [], from.getId()) - return Number(BigNumber.formatEther(totalDebt)) + const totalDebt: bigint = await vault.call('getTotalActualDebt', [], from.getId()) + return Number(formatEther(totalDebt)) } /** @@ -435,7 +434,7 @@ export class AaveCredit extends Instantiable { from.getId(), vaultAddress, ) - return Number(BigNumber.formatEther(await vault.call('getActualCreditDebt', [], from.getId()))) + return Number(formatEther(await vault.call('getActualCreditDebt', [], from.getId()))) } /** @@ -454,7 +453,7 @@ export class AaveCredit extends Instantiable { from.getId(), vaultAddress, ) - return Number(BigNumber.formatEther(await vault.call('getCreditAssetDebt', [], from.getId()))) + return Number(formatEther(await vault.call('getCreditAssetDebt', [], from.getId()))) } public async getAssetPrice( @@ -487,7 +486,7 @@ export class AaveCredit extends Instantiable { from.getId(), vaultAddress, ) - return Number(BigNumber.formatEther(await vault.call('getBorrowedAmount', [], from.getId()))) + return Number(formatEther(await vault.call('getBorrowedAmount', [], from.getId()))) } /** @@ -510,7 +509,7 @@ export class AaveCredit extends Instantiable { vaultAddress, ) return Number( - BigNumber.formatEther( + formatEther( await vault.call( 'delegatedAmount', [borrower, delegatedToken, interestRateMode], diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index 624e02068..722dc3de1 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -4,7 +4,6 @@ import { noZeroX } from '../../utils' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { ReadStream } from 'fs' import { NeverminedNodeError, HttpError } from '../../errors' -import { BigNumber } from '../../utils' import { ERCType, Babysig } from '../../models' import { PublishMetadata } from '../../nevermined' @@ -376,7 +375,7 @@ export class NeverminedNode extends Instantiable { agreementId: string, nftHolder: string, nftReceiver: string, - nftAmount: BigNumber, + nftAmount: bigint, ercType: ERCType = 1155, did?: string, ): Promise { diff --git a/src/utils/BigNumber.ts b/src/utils/BigNumber.ts deleted file mode 100644 index adb269590..000000000 --- a/src/utils/BigNumber.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { ethers } from 'ethers' - -export class BigNumber extends ethers.BigNumber { - /** - * Converts a ether _value_ into _wei_. - * - * @param value - The string value to convert - * @returns The BigNumber representation of _value_ in _wei_ - * - * @example - * ```ts - * parseEther("1.0") - * // { BigNumber: "1000000000000000000" } - * - * parseEther("-0.5") - * // { BigNumber: "-500000000000000000" } - * ``` - */ - public static parseEther(value: string): BigNumber { - return ethers.utils.parseEther(value) - } - - /** - * Returns a BigNumber representation of value, parsed with _decimal_ digits. - * - * @param value - The string value to convert - * @param decimals - The number of decimals - * @returns The BigNumber representation of _value_ parsed with _decimals_ - * - * @example - * ```ts - * parseUnits("1.0", 18) - * // { BigNumber: "1000000000000000000" } - * - * parseUnits("121.0", 9); - * // { BigNumber: "121000000000" } - * ``` - */ - public static parseUnits(value: string, decimals = 18): BigNumber { - return ethers.utils.parseUnits(value, decimals) - } - - /** - * Converts a _wei_ value into _ether_. - * - * @param value - The value to format. - * @returns The string of the formated value - * - * @example - * ```ts - * const value = BigNumber.from("1000000000000000000") - * - * formatEther(value) - * // '1.0' - * ``` - */ - public static formatEther(value: BigNumber): string { - return ethers.utils.formatEther(value) - } - - /** - * Returns a string representation of value formatted with _decimal_ digits. - * - * @param value - The value to format. - * @returns The string of the formated value - * - * @example - * ```ts - * const oneEther = BigNumber.from("1000000000000000000") - * - * formatUnits(oneEther, 18) - * // '1.0' - * ``` - */ - public static formatUnits(value: BigNumber, decimals = 18): string { - return ethers.utils.formatUnits(value, decimals) - } -} - -export default BigNumber diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 74199bc14..08fa410c6 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -9,7 +9,6 @@ import { ServiceNFTSales, } from '../ddo' import { AssetPrice } from '../models' -import { BigNumber } from './BigNumber' // DDO Services including a sales process const SALES_SERVICES = ['access', 'compute', 'nft-sales'] @@ -23,7 +22,7 @@ function fillParameterWithDDO( erc20TokenContract?: string, nftTokenContract?: string, nftHolder?: string, - nftAmount: BigNumber = BigNumber.from(1), + nftAmount = 1n, nftTransfer = false, duration = 0, ): ServiceAgreementTemplateParameter { @@ -85,7 +84,7 @@ export function fillConditionsWithDDO( erc20TokenContract?: string, nftTokenContract?: string, nftHolder?: string, - nftAmount?: BigNumber, + nftAmount?: bigint, nftTransfer = false, duration = 0, fulfillAccessTimeout = 0, @@ -174,9 +173,9 @@ export function getAssetPriceFromService(service: Service): AssetPrice { const receivers = escrowPaymentCondition.parameters.find((p) => p.name === '_receivers') .value as string[] - const rewardsMap = new Map() + const rewardsMap = new Map() - for (let i = 0; i < amounts.length; i++) rewardsMap.set(receivers[i], BigNumber.from(amounts[i])) + for (let i = 0; i < amounts.length; i++) rewardsMap.set(receivers[i], BigInt(amounts[i])) return new AssetPrice(rewardsMap) } @@ -192,9 +191,11 @@ export function getNftHolderFromService(service: Service): string { return nftTransferCondition.parameters.find((p) => p.name === '_nftHolder').value as string } -export function getNftAmountFromService(service: Service): BigNumber { +export function getNftAmountFromService(service: Service): bigint { const nftTransferCondition = findServiceConditionByName(service, 'transferNFT') - return BigNumber.from(nftTransferCondition.parameters.find((p) => p.name === '_numberNfts').value) + return BigInt( + nftTransferCondition.parameters.find((p) => p.name === '_numberNfts').value as string, + ) } export function getNftContractAddressFromService( diff --git a/src/utils/UnitConversion.ts b/src/utils/UnitConversion.ts new file mode 100644 index 000000000..4539e0ad1 --- /dev/null +++ b/src/utils/UnitConversion.ts @@ -0,0 +1,77 @@ +import { BigNumberish, ethers } from 'ethers' +export type { BigNumberish } from 'ethers' + +/** + * Converts a ether _value_ into _wei_. + * + * @param value - The string value to convert + * @returns The BigInt representation of _value_ in _wei_ + * + * @example + * ```ts + * parseEther("1.0") + * // 1000000000000000000n + * + * parseEther("-0.5") + * // -500000000000000000n + * ``` + */ +export const parseEther = (value: string): bigint => { + return ethers.parseEther(value) +} + +/** + * Returns a BigInt representation of value, parsed with _decimal_ digits. + * + * @param value - The string value to convert + * @param decimals - The number of decimals + * @returns The BigInt representation of _value_ parsed with _decimals_ + * + * @example + * ```ts + * parseUnits("1.0", 18) + * // 1000000000000000000n + * + * parseUnits("121.0", 9); + * // 121000000000n + * ``` + */ +export const parseUnits = (value: string, decimals = 18): bigint => { + return ethers.parseUnits(value, decimals) +} + +/** + * Converts a _wei_ value into _ether_. + * + * @param value - The value to format. + * @returns The string of the formatted value + * + * @example + * ```ts + * const value = 1000000000000000000n + * + * formatEther(value) + * // '1.0' + * ``` + */ +export const formatEther = (value: BigNumberish): string => { + return ethers.formatEther(value) +} + +/** + * Returns a string representation of value formatted with _decimal_ digits. + * + * @param value - The value to format. + * @returns The string of the formatted value + * + * @example + * ```ts + * const oneEther = 1000000000000000000n + * + * formatUnits(oneEther, 18) + * // '1.0' + * ``` + */ +export const formatUnits = (value: BigNumberish, decimals = 18): string => { + return ethers.formatUnits(value, decimals) +} diff --git a/src/utils/index.ts b/src/utils/index.ts index 221876e2a..285860fc5 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -6,7 +6,7 @@ export * from './GeneratorHelpers' export * from './DDOHelpers' export * from './SubscribablePromise' export * from './SubscribableObserver' -export * from './BigNumber' +export * from './UnitConversion' export * from './MakeAccounts' export function makeBuffer(a, b) { diff --git a/tsconfig.json b/tsconfig.json index a1fe37ed0..b9ddb2ba8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "lib": ["es2019", "ES2020", "ES2017", "ES6", "ES7", "DOM"], "declaration": true, "module": "CommonJS", - "target": "ES6", + "target": "ES2020", "noImplicitAny": false, "removeComments": true, "experimentalDecorators": true, From b21d756f7f3ed3a3cb5416f83310d85b58b4eb20 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 12 Jul 2023 10:19:16 +0200 Subject: [PATCH 007/151] feat: update contract related methos to ethers v6 --- CHANGELOG.md | 8 ++--- MIGRATION_GUIDE.md | 35 ++++++++++++++++++ src/keeper/ContractHandler.ts | 53 +++++++++++----------------- src/keeper/contracts/ContractBase.ts | 42 +++++++++++----------- 4 files changed, 80 insertions(+), 58 deletions(-) create mode 100644 MIGRATION_GUIDE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e0151f1..7dd5537ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1035,7 +1035,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1298,7 +1298,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1804,7 +1804,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1843,7 +1843,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md new file mode 100644 index 000000000..9d57e89ec --- /dev/null +++ b/MIGRATION_GUIDE.md @@ -0,0 +1,35 @@ +# Migration guide to v2 + +### Big Numbers + +To handle big numbers v2 uses the ES2020 built-in `BigInt` values ([see the BigInt documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)): + +- The `BigNumber` class was removed +- The unit conversion helper functions `parseEther`, `parseUnits`, `formatEther`, `formatUnits` are now part of the sdk utils + +```ts +import { parseEther, parseUnits, formatEther, formatUnits } from '@nevermined-io/sdk' + +// Using BigNumber in v1 +value = BigNumber.from('1000') + +// Using BigInt in v2 (using literal notation). +// Notice the suffix n +value = 1000n + +// Using the BigInt function for strings +value = BigInt('1000') + +// Adding two values in v1 +sum = value1.add(value2) + +// Using BigInt in v2; keep in mind, both values +// must be a BigInt +sum = value1 + value2 + +// Checking equality in v1 +isEqual = value1.eq(value2) + +// Using BigInt in v2 +isEqual = value1 == value2 +``` diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index 3b64367b9..864d3200a 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -3,8 +3,7 @@ import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { KeeperError } from '../errors/KeeperError' import { ApiError } from '../errors/ApiError' import { Account } from '../nevermined' -import { ContractReceipt, ethers } from 'ethers' -import { TransactionResponse } from '@ethersproject/abstract-provider' +import { ContractTransactionResponse, TransactionReceipt, ethers } from 'ethers' let fetch if (typeof window !== 'undefined') { @@ -107,18 +106,18 @@ export class ContractHandler extends Instantiable { } public async deployAbi( - artifact: { name?: string; abi: ethers.ContractInterface; bytecode: string }, + artifact: { name?: string; abi: ethers.InterfaceAbi; bytecode: string }, from: Account, args: string[] = [], - ): Promise { + ): Promise { this.logger.debug(`Deploying abi using account: ${from.getId()}`) const signer = await this.nevermined.accounts.findSigner(from.getId()) const contract = new ethers.ContractFactory(artifact.abi, artifact.bytecode, signer) - const isZos = contract.interface.fragments.some((f) => f.name === 'initialize') + const isZos = contract.interface.hasFunction('initialize') const argument = isZos ? [] : args - let contractInstance: ethers.Contract + let baseContract: ethers.BaseContract try { const feeData = await this.getFeeData() @@ -127,24 +126,20 @@ export class ContractHandler extends Instantiable { gasLimit: 10000000n, } - contractInstance = await contract.deploy(...argument, extraParams) - await contractInstance.deployTransaction.wait() + baseContract = await contract.deploy(...argument, extraParams) + await baseContract.waitForDeployment() } catch (error) { console.error(JSON.stringify(error)) throw new Error(error.message) } if (isZos) { - const methodSignature = ContractHandler.getSignatureOfMethod( - contractInstance, - 'initialize', - args, - ) + const methodSignature = ContractHandler.getSignatureOfMethod(baseContract, 'initialize', args) - const contract = contractInstance.connect(signer) + const contract = baseContract.connect(signer) // estimate gas - const gasLimit = await contract.estimateGas[methodSignature](...args, { + const gasLimit = await contract[methodSignature].estimateGas(...args, { from: from.getId(), }) const feeData = await this.getFeeData() @@ -153,17 +148,16 @@ export class ContractHandler extends Instantiable { gasLimit, } - const transactionResponse: TransactionResponse = await contract[methodSignature]( - ...args, - extraParams, - ) + const contractTransactionResponse: ContractTransactionResponse = await contract[ + methodSignature + ](...args, extraParams) - const contractReceipt: ContractReceipt = await transactionResponse.wait() - if (contractReceipt.status !== 1) { + const transactionReceipt: TransactionReceipt = await contractTransactionResponse.wait() + if (transactionReceipt.status !== 1) { throw new Error(`Error deploying contract ${artifact.name}`) } } - return contractInstance + return baseContract } private async load( @@ -219,15 +213,11 @@ export class ContractHandler extends Instantiable { } public static getSignatureOfMethod( - contractInstance: ethers.Contract, + baseContract: ethers.BaseContract, methodName: string, args: any[], ): string { - const methods = contractInstance.interface.fragments.filter((f) => f.name === methodName) - const foundMethod = methods.find((f) => f.inputs.length === args.length) || methods[0] - if (!foundMethod) { - throw new Error(`Method "${methodName}" not found in contract`) - } + const foundMethod = baseContract.interface.getFunction(methodName, args) return foundMethod.format() } @@ -296,11 +286,8 @@ export class ContractHandler extends Instantiable { try { const response = await this.nevermined.utils.fetch.get(gasStationUri) const data = await response.json() - maxFeePerGas = ethers.utils.parseUnits(Math.ceil(data.fast.maxFee) + '', 'gwei') - maxPriorityFeePerGas = ethers.utils.parseUnits( - Math.ceil(data.fast.maxPriorityFee) + '', - 'gwei', - ) + maxFeePerGas = ethers.parseUnits(Math.ceil(data.fast.maxFee) + '', 'gwei') + maxPriorityFeePerGas = ethers.parseUnits(Math.ceil(data.fast.maxPriorityFee) + '', 'gwei') } catch (error) { this.logger.warn(`Failed to ges gas price from gas station ${gasStationUri}: ${error}`) } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index b43f0ca2f..c8e66597e 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -1,9 +1,8 @@ -import { TransactionResponse } from '@ethersproject/abstract-provider' import { Account } from '../../nevermined' import { ContractEvent, EventHandler, SubgraphEvent } from '../../events' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { KeeperError } from '../../errors' -import { ContractReceipt, ethers } from 'ethers' +import { ContractTransactionResponse, TransactionReceipt, ethers } from 'ethers' import { parseUnits } from '../../sdk' export interface TxParameters { value?: string @@ -19,7 +18,7 @@ export interface TxParameters { export abstract class ContractBase extends Instantiable { public contractName: string - public contract: ethers.Contract = null + public contract: ethers.BaseContract = null public events: ContractEvent | SubgraphEvent = null public version: string @@ -32,12 +31,12 @@ export abstract class ContractBase extends Instantiable { this.contractName = contractName } - public getContract(): ethers.Contract { + public getContract(): ethers.BaseContract { return this.contract } - public getAddress(): string { - return this.contract.address + public async getAddress(): Promise { + return this.contract.getAddress() } public getSignatureOfMethod(methodName: string, args: any[] = []): string { @@ -45,7 +44,7 @@ export abstract class ContractBase extends Instantiable { return foundMethod.format() } - public getInputsOfMethod(methodName: string): any[] { + public getInputsOfMethod(methodName: string): ReadonlyArray { const foundMethod = this.searchMethod(methodName) return foundMethod.inputs } @@ -92,7 +91,7 @@ export abstract class ContractBase extends Instantiable { args: any[], from?: Account, value?: TxParameters, - ): Promise { + ): Promise { const fromAddress = await this.getFromAddress(from && from.getId()) const receipt = await this.send(name, fromAddress, args, value) if (!receipt.status) { @@ -106,9 +105,9 @@ export abstract class ContractBase extends Instantiable { from: string, args: any[], txparams: any, - contract: ethers.Contract, + contract: ethers.BaseContract, progress: (data: any) => void, - ) { + ): Promise { // Uncomment to debug contract calls //console.debug(`Making contract call ....: ${name} - ${from} - ${JSON.stringify(args)}`) const methodSignature = this.getSignatureOfMethod(name, args) @@ -127,7 +126,7 @@ export abstract class ContractBase extends Instantiable { }) } - const transactionResponse: TransactionResponse = await contract[methodSignature]( + const transactionResponse: ContractTransactionResponse = await contract[methodSignature]( ...args, txparams, ) @@ -145,12 +144,12 @@ export abstract class ContractBase extends Instantiable { }) } - const ContractReceipt: ContractReceipt = await transactionResponse.wait() + const transactionReceipt: TransactionReceipt = await transactionResponse.wait() if (progress) { progress({ stage: 'receipt', args: this.searchMethodInputs(name, args), - ContractReceipt, + transactionReceipt, method: name, from, value, @@ -160,7 +159,7 @@ export abstract class ContractBase extends Instantiable { }) } - return ContractReceipt + return transactionReceipt } public async send( @@ -168,7 +167,7 @@ export abstract class ContractBase extends Instantiable { from: string, args: any[], params: TxParameters = {}, - ): Promise { + ): Promise { if (params.signer) { const paramsFixed = { ...params, signer: undefined } const contract = this.contract.connect(params.signer) @@ -255,8 +254,9 @@ export abstract class ContractBase extends Instantiable { } private searchMethod(methodName: string, args: any[] = []) { - const methods = this.contract.interface.fragments.filter((f) => f.name === methodName) - const foundMethod = methods.find((f) => f.inputs.length === args.length) || methods[0] + // const methods = this.contract.interface.fragments.filter((f) => f.name === methodName) + // const foundMethod = methods.find((f) => f.inputs.length === args.length) || methods[0] + const foundMethod = this.contract.interface.getFunction(methodName, args) if (!foundMethod) { throw new KeeperError(`Method "${methodName}" is not part of contract "${this.contractName}"`) } @@ -273,23 +273,23 @@ export abstract class ContractBase extends Instantiable { } private async estimateGas( - contract: ethers.Contract, + contract: ethers.BaseContract, methodSignature: string, args: any[], from: string, value: string, gasMultiplier?: number, ): Promise { - let gasLimit = await contract.estimateGas[methodSignature](...args, { + let gasLimit: bigint = await contract[methodSignature].estimateGas(...args, { from, value, }) - if (value) gasLimit = gasLimit.add(21500) + if (value) gasLimit = gasLimit + 21500n gasMultiplier = gasMultiplier || this.config.gasMultiplier if (gasMultiplier) { const gasMultiplierParsed = parseUnits(gasMultiplier.toString(), 2) - gasLimit = gasLimit.mul(gasMultiplierParsed).div(100) + gasLimit = (gasLimit * gasMultiplierParsed) / 100n } return gasLimit From 240cca68afdfe264aaf006d76cc0aa4cec0097be Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:06:20 +0200 Subject: [PATCH 008/151] feat: support for multiple services of the same type --- integration/nevermined/Assets.test.ts | 35 ---- .../AssetsWithMultipleServices.test.ts | 131 ++++++++++++ .../nevermined/NFT721Templates.test.ts | 2 +- integration/nevermined/NFTTemplates.test.ts | 2 +- .../nevermined/SecondaryMarket.test.ts | 17 +- integration/nevermined/Signature.test.ts | 2 +- src/ddo/DDO.ts | 165 +++------------ src/ddo/types.ts | 16 +- src/errors/DDOError.ts | 12 ++ .../contracts/defi/AaveCreditTemplate.ts | 2 +- .../contracts/templates/AccessTemplate.ts | 2 +- .../templates/AgreementTemplate.abstract.ts | 10 +- .../templates/BaseTemplate.abstract.ts | 64 +++--- .../contracts/templates/DIDSalesTemplate.ts | 2 +- .../EscrowComputeExecutionTemplate.ts | 2 +- .../templates/NFT721AccessTemplate.ts | 2 +- .../templates/NFT721SalesTemplate.ts | 2 +- .../contracts/templates/NFTAccessTemplate.ts | 2 +- .../contracts/templates/NFTSalesTemplate.ts | 2 +- src/nevermined/AccessService.ts | 42 ++-- src/nevermined/api/AssetsApi.ts | 4 +- src/nevermined/api/RegistryBaseApi.ts | 197 +++++++++++++----- src/nevermined/api/nfts/NFTsBaseApi.ts | 14 +- src/utils/DDOHelpers.ts | 105 +++++----- 24 files changed, 458 insertions(+), 376 deletions(-) create mode 100644 integration/nevermined/AssetsWithMultipleServices.test.ts diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index be3667b0f..cd646ad75 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -76,41 +76,6 @@ describe('Assets', () => { assert.equal(metadata.attributes.main.ercType, 721) assert.equal(metadata.attributes.additionalInformation.tags[0], 'test') }) - - it('register with multiple services of the same service type', async () => { - const nonce = Math.random() - createdMetadata = getMetadata(nonce, `Immutable Multiple Services Test ${nonce}`) - - createdMetadata.main.ercType = 721 - createdMetadata.additionalInformation.tags = ['test'] - - const assetAttributes = AssetAttributes.getInstance({ - metadata: createdMetadata, - services: [ - { - serviceType: 'access', - price: assetPrice, - }, - { - serviceType: 'access', - price: assetPrice, - }, - ], - }) - ddo = await nevermined.assets.create(assetAttributes, publisher, PublishMetadata.IPFS) - - assert.isDefined(ddo) - console.log(ddo.id) - - const accessServices = ddo.getServicesByType('access') - assert.equal(accessServices.length, 2) - assert.equal(accessServices[0].index, 2) - assert.equal(accessServices[1].index, 3) - - const metadata = ddo.findServiceByType('metadata') - assert.equal(metadata.attributes.main.ercType, 721) - assert.equal(metadata.attributes.additionalInformation.tags[0], 'test') - }) }) describe('#resolve()', () => { diff --git a/integration/nevermined/AssetsWithMultipleServices.test.ts b/integration/nevermined/AssetsWithMultipleServices.test.ts new file mode 100644 index 000000000..a4e04b7eb --- /dev/null +++ b/integration/nevermined/AssetsWithMultipleServices.test.ts @@ -0,0 +1,131 @@ +import { assert } from 'chai' +import { decodeJwt, JWTPayload } from 'jose' +import { config } from '../config' +import { getMetadata } from '../utils' +import { + Nevermined, + Account, + MetaData, + DDO, + AssetPrice, + AssetAttributes, + ConditionState, + Token, +} from '../../src' +import { BigNumber } from '../../src/utils' +import { repeat, sleep } from '../utils/utils' + +let nevermined: Nevermined +let publisher: Account +let consumer: Account +let metadata: MetaData +let createdMetadata: MetaData +let assetPrice1: AssetPrice +let assetPrice2: AssetPrice +let payload: JWTPayload +let ddo: DDO +let token: Token +let balanceBefore: BigNumber +let balanceAfter: BigNumber +const totalAmount1 = '100' +const totalAmount2 = '350' + +describe('Assets with multiple services', () => { + before(async () => { + nevermined = await Nevermined.getInstance(config) + ;({ token } = nevermined.keeper) + // Accounts + ;[publisher, consumer] = await nevermined.accounts.list() + + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(publisher) + + await nevermined.services.marketplace.login(clientAssertion) + + payload = decodeJwt(config.marketplaceAuthToken) + assetPrice1 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount1)) + assetPrice2 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount2)) + + metadata = getMetadata() + metadata.userId = payload.sub + }) + + describe('E2E flow for access services', () => { + it('Register with multiple access services', async () => { + balanceBefore = await token.balanceOf(consumer.getId()) + + const nonce = Math.random() + createdMetadata = getMetadata(nonce, `Immutable Multiple Services Test ${nonce}`) + + createdMetadata.main.ercType = 721 + createdMetadata.additionalInformation.tags = ['test'] + + const assetAttributes = AssetAttributes.getInstance({ + metadata: createdMetadata, + services: [ + { + serviceType: 'access', + price: assetPrice1, + }, + { + serviceType: 'access', + price: assetPrice2, + }, + ], + }) + ddo = await nevermined.assets.create(assetAttributes, publisher) + + assert.isDefined(ddo) + console.log(ddo.id) + + const accessServices = ddo.getServicesByType('access') + assert.equal(accessServices.length, 2) + assert.equal(accessServices[0].index, 2) + assert.equal(accessServices[1].index, 3) + + assert.equal( + accessServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value, + [totalAmount1], + ) + assert.equal( + accessServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value, + [totalAmount2], + ) + + const metadata = ddo.findServiceByType('metadata') + assert.equal(metadata.attributes.main.ercType, 721) + assert.equal(metadata.attributes.additionalInformation.tags[0], 'test') + }) + + it('Order and download the first of multiple access services', async () => { + const accessServices = ddo.getServicesByType('access') + + const agreementId = await nevermined.assets.order(ddo.id, accessServices[0].index, consumer) + await sleep(3000) + const status = await repeat(3, nevermined.agreements.status(agreementId)) + + assert.deepEqual(status, { + lockPayment: ConditionState.Fulfilled, + access: ConditionState.Unfulfilled, + escrowPayment: ConditionState.Unfulfilled, + }) + balanceAfter = await token.balanceOf(consumer.getId()) + + console.log(`Asset Price = ${assetPrice1.getTotalPrice()}`) + console.log(`Balance Before: ${balanceBefore.toString()}`) + console.log(`Balance After : ${balanceAfter.toString()}`) + + assert.equal(balanceBefore.sub(assetPrice1.getTotalPrice()), balanceAfter) + + const folder = '/tmp/nevermined/sdk-js/multiple-services/access' + const path = (await nevermined.assets.access( + agreementId, + ddo.id, + consumer, + folder, + -1, + )) as string + + assert.include(path, folder, 'The storage path is not correct.') + }) + }) +}) diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 4e9e53f8b..e1309f2a1 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -797,7 +797,7 @@ describe('NFT721Templates E2E', () => { await token.balanceOf(escrowPaymentCondition.getAddress()), ), } - ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice2, collector1.getId()) + ddo.setNFTRewardsFromService('nft-sales', assetPrice2, collector1.getId()) }) it('As collector2 I setup an agreement for buying an NFT from collector1', async () => { const result = await nft721SalesTemplate.createAgreementFromDDO( diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index 6ca3face1..c0a386794 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -799,7 +799,7 @@ describe('NFTTemplates E2E', () => { await token.balanceOf(escrowPaymentCondition.getAddress()), ), } - ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice2, collector1.getId()) + ddo.setNFTRewardsFromService('nft-sales', assetPrice2, collector1.getId()) }) it('As collector2 I setup an agreement for buying an NFT from collector1', async () => { diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index c5d16861b..ef137697c 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -23,7 +23,7 @@ import { } from '../../src/keeper' import { config } from '../config' import { getMetadata } from '../utils' -import { BigNumber } from '../../src/utils' +import { BigNumber, getConditionsByParams } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' chai.use(chaiAsPromised) @@ -351,18 +351,17 @@ describe('Secondary Markets', () => { lockPaymentCondition: await token.balanceOf(lockPaymentCondition.getAddress()), escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.getAddress()), } - ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice2, collector1.getId()) + ddo.setNFTRewardsFromService('nft-sales', assetPrice2, collector1.getId()) }) it('As collector1 I create and store an off-chain service agreement', async () => { - const nftSalesServiceAgreementTemplate = - await nftSalesTemplate.getServiceAgreementTemplate() - const nftSalesTemplateConditions = - await nftSalesTemplate.getServiceAgreementTemplateConditions() + const nftSalesServiceAgreementTemplate = nftSalesTemplate.getServiceAgreementTemplate() + const nftSalesTemplateConditions = nftSalesTemplate.getServiceAgreementTemplateConditions() - nftSalesServiceAgreementTemplate.conditions = ddo.fillConditionsWithDDO( + nftSalesServiceAgreementTemplate.conditions = getConditionsByParams( 'nft-sales', nftSalesTemplateConditions, + collector1.getId(), assetPrice2, token.getAddress(), undefined, @@ -506,7 +505,7 @@ describe('Secondary Markets', () => { describe('As collector1 I want to give exclusive access to the collectors owning a specific NFT', () => { before(async () => { const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(collector2) - ddo.setNFTRewardsFromDDOByService('nft-sales', assetPrice3, collector2.getId()) + ddo.setNFTRewardsFromService('nft-sales', assetPrice3, collector2.getId()) await nevermined.services.marketplace.login(clientAssertion) }) @@ -569,7 +568,7 @@ describe('Secondary Markets', () => { numberNFTs2, collector2.getId(), token, - collector2.getId(), + collector2, ) assert.isNotNull(agreementId3) diff --git a/integration/nevermined/Signature.test.ts b/integration/nevermined/Signature.test.ts index cb74f53a5..3ff7d1eff 100644 --- a/integration/nevermined/Signature.test.ts +++ b/integration/nevermined/Signature.test.ts @@ -46,7 +46,7 @@ describe('Signature', () => { const templateId = `0x${'f'.repeat(40)}` const agreementId = `0x${'e'.repeat(64)}` - const serviceAgreementTemplate = await templates.accessTemplate.getServiceAgreementTemplate() + const serviceAgreementTemplate = templates.accessTemplate.getServiceAgreementTemplate() const ddo = new DDO({ id: did, diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index e721fbf2c..dcdccff70 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -12,7 +12,7 @@ import { ServiceNFTSales, ConditionType, ServiceAgreementTemplateCondition, - ServiceAgreementTemplateParameter, + ServiceCommon, } from './types' import { didPrefixed, zeroX } from '../utils' import { DIDRegistry } from '../keeper' @@ -20,11 +20,12 @@ import { ethers } from 'ethers' import { AssetPrice, NFTAttributes } from '../models' import { BigNumber } from '../utils' import { DDOPriceNotFoundError, DDOServiceNotFoundError } from '../errors' +import { DDOConditionNotFoundError } from '../errors/DDOError' // DDO Services including a sales process -const SALES_SERVICES = ['access', 'compute', 'nft-sales'] +export const SALES_SERVICES = ['access', 'compute', 'nft-sales'] // Condition Names that are the final dependency for releasing the payment in a service agreement -const DEPENDENCIES_RELEASE_CONDITION = ['access', 'serviceExecution', 'transferNFT'] +export const DEPENDENCIES_RELEASE_CONDITION = ['access', 'serviceExecution', 'transferNFT'] /** * DID Descriptor Object. @@ -178,7 +179,7 @@ export class DDO { * @returns true if service exists. */ public serviceExists(serviceType: T): boolean { - return this.service.find((s) => s.type === serviceType) ? true : false + return this.service.some((s) => s.type === serviceType) } /** @@ -188,7 +189,7 @@ export class DDO { * @returns true if service exists. */ public serviceIndexExists(serviceIndex: number): boolean { - return this.service.find((s) => s.index === serviceIndex) ? true : false + return this.service.some((s) => s.index === serviceIndex) } /** @@ -263,19 +264,18 @@ export class DDO { this.service.sort((a, b) => (a.index > b.index ? 1 : -1)) } - public async addService(service: any): Promise { - // console.log(`Adding service: ${service.type}} with price: ${JSON.stringify(service.attributes.serviceAgreementTemplate)}`) + public addService(service: ServiceCommon) { this.service.push(service) } - public async replaceService(index: number, service: any): Promise { + public replaceService(index: number, service: any) { this.service[index] = service } - public async addDefaultMetadataService( + public addDefaultMetadataService( metadata: MetaData, nftAttributes?: NFTAttributes, - ): Promise { + ): MetaDataMain { const metadataService = { type: 'metadata', index: 0, @@ -335,7 +335,11 @@ export class DDO { service: Service, name: ConditionType, ): ServiceAgreementTemplateCondition { - return service.attributes.serviceAgreementTemplate.conditions.find((c) => c.name === name) + const condition = service.attributes.serviceAgreementTemplate.conditions.find( + (c) => c.name === name, + ) + if (!service) throw new DDOConditionNotFoundError(name) + return condition } /** @@ -403,7 +407,7 @@ export class DDO { public static getAssetPriceFromService(service: Service): AssetPrice { const escrowPaymentCondition = DDO.findServiceConditionByName(service, 'escrowPayment') if (!escrowPaymentCondition) { - return + throw new DDOConditionNotFoundError('escrowPayment') } const amounts = escrowPaymentCondition.parameters.find((p) => p.name === '_amounts') @@ -438,12 +442,16 @@ export class DDO { const service = this.findServiceByType(serviceType) const escrowPaymentCondition = DDO.findServiceConditionByName(service, 'escrowPayment') if (!escrowPaymentCondition) { - return + throw new DDOConditionNotFoundError('escrowPayment') + } + try { + const amounts = escrowPaymentCondition.parameters.find((p) => p.name === '_amounts') + const receivers = escrowPaymentCondition.parameters.find((p) => p.name === '_receivers') + amounts.value = Array.from(rewards.getAmounts(), (v) => v.toString()) + receivers.value = rewards.getReceivers() + } catch (e) { + throw new Error('Error setting the AssetPrice in the DDO') } - const amounts = escrowPaymentCondition.parameters.find((p) => p.name === '_amounts') - const receivers = escrowPaymentCondition.parameters.find((p) => p.name === '_receivers') - amounts.value = Array.from(rewards.getAmounts(), (v) => v.toString()) - receivers.value = rewards.getReceivers() } /** @@ -453,7 +461,7 @@ export class DDO { * @param holderAddress the NFT Holder address to set * @returns */ - public setNFTRewardsFromDDOByService( + public setNFTRewardsFromService( serviceType: ServiceType, rewards: AssetPrice, holderAddress: string, @@ -461,126 +469,9 @@ export class DDO { this.setAssetPriceFromDDOByService(serviceType, rewards) const service = this.findServiceByType(serviceType) const transferCondition = DDO.findServiceConditionByName(service, 'transferNFT') - if (!transferCondition) { - return - } + if (!transferCondition) return new DDOConditionNotFoundError('transferNFT') + const holder = transferCondition.parameters.find((p) => p.name === '_nftHolder') holder.value = holderAddress } - - /** - * Fills and return the conditions with the values given - * @param serviceType the service type - * @param conditions array of conditions - * @param assetPrice AssetPrice object - * @param erc20TokenContract the erc20 contract address - * @param nftTokenContract the nft contract address - * @param nftHolder the NFT holder address - * @param nftAmount the number of NFTs - * @param nftTransfer if is a NFT transfer or a NFT mint - * @param duration duration of the subscription - * @param fulfillAccessTimeout access timeout of the access condition - * @param fulfillAccessTimelock access time lock of the access condition - * @returns array of ServiceAgreementTemplateConditions - */ - public fillConditionsWithDDO( - serviceType: ServiceType, - conditions: ServiceAgreementTemplateCondition[], - assetPrice: AssetPrice = new AssetPrice(), - erc20TokenContract?: string, - nftTokenContract?: string, - nftHolder?: string, - nftAmount?: BigNumber, - nftTransfer = false, - duration = 0, - fulfillAccessTimeout = 0, - fulfillAccessTimelock = 0, - ): ServiceAgreementTemplateCondition[] { - return conditions - .map((condition) => { - if ( - DEPENDENCIES_RELEASE_CONDITION.includes(condition.name) && - SALES_SERVICES.includes(serviceType) - ) { - condition.timeout = fulfillAccessTimeout - condition.timelock = fulfillAccessTimelock - } - return condition - }) - .map((condition) => ({ - ...condition, - parameters: condition.parameters.map((parameter) => ({ - ...this.fillParameterWithDDO( - parameter, - assetPrice, - erc20TokenContract, - nftTokenContract, - nftHolder, - nftAmount, - nftTransfer, - duration, - ), - })), - })) - } - - /** - * If fills and get a ServiceAgreementTemplateParameter with the values of the DDO - * @param parameter parameter - * @param assetPrice AssetPrice object - * @param erc20TokenContract ERC20 contract address - * @param nftTokenContract NFT contract address - * @param nftHolder NFT Holder - * @param nftAmount Number of NFTs - * @param nftTransfer If is a NFT Transfer or a NFT mint - * @param duration Duration of the subscription - * @returns ServiceAgreementTemplateParameter - */ - fillParameterWithDDO( - parameter: ServiceAgreementTemplateParameter, - assetPrice: AssetPrice = new AssetPrice(), - erc20TokenContract?: string, - nftTokenContract?: string, - nftHolder?: string, - nftAmount: BigNumber = BigNumber.from(1), - nftTransfer = false, - duration = 0, - ): ServiceAgreementTemplateParameter { - const getValue = (name) => { - switch (name) { - case 'amounts': - return Array.from(assetPrice.getAmounts(), (v) => v.toString()) - case 'receivers': - return assetPrice.getReceivers() - case 'amount': - case 'price': - return String(assetPrice.getTotalPrice()) - case 'assetId': - case 'documentId': - case 'documentKeyId': - case 'did': - return this.shortId() - case 'rewardAddress': - return this.publicKey[0].owner - case 'numberNfts': - return String(nftAmount) - case 'tokenAddress': - return erc20TokenContract - case 'contract': - case 'contractAddress': - return nftTokenContract ? nftTokenContract : '' - case 'nftHolder': - return nftHolder ? nftHolder : '' - case 'nftTransfer': - return String(nftTransfer) - case 'duration': - return String(duration) - } - - return '' - } - const value = getValue(parameter.name.replace(/^_/, '')) - - return { ...parameter, value } - } } diff --git a/src/ddo/types.ts b/src/ddo/types.ts index 48268c6d9..bed8fa082 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -1,7 +1,7 @@ import { AaveConditionType, ServiceAaveCredit, TxParameters } from '../keeper' import { Account } from '../sdk' import { BigNumber } from 'ethers' -import { ERCType, NeverminedNFTType, AssetPrice, Babysig } from '../models' +import { ERCType, NeverminedNFTType, AssetPrice, Babysig, NFTAttributes } from '../models' export interface Authentication { type: string @@ -576,7 +576,7 @@ export interface ServiceCommon { } } -export type Priced = { +export type PricedMetadataInformation = { attributes: { main: { price: string @@ -611,7 +611,7 @@ export interface ServiceMetadata extends ServiceCommon { attributes: MetaData } -export interface ServiceAccess extends ServiceCommon, Priced { +export interface ServiceAccess extends ServiceCommon, PricedMetadataInformation { type: 'access' templateId?: string attributes: { @@ -630,7 +630,7 @@ export interface ServiceAccess extends ServiceCommon, Priced { } } -export interface ServiceCompute extends ServiceCommon, Priced { +export interface ServiceCompute extends ServiceCommon, PricedMetadataInformation { type: 'compute' templateId?: string attributes: { @@ -668,7 +668,7 @@ export interface ServiceNFTAccess extends ServiceCommon { } } -export interface ServiceNFTSales extends ServiceCommon, Priced { +export interface ServiceNFTSales extends ServiceCommon, PricedMetadataInformation { type: 'nft-sales' templateId?: string attributes: { @@ -727,10 +727,10 @@ export interface ServicePlugin { createService( publisher: Account, metadata: MetaData, + nftAttributes: NFTAttributes, assetPrice?: AssetPrice, - erc20TokenAddress?: string, - priced?: boolean, - ): Promise + pricedData?: PricedMetadataInformation, + ): T // Process agreement for provider process(params: ValidationParams, from: Account, txparams?: TxParameters): Promise // Check if service can be granted without agreement diff --git a/src/errors/DDOError.ts b/src/errors/DDOError.ts index e12dac822..81db084c8 100644 --- a/src/errors/DDOError.ts +++ b/src/errors/DDOError.ts @@ -20,6 +20,18 @@ export class DDOServiceNotFoundError extends DDOError { } } +export class DDOConditionNotFoundError extends DDOError { + constructor(conditionName: string) { + super(`Condition with name "${conditionName}" not found`) + } +} + +export class DDOParamNotFoundError extends DDOError { + constructor(conditionName: string, paramName?: string) { + super(`Parameter "${paramName}" not found on Condition with type "${conditionName}"`) + } +} + export class DDOPriceNotFoundError extends DDOError { constructor(serviceType: ServiceType, did?: string) { super(`Service with type "${serviceType}" is not priced.`, did) diff --git a/src/keeper/contracts/defi/AaveCreditTemplate.ts b/src/keeper/contracts/defi/AaveCreditTemplate.ts index 7f27e98bc..bfb32a572 100644 --- a/src/keeper/contracts/defi/AaveCreditTemplate.ts +++ b/src/keeper/contracts/defi/AaveCreditTemplate.ts @@ -90,7 +90,7 @@ export class AaveCreditTemplate extends BaseTemplate extends ContractBase { return agreementId } - public abstract getServiceAgreementTemplate(): Promise + public abstract getServiceAgreementTemplate(): ServiceAgreementTemplate - public async getServiceAgreementTemplateConditions() { - const serviceAgreementTemplate = await this.getServiceAgreementTemplate() + public getServiceAgreementTemplateConditions() { + const serviceAgreementTemplate = this.getServiceAgreementTemplate() return serviceAgreementTemplate.conditions } public async getServiceAgreementTemplateConditionByRef(ref: string) { - const name = (await this.getServiceAgreementTemplateConditions()).find( + const name = this.getServiceAgreementTemplateConditions().find( ({ name: conditionRef }) => conditionRef === ref, ).contractName return (await this.getConditions()).find((condition) => condition.contractName === name) } public async getServiceAgreementTemplateDependencies() { - const serviceAgreementTemplate = await this.getServiceAgreementTemplate() + const serviceAgreementTemplate = this.getServiceAgreementTemplate() return serviceAgreementTemplate.conditionDependency } diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 236d6d0a7..5793e6e81 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -1,17 +1,16 @@ import { AgreementTemplate } from './AgreementTemplate.abstract' -import { ZeroAddress, zeroX } from '../../../utils' +import { getConditionsByParams, zeroX } from '../../../utils' import { - Priced, + PricedMetadataInformation, Service, serviceIndex, ServicePlugin, ServiceType, ValidationParams, } from '../../../ddo' -import { Account, Condition, MetaData, AssetPrice } from '../../../sdk' +import { Account, Condition, MetaData, AssetPrice, NFTAttributes } from '../../../sdk' import { TxParameters } from '../ContractBase' import { ConditionInstance, ConditionState } from '../conditions' -import { BigNumber } from '../../../utils' export abstract class BaseTemplate extends AgreementTemplate @@ -31,45 +30,31 @@ export abstract class BaseTemplate return this.service() } - private async getPriced(assetPrice: AssetPrice, erc20TokenAddress: string): Promise { - let decimals: number - - if (erc20TokenAddress === ZeroAddress) { - decimals = 18 - } else { - const token = await this.nevermined.contracts.loadErc20(erc20TokenAddress) - decimals = await token.decimals() - } - - const price = assetPrice.getTotalPrice().toString() - const priceHighestDenomination = +BigNumber.formatUnits(assetPrice.getTotalPrice(), decimals) - return { - attributes: { - main: { - price, - }, - additionalInformation: { - priceHighestDenomination, - }, - }, - } - } - - public async createService( + public createService( publisher: Account, metadata: MetaData, + nftAttributes?: NFTAttributes, assetPrice?: AssetPrice, - erc20TokenAddress?: string, - priced = false, - ): Promise { - const serviceAgreementTemplate = await this.getServiceAgreementTemplate() - let priceData: Priced - - if (priced) { - priceData = await this.getPriced(assetPrice, erc20TokenAddress) - } + priceData?: PricedMetadataInformation, + ): S { + const serviceAgreementTemplate = this.getServiceAgreementTemplate() + const _conds = getConditionsByParams( + this.service(), + serviceAgreementTemplate.conditions, + publisher.getId(), + assetPrice, + assetPrice?.getTokenAddress() || this.nevermined.utils.token.getAddress(), + nftAttributes?.nftContractAddress, + publisher.getId(), + assetPrice.getTotalPrice(), + nftAttributes?.nftTransfer, + nftAttributes?.duration, + nftAttributes?.fulfillAccessTimeout, + nftAttributes?.fulfillAccessTimelock, + ) + serviceAgreementTemplate.conditions = _conds - const service = { + return { type: this.service(), index: serviceIndex[this.service()], serviceEndpoint: this.nevermined.services.node.getServiceEndpoint(this.serviceEndpoint()), @@ -88,7 +73,6 @@ export abstract class BaseTemplate serviceAgreementTemplate, }, } as S - return service } /** diff --git a/src/keeper/contracts/templates/DIDSalesTemplate.ts b/src/keeper/contracts/templates/DIDSalesTemplate.ts index b263d5a81..00d8596c5 100644 --- a/src/keeper/contracts/templates/DIDSalesTemplate.ts +++ b/src/keeper/contracts/templates/DIDSalesTemplate.ts @@ -87,7 +87,7 @@ export class DIDSalesTemplate extends BaseTemplate return AgreementTemplate.getInstance(config, 'DIDSalesTemplate', DIDSalesTemplate) } - public async getServiceAgreementTemplate(): Promise { + public getServiceAgreementTemplate(): ServiceAgreementTemplate { return didSalesTemplateServiceAgreementTemplate } } diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts index 010add50c..b7ede3aa1 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -87,7 +87,7 @@ export class EscrowComputeExecutionTemplate extends BaseTemplate< } } - public async getServiceAgreementTemplate() { + public getServiceAgreementTemplate() { return escrowComputeExecutionTemplateServiceAgreementTemplate } diff --git a/src/keeper/contracts/templates/NFT721AccessTemplate.ts b/src/keeper/contracts/templates/NFT721AccessTemplate.ts index 3c229cfa5..5c4eaabf4 100644 --- a/src/keeper/contracts/templates/NFT721AccessTemplate.ts +++ b/src/keeper/contracts/templates/NFT721AccessTemplate.ts @@ -75,7 +75,7 @@ export class NFT721AccessTemplate extends BaseTemplate< } } - public async getServiceAgreementTemplate(): Promise { + public getServiceAgreementTemplate(): ServiceAgreementTemplate { return nft721AccessTemplateServiceAgreementTemplate } diff --git a/src/keeper/contracts/templates/NFT721SalesTemplate.ts b/src/keeper/contracts/templates/NFT721SalesTemplate.ts index 446f23e8d..7c4e21b85 100644 --- a/src/keeper/contracts/templates/NFT721SalesTemplate.ts +++ b/src/keeper/contracts/templates/NFT721SalesTemplate.ts @@ -101,7 +101,7 @@ export class NFT721SalesTemplate extends BaseTemplate { + public getServiceAgreementTemplate(): ServiceAgreementTemplate { return nft721SalesTemplateServiceAgreementTemplate } } diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index 7c0e9ed7c..de524ad54 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -69,7 +69,7 @@ export class NFTAccessTemplate extends BaseTemplate { + public getServiceAgreementTemplate(): ServiceAgreementTemplate { return nftAccessTemplateServiceAgreementTemplate } diff --git a/src/keeper/contracts/templates/NFTSalesTemplate.ts b/src/keeper/contracts/templates/NFTSalesTemplate.ts index a8df0b16e..a228e6860 100644 --- a/src/keeper/contracts/templates/NFTSalesTemplate.ts +++ b/src/keeper/contracts/templates/NFTSalesTemplate.ts @@ -101,7 +101,7 @@ export class NFTSalesTemplate extends BaseTemplate { + public getServiceAgreementTemplate(): ServiceAgreementTemplate { return nftSalesTemplateServiceAgreementTemplate } } diff --git a/src/nevermined/AccessService.ts b/src/nevermined/AccessService.ts index ac6216671..17d24f467 100644 --- a/src/nevermined/AccessService.ts +++ b/src/nevermined/AccessService.ts @@ -6,6 +6,7 @@ import { ValidationParams, MetaData, MetaDataMain, + PricedMetadataInformation, } from '../ddo' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { @@ -17,7 +18,7 @@ import { NFTSalesTemplate, } from '../keeper' import { Account } from './Account' -import { AssetPrice } from '../models' +import { AssetPrice, NFTAttributes } from '../models' export interface AccessProofTemplateParams { type: 'access-proof' @@ -34,14 +35,16 @@ export class AccessService extends Instantiable implements ServicePlugin { - return this.normal.createService(publisher, metadata, assetPrice, erc20TokenAddress, true) + nftAttributes?: NFTAttributes, + assetPrice?: AssetPrice, + pricedData?: PricedMetadataInformation, + ): ServiceAccess { + return this.normal.createService(publisher, metadata, nftAttributes, assetPrice, pricedData) } + public async process( params: ValidationParams, from: Account, @@ -65,17 +68,20 @@ export class NFTAccessService extends Instantiable implements ServicePlugin { + nftAttributes?: NFTAttributes, + assetPrice?: AssetPrice, + pricedData?: PricedMetadataInformation, + ): ServiceNFTAccess { return this.select(metadata.main).createService( publisher, metadata, + nftAttributes, assetPrice, - erc20TokenAddress, + // erc20TokenAddress, + pricedData, ) } @@ -111,18 +117,20 @@ export class NFTSalesService extends Instantiable implements ServicePlugin { + nftAttributes?: NFTAttributes, + assetPrice?: AssetPrice, + pricedData?: PricedMetadataInformation, + ): ServiceNFTSales { return this.select(metadata.main).createService( publisher, metadata, + nftAttributes, assetPrice, - erc20TokenAddress, - true, + // erc20TokenAddress, + pricedData, ) } diff --git a/src/nevermined/api/AssetsApi.ts b/src/nevermined/api/AssetsApi.ts index 768d2a059..a75b5c0df 100644 --- a/src/nevermined/api/AssetsApi.ts +++ b/src/nevermined/api/AssetsApi.ts @@ -173,16 +173,18 @@ export class AssetsApi extends RegistryBaseApi { * If the access service to purchase is having associated some price, it will make the payment * for that service. * @param did - Unique identifier of the asset to order + * @param serviceReference - The service to order. By default is the access service, but it can be specified the service.index too * @param consumerAccount - The account of the user ordering the asset * @param txParams - Optional transaction parameters * @returns The agreement ID identifying the order */ public order( did: string, + serviceReference: ServiceType | number = 'access', consumerAccount: Account, txParams?: TxParameters, ): SubscribablePromise { - return this.orderAsset(did, 'access', consumerAccount, txParams) + return this.orderAsset(did, serviceReference, consumerAccount, txParams) } /** diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 3c4e94384..31181f6e3 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -3,14 +3,14 @@ import { ServicePlugin, ServiceType, NvmConfigVersions, - ServiceAgreementTemplate, DDO, MetaData, + PricedMetadataInformation, } from '../../ddo' -import { AssetAttributes, NFTAttributes } from '../../models' +import { AssetAttributes, AssetPrice, NFTAttributes } from '../../models' import { Account, CreateProgressStep, DID } from '../../nevermined' import { TxParameters, ServiceAaveCredit, DEFAULT_REGISTRATION_ACTIVITY_ID } from '../../keeper' -import { SubscribablePromise, zeroX, generateId, ZeroAddress } from '../../utils' +import { SubscribablePromise, zeroX, generateId, ZeroAddress, BigNumber } from '../../utils' import { PublishMetadata } from './AssetsApi' import { OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' import { AssetError } from '../../errors/AssetError' @@ -59,8 +59,6 @@ export abstract class RegistryBaseApi extends Instantiable { return new SubscribablePromise(async (observer) => { const { neverminedNodeUri } = this.config const { didRegistry } = this.nevermined.keeper - // const tokenAddress = - // assetAttributes.price.getTokenAddress() || this.nevermined.utils.token.getAddress() // create ddo itself const ddo = DDO.getInstance( @@ -81,7 +79,7 @@ export abstract class RegistryBaseApi extends Instantiable { } this.logger.debug('Adding Authorization Service') - await ddo.addService( + ddo.addService( DDO.createAuthorizationService( neverminedNodeUri, publicKey, @@ -90,27 +88,56 @@ export abstract class RegistryBaseApi extends Instantiable { ) this.logger.debug('Adding Metadata Service') - assetAttributes.metadata.main = await ddo.addDefaultMetadataService( + assetAttributes.metadata.main = ddo.addDefaultMetadataService( assetAttributes.metadata, nftAttributes, ) for (const serviceAttributes of assetAttributes.services) { const plugin = this.servicePlugin[serviceAttributes.serviceType] + if (plugin) { - await ddo.addService( - await plugin.createService( - publisher, - assetAttributes.metadata, - serviceAttributes.price, - serviceAttributes.price?.getTokenAddress() || - this.nevermined.utils.token.getAddress(), - serviceAttributes.price ? true : false, - ), + console.log( + `Generating service ${ + serviceAttributes.serviceType + } with price: ${serviceAttributes.price.toString()}}`, + ) + const pricedData = await this.getPriced(serviceAttributes.price) + + const serviceCreated = plugin.createService( + publisher, + assetAttributes.metadata, + nftAttributes, + serviceAttributes.price, + pricedData, + ) + + ddo.addService(serviceCreated) + + console.log( + `> Added service ${JSON.stringify( + ddo.service[ddo.service.length - 1].attributes.serviceAgreementTemplate.conditions[0], + )}`, ) + console.log(ddo.service.length) } } + console.log(`----- DDO Services: `) + console.log(JSON.stringify(ddo.service)) + console.log(`----- Step 1: `) + ddo.service + .filter((service) => service.type === 'access') + .forEach((service) => { + console.log(`1# Service ${service.type}`) + const cond = service.attributes.serviceAgreementTemplate.conditions[0] + cond.parameters + .filter((p) => p.name === '_amounts') + .map((c) => { + console.log(`Param ${c.name} with price: ${JSON.stringify(c.value)}`) + }) + }) + ddo.reorderServices() this.logger.log('Services Added') @@ -131,35 +158,68 @@ export abstract class RegistryBaseApi extends Instantiable { this.logger.log('Proof generated') observer.next(CreateProgressStep.ProofGenerated) - for (const serviceAttributes of assetAttributes.services) { - let service - if (serviceAttributes.serviceIndex) - service = ddo.findServiceById(serviceAttributes.serviceIndex) - else service = ddo.findServiceByType(serviceAttributes.serviceType) - const { - nftContractAddress, - amount, - nftTransfer, - duration, - fulfillAccessTimeout, - fulfillAccessTimelock, - } = nftAttributes || {} - const sat: ServiceAgreementTemplate = service.attributes.serviceAgreementTemplate - - sat.conditions = ddo.fillConditionsWithDDO( - serviceAttributes.serviceType, - sat.conditions, - serviceAttributes.price, - serviceAttributes.price?.getTokenAddress() || this.nevermined.utils.token.getAddress(), - nftContractAddress, - publisher.getId(), - amount, - nftTransfer, - duration, - fulfillAccessTimeout, - fulfillAccessTimelock, - ) - } + // ddo.service.map((service) => { + + // }) + + // ddo.service.map((service) => { + // const { + // nftContractAddress, + // nftTransfer, + // duration, + // fulfillAccessTimeout, + // fulfillAccessTimelock, + // } = nftAttributes || {} + // const sat: ServiceAgreementTemplate = service.attributes.serviceAgreementTemplate + + // sat.conditions = ddo.fillConditionsWithDDO( + // service.type, + // sat.conditions, + // serviceAttributes.price, + // serviceAttributes.price?.getTokenAddress() || this.nevermined.utils.token.getAddress(), + // nftContractAddress, + // publisher.getId(), + // serviceAttributes.price.getTotalPrice(), + // nftTransfer, + // duration, + // fulfillAccessTimeout, + // fulfillAccessTimelock, + // ) + // console.log(`SAT ${JSON.stringify(sat.conditions)}`) + // }) + // for (const serviceAttributes of assetAttributes.services) { + // let service + // if (serviceAttributes.serviceIndex) + // service = ddo.findServiceById(serviceAttributes.serviceIndex) + // else service = ddo.findServiceByType(serviceAttributes.serviceType) + + // console.log(`Service ${serviceAttributes.serviceType} with price: ${serviceAttributes.price.toString()}}`) + + // // const { + // // nftContractAddress, + // // nftTransfer, + // // duration, + // // fulfillAccessTimeout, + // // fulfillAccessTimelock, + // // } = nftAttributes || {} + // // const sat: ServiceAgreementTemplate = service.attributes.serviceAgreementTemplate + + // // sat.conditions = ddo.fillConditionsWithDDO( + // // serviceAttributes.serviceType, + // // sat.conditions, + // // serviceAttributes.price, + // // serviceAttributes.price?.getTokenAddress() || this.nevermined.utils.token.getAddress(), + // // nftContractAddress, + // // publisher.getId(), + // // serviceAttributes.price.getTotalPrice(), + // // nftTransfer, + // // duration, + // // fulfillAccessTimeout, + // // fulfillAccessTimelock, + // // ) + // // console.log(`SAT ${JSON.stringify(sat.conditions)}`) + + // } this.logger.log('Conditions filled') observer.next(CreateProgressStep.ConditionsFilled) @@ -190,6 +250,8 @@ export abstract class RegistryBaseApi extends Instantiable { let serviceEndpoint = this.nevermined.services.metadata.getServiceEndpoint(DID.parse(ddo.id)) + // console.log(`--- DDO Before Update Service: \n${JSON.stringify(ddo)}`) + ddo.updateService({ type: 'metadata', index: 0, @@ -216,6 +278,8 @@ export abstract class RegistryBaseApi extends Instantiable { }, } as Service) + // console.log(`--- DDO After: \n${JSON.stringify(ddo)}`) + this.logger.log('Files encrypted') observer.next(CreateProgressStep.FilesEncrypted) @@ -556,13 +620,13 @@ export abstract class RegistryBaseApi extends Instantiable { * Start the purchase/order of an asset's service. Starts by signing the service agreement * then sends the request to the publisher via the service endpoint (Node http service). * @param did - Decentralized ID. - * @param serviceType - Service. + * @param serviceReference - Service. * @param consumer - Consumer account. * @returns The agreement ID. */ public orderAsset( did: string, - serviceType: ServiceType, + serviceReference: ServiceType | number, consumer: Account, params?: TxParameters, ): SubscribablePromise { @@ -571,12 +635,19 @@ export abstract class RegistryBaseApi extends Instantiable { const ddo = await this.resolveAsset(did) const { keeper } = this.nevermined - const service = ddo.findServiceByType(serviceType) + + let service + if (typeof serviceReference === 'number') { + service = ddo.findServiceById(serviceReference) + } else { + service = ddo.findServiceByType(serviceReference) + } + const templateName = service.attributes.serviceAgreementTemplate.contractName const template = keeper.getAccessTemplateByName(templateName) - this.logger.log(`Creating ${serviceType} agreement and paying`) + this.logger.log(`Creating ${serviceReference} agreement and paying`) const agreementId = await template.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, @@ -589,7 +660,7 @@ export abstract class RegistryBaseApi extends Instantiable { ) if (!agreementId) { - throw new AssetError(`Error creating ${serviceType} agreement`) + throw new AssetError(`Error creating ${serviceReference} agreement`) } // Checking the agreementId was created on-chain with the correct DID associated to it @@ -624,4 +695,30 @@ export abstract class RegistryBaseApi extends Instantiable { .aaveCreditTemplate as ServicePlugin, } } + + private async getPriced(assetPrice: AssetPrice): Promise { + let decimals: number + const erc20TokenAddress = + assetPrice.getTokenAddress() || this.nevermined.utils.token.getAddress() + + if (erc20TokenAddress === ZeroAddress) { + decimals = 18 + } else { + const token = await this.nevermined.contracts.loadErc20(erc20TokenAddress) + decimals = await token.decimals() + } + + const price = assetPrice.getTotalPrice().toString() + const priceHighestDenomination = +BigNumber.formatUnits(assetPrice.getTotalPrice(), decimals) + return { + attributes: { + main: { + price, + }, + additionalInformation: { + priceHighestDenomination, + }, + }, + } + } } diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 4a19636d7..07ceffc5b 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -1,5 +1,5 @@ import { DDO, ServiceType } from '../../../ddo' -import { zeroX } from '../../../utils' +import { getConditionsByParams, zeroX } from '../../../utils' import { AssetPrice, Babysig, ERCType } from '../../../models' import { RoyaltyKind } from '../AssetsApi' import { Account } from '../../Account' @@ -231,22 +231,22 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { nftAmount: BigNumber, provider: string, token: Token, - owner: string, + owner: Account, ): Promise { const serviceType: ServiceType = 'nft-sales' const { nftSalesTemplate } = this.nevermined.keeper.templates const agreementIdSeed = zeroX(generateId()) - const nftSalesServiceAgreementTemplate = await nftSalesTemplate.getServiceAgreementTemplate() - const nftSalesTemplateConditions = - await nftSalesTemplate.getServiceAgreementTemplateConditions() + const nftSalesServiceAgreementTemplate = nftSalesTemplate.getServiceAgreementTemplate() + const nftSalesTemplateConditions = nftSalesTemplate.getServiceAgreementTemplateConditions() - nftSalesServiceAgreementTemplate.conditions = ddo.fillConditionsWithDDO( + nftSalesServiceAgreementTemplate.conditions = getConditionsByParams( serviceType, nftSalesTemplateConditions, + owner.getId(), assetPrice, token.getAddress(), undefined, - provider || owner, + provider || owner.getId(), nftAmount, ) diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index f8598bacf..c7d7dc414 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -16,56 +16,6 @@ const SALES_SERVICES = ['access', 'compute', 'nft-sales'] // Condition Names that are the final dependency for releasing the payment in a service agreement const DEPENDENCIES_RELEASE_CONDITION = ['access', 'serviceExecution', 'transferNFT'] -// @deprecated Use `DDO.fillParameterWithDDO` -function fillParameterWithDDO( - parameter: ServiceAgreementTemplateParameter, - ddo: DDO, - assetPrice: AssetPrice = new AssetPrice(), - erc20TokenContract?: string, - nftTokenContract?: string, - nftHolder?: string, - nftAmount: BigNumber = BigNumber.from(1), - nftTransfer = false, - duration = 0, -): ServiceAgreementTemplateParameter { - const getValue = (name) => { - switch (name) { - case 'amounts': - return Array.from(assetPrice.getAmounts(), (v) => v.toString()) - case 'receivers': - return assetPrice.getReceivers() - case 'amount': - case 'price': - return String(assetPrice.getTotalPrice()) - case 'assetId': - case 'documentId': - case 'documentKeyId': - case 'did': - return ddo.shortId() - case 'rewardAddress': - return ddo.publicKey[0].owner - case 'numberNfts': - return String(nftAmount) - case 'tokenAddress': - return erc20TokenContract - case 'contract': - case 'contractAddress': - return nftTokenContract ? nftTokenContract : '' - case 'nftHolder': - return nftHolder ? nftHolder : '' - case 'nftTransfer': - return String(nftTransfer) - case 'duration': - return String(duration) - } - - return '' - } - const value = getValue(parameter.name.replace(/^_/, '')) - - return { ...parameter, value } -} - /** * Fill some static parameters that depends on the metadata. * @@ -78,11 +28,10 @@ function fillParameterWithDDO( * * @returns Filled conditions. */ -// @deprecated Use `fillConditionsWithDDO` -export function fillConditionsWithDDO( +export function getConditionsByParams( serviceType: ServiceType, - conditions: ServiceAgreementTemplateCondition[], - ddo: DDO, + conditions: Readonly, + owner: string, assetPrice: AssetPrice = new AssetPrice(), erc20TokenContract?: string, nftTokenContract?: string, @@ -107,9 +56,9 @@ export function fillConditionsWithDDO( .map((condition) => ({ ...condition, parameters: condition.parameters.map((parameter) => ({ - ...fillParameterWithDDO( + ...getParameter( parameter, - ddo, + owner, assetPrice, erc20TokenContract, nftTokenContract, @@ -122,6 +71,50 @@ export function fillConditionsWithDDO( })) } +function getParameter( + parameter: ServiceAgreementTemplateParameter, + owner: string, + assetPrice: AssetPrice = new AssetPrice(), + erc20TokenContract?: string, + nftTokenContract?: string, + nftHolder?: string, + nftAmount: BigNumber = BigNumber.from(1), + nftTransfer = false, + duration = 0, +): ServiceAgreementTemplateParameter { + const getValue = (name) => { + switch (name) { + case 'amounts' || '_amounts': + return Array.from(assetPrice.getAmounts(), (v) => v.toString()) + case 'receivers': + return assetPrice.getReceivers() + case 'amount' || 'price': + return String(assetPrice.getTotalPrice()) + case 'assetId' || 'documentId' || 'documentKeyId' || 'did': + return '{DID}' + case 'rewardAddress': + return owner + case 'numberNfts': + return String(nftAmount) + case 'tokenAddress': + return erc20TokenContract + case 'contract' || 'contractAddress': + return nftTokenContract ? nftTokenContract : '' + case 'nftHolder': + return nftHolder ? nftHolder : '' + case 'nftTransfer': + return String(nftTransfer) + case 'duration': + return String(duration) + } + + return '' + } + const value = getValue(parameter.name.replace(/^_/, '')) + + return { ...parameter, value } +} + // @deprecated Use `DDO.findServiceConditionByName` instead export function findServiceConditionByName( service: Service, From 3dbc143fc6f914224e6a3f6efaba774d17a912f0 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 12 Jul 2023 13:04:52 +0200 Subject: [PATCH 009/151] feat: code compiles are migration to ethers v6 --- src/Instantiable.abstract.ts | 2 +- src/events/ContractEvent.ts | 2 +- src/keeper/ContractHandler.ts | 7 +- src/keeper/Keeper.ts | 8 +- src/keeper/Web3Provider.ts | 8 +- src/keeper/contracts/ContractBase.ts | 19 +++-- src/keeper/contracts/DIDRegistry.ts | 8 +- src/keeper/contracts/GenericContract.ts | 6 +- src/keeper/contracts/NFTContractsBase.ts | 8 +- .../conditions/Condition.abstract.ts | 4 +- .../conditions/EscrowPaymentCondition.ts | 2 +- .../conditions/LockPaymentCondition.ts | 2 +- .../contracts/defi/AaveCreditTemplate.ts | 12 +-- .../templates/AgreementTemplate.abstract.ts | 10 +-- .../templates/BaseTemplate.abstract.ts | 2 +- .../templates/NFT721AccessTemplate.ts | 2 +- .../contracts/templates/NFTAccessTemplate.ts | 2 +- src/keeper/utils.ts | 4 +- src/nevermined/Token.ts | 2 +- src/nevermined/api/AccountsApi.ts | 9 +-- src/nevermined/api/AssetsApi.ts | 4 +- src/nevermined/api/ConditionsApi.ts | 79 ++++++++++--------- src/nevermined/api/ProvenanceApi.ts | 8 +- src/nevermined/api/RegistryBaseApi.ts | 2 +- src/nevermined/api/nfts/NFT1155Api.ts | 21 +++-- src/nevermined/api/nfts/NFT721Api.ts | 30 +++---- src/nevermined/api/nfts/NFTsBaseApi.ts | 4 +- src/nevermined/api/nfts/PoapApi.ts | 6 +- src/nevermined/api/nfts/SoulBoundApi.ts | 6 +- src/nevermined/api/nfts/SubscriptionNFTApi.ts | 6 +- src/nevermined/utils/JwtUtils.ts | 20 ++--- src/nevermined/utils/ServiceAgreement.ts | 4 +- src/nevermined/utils/SignatureUtils.ts | 10 +-- src/services/aave/AaveCredit.ts | 20 ++--- src/utils/MakeAccounts.ts | 3 +- 35 files changed, 177 insertions(+), 165 deletions(-) diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index 184cdd281..bd31e7341 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -7,7 +7,7 @@ import { ethers } from 'ethers' export interface InstantiableConfig { nevermined: Nevermined config?: NeverminedOptions - web3?: ethers.JsonRpcProvider + web3?: ethers.JsonRpcProvider | ethers.BrowserProvider logger?: Logger artifactsFolder?: string circuitsFolder?: string diff --git a/src/events/ContractEvent.ts b/src/events/ContractEvent.ts index 796fe04a8..d745118d7 100644 --- a/src/events/ContractEvent.ts +++ b/src/events/ContractEvent.ts @@ -9,7 +9,7 @@ export class ContractEvent extends NeverminedEvent { contract: ContractBase, eventEmitter: EventEmitter, nevermined: Nevermined, - web3: ethers.JsonRpcProvider, + web3: ethers.JsonRpcProvider | ethers.BrowserProvider, ): ContractEvent { const instance = new ContractEvent(contract, eventEmitter) instance.setInstanceConfig({ diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index 864d3200a..90cf3ecae 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -3,7 +3,7 @@ import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { KeeperError } from '../errors/KeeperError' import { ApiError } from '../errors/ApiError' import { Account } from '../nevermined' -import { ContractTransactionResponse, TransactionReceipt, ethers } from 'ethers' +import { ContractTransactionReceipt, ContractTransactionResponse, ethers } from 'ethers' let fetch if (typeof window !== 'undefined') { @@ -152,7 +152,8 @@ export class ContractHandler extends Instantiable { methodSignature ](...args, extraParams) - const transactionReceipt: TransactionReceipt = await contractTransactionResponse.wait() + const transactionReceipt: ContractTransactionReceipt = + await contractTransactionResponse.wait() if (transactionReceipt.status !== 1) { throw new Error(`Error deploying contract ${artifact.name}`) } @@ -197,7 +198,7 @@ export class ContractHandler extends Instantiable { * @returns {@link true} if the contract exists. */ public async checkExists(address: string): Promise { - const storage = await this.web3.getStorageAt(address, 0) + const storage = await this.web3.getStorage(address, 0) // check if storage is 0x0 at position 0, this is the case most of the cases if (storage === '0x0000000000000000000000000000000000000000000000000000000000000000') { // if the storage is empty, check if there is no code for this contract, diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index ec979e6e0..41969a380 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -351,7 +351,7 @@ export class Keeper extends Instantiable { * @returns Condition instance. */ public getConditionByAddress(address: string): ConditionSmall { - return this.conditionsList.find((condition) => condition.getAddress() === address) + return this.conditionsList.find(async (condition) => (await condition.getAddress()) === address) } /** @@ -378,7 +378,9 @@ export class Keeper extends Instantiable { * @returns Agreement template instance. */ public getTemplateByAddress(address: string) { - return Object.values(this.templates).find((template) => template.getAddress() === address) + return Object.values(this.templates).find( + async (template) => (await template.getAddress()) === address, + ) } /** @@ -396,7 +398,7 @@ export class Keeper extends Instantiable { public async getNetworkId(): Promise { if (this.network.loading) { this.network.loading = false - this.network.id = (await this.web3.getNetwork()).chainId + this.network.id = Number((await this.web3.getNetwork()).chainId) } while (!this.network.id) { diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index e0c51cddd..cedce4ec3 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -7,11 +7,13 @@ export class Web3Provider { * * @returns web3 instance */ - public static getWeb3(config: Partial = {}): ethers.providers.JsonRpcProvider { + public static getWeb3( + config: Partial = {}, + ): ethers.JsonRpcProvider | ethers.BrowserProvider { if (config.web3Provider) { - return new ethers.providers.Web3Provider(config.web3Provider) + return new ethers.BrowserProvider(config.web3Provider) } - return new ethers.providers.JsonRpcProvider(config.web3ProviderUri) + return new ethers.JsonRpcProvider(config.web3ProviderUri) } } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index c8e66597e..18a12d2e5 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -2,7 +2,7 @@ import { Account } from '../../nevermined' import { ContractEvent, EventHandler, SubgraphEvent } from '../../events' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { KeeperError } from '../../errors' -import { ContractTransactionResponse, TransactionReceipt, ethers } from 'ethers' +import { ContractTransactionReceipt, ContractTransactionResponse, ethers } from 'ethers' import { parseUnits } from '../../sdk' export interface TxParameters { value?: string @@ -17,14 +17,11 @@ export interface TxParameters { } export abstract class ContractBase extends Instantiable { - public contractName: string + public readonly contractName: string public contract: ethers.BaseContract = null public events: ContractEvent | SubgraphEvent = null public version: string - - get address() { - return this.getAddress() - } + public address: string constructor(contractName: string) { super() @@ -56,6 +53,8 @@ export abstract class ContractBase extends Instantiable { optional, config.artifactsFolder, ) + this.address = await this.contract.getAddress() + try { this.version = await this.nevermined.utils.contractHandler.getVersion( this.contractName, @@ -91,7 +90,7 @@ export abstract class ContractBase extends Instantiable { args: any[], from?: Account, value?: TxParameters, - ): Promise { + ): Promise { const fromAddress = await this.getFromAddress(from && from.getId()) const receipt = await this.send(name, fromAddress, args, value) if (!receipt.status) { @@ -107,7 +106,7 @@ export abstract class ContractBase extends Instantiable { txparams: any, contract: ethers.BaseContract, progress: (data: any) => void, - ): Promise { + ): Promise { // Uncomment to debug contract calls //console.debug(`Making contract call ....: ${name} - ${from} - ${JSON.stringify(args)}`) const methodSignature = this.getSignatureOfMethod(name, args) @@ -144,7 +143,7 @@ export abstract class ContractBase extends Instantiable { }) } - const transactionReceipt: TransactionReceipt = await transactionResponse.wait() + const transactionReceipt: ContractTransactionReceipt = await transactionResponse.wait() if (progress) { progress({ stage: 'receipt', @@ -167,7 +166,7 @@ export abstract class ContractBase extends Instantiable { from: string, args: any[], params: TxParameters = {}, - ): Promise { + ): Promise { if (params.signer) { const paramsFixed = { ...params, signer: undefined } const contract = this.contract.connect(params.signer) diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index b081bfd22..32d10cf11 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -1,7 +1,7 @@ import ContractBase, { TxParameters as txParams } from './ContractBase' import { zeroX, didPrefixed, didZeroX, eventToObject, ZeroAddress } from '../../utils' import { InstantiableConfig } from '../../Instantiable.abstract' -import { ContractReceipt, ethers } from 'ethers' +import { ContractTransactionReceipt, ethers } from 'ethers' import { NFTAttributes } from '../../models' import { AssetError } from '../../errors/AssetError' import { @@ -117,7 +117,7 @@ export class DIDRegistry extends ContractBase { ? String(nftAttributes.royaltyAttributes?.amount) : '0', nftAttributes.preMint, - ethers.utils.hexZeroPad(zeroX(activityId), 32), + ethers.zeroPadValue(zeroX(activityId), 32), nftAttributes.nftMetadataUrl || '', immutableUrl, ], @@ -164,7 +164,7 @@ export class DIDRegistry extends ContractBase { ? String(nftAttributes.royaltyAttributes?.amount) : '0', nftAttributes.preMint, - ethers.utils.hexZeroPad(zeroX(activityId), 32), + ethers.zeroPadValue(zeroX(activityId), 32), immutableUrl, ], txParams, @@ -362,7 +362,7 @@ export class DIDRegistry extends ContractBase { newOwnerAddress: string, ownerAddress: string, params?: txParams, - ): Promise { + ): Promise { return this.send( 'transferDIDOwnership', ownerAddress, diff --git a/src/keeper/contracts/GenericContract.ts b/src/keeper/contracts/GenericContract.ts index 839d0363c..003354a47 100644 --- a/src/keeper/contracts/GenericContract.ts +++ b/src/keeper/contracts/GenericContract.ts @@ -1,6 +1,6 @@ import ContractBase, { TxParameters } from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' -import { ContractReceipt, ethers } from 'ethers' +import { ContractTransactionReceipt, ethers } from 'ethers' export class GenericContract extends ContractBase { protected fixedAddress: string @@ -40,11 +40,11 @@ export class GenericContract extends ContractBase { from: string, args: any[], params: TxParameters = {}, - ): Promise { + ): Promise { return super.send(name, from, args, params) } - public getContract(): ethers.Contract { + public getContract(): ethers.BaseContract { return this.contract } } diff --git a/src/keeper/contracts/NFTContractsBase.ts b/src/keeper/contracts/NFTContractsBase.ts index 8d7209354..694a3d804 100644 --- a/src/keeper/contracts/NFTContractsBase.ts +++ b/src/keeper/contracts/NFTContractsBase.ts @@ -1,7 +1,7 @@ import ContractBase, { TxParameters } from './ContractBase' import { didZeroX, zeroX } from '../../utils' import { Account } from '../../nevermined' -import { ContractReceipt } from 'ethers' +import { ContractTransactionReceipt, EventLog } from 'ethers' import { KeeperError } from '../../errors' export class NFTContractsBase extends ContractBase { @@ -35,13 +35,15 @@ export class NFTContractsBase extends ContractBase { txParams?: TxParameters, ) { try { - const contractReceipt: ContractReceipt = await this.sendFrom( + const contractReceipt: ContractTransactionReceipt = await this.sendFrom( 'createClone', cap ? [name, symbol, uri, String(cap), operators] : [name, symbol, uri, operators], from, txParams, ) - const event = contractReceipt.events.find((e) => e.event === 'NFTCloned') + const event = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'NFTCloned', + ) as EventLog return event.args._newAddress } catch (error) { throw new KeeperError(`Unable to clone contract: ${(error as Error).message}`) diff --git a/src/keeper/contracts/conditions/Condition.abstract.ts b/src/keeper/contracts/conditions/Condition.abstract.ts index eadf46796..7c90bf8d2 100644 --- a/src/keeper/contracts/conditions/Condition.abstract.ts +++ b/src/keeper/contracts/conditions/Condition.abstract.ts @@ -4,7 +4,7 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { Account } from '../../../nevermined' import { AssetPrice } from '../../../models' import { Service, DDO } from '../../../ddo' -import { ContractReceipt } from 'ethers' +import { ContractTransactionReceipt } from 'ethers' export enum ConditionState { Uninitialized = 0, @@ -168,7 +168,7 @@ export abstract class Condition< additionalParams: Extra, from?: Account, txParams?: TxParameters, - ): Promise + ): Promise public async instance( agreementId: string, diff --git a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts index 64c4f6517..0f72de22e 100644 --- a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts +++ b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts @@ -49,7 +49,7 @@ export class EscrowPaymentCondition extends ProviderCondition p.name === '_tokenAddress').value as string, lock.id, access.id, diff --git a/src/keeper/contracts/conditions/LockPaymentCondition.ts b/src/keeper/contracts/conditions/LockPaymentCondition.ts index 4b0f1f338..114c90f1b 100644 --- a/src/keeper/contracts/conditions/LockPaymentCondition.ts +++ b/src/keeper/contracts/conditions/LockPaymentCondition.ts @@ -31,7 +31,7 @@ export class LockPaymentCondition extends ConsumerCondition { const payment = findServiceConditionByName(service, 'lockPayment') return this.params( ddo.shortId(), - this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), + await this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), payment.parameters.find((p) => p.name === '_tokenAddress').value as string, rewards.getAmounts(), rewards.getReceivers(), diff --git a/src/keeper/contracts/defi/AaveCreditTemplate.ts b/src/keeper/contracts/defi/AaveCreditTemplate.ts index bfefd6ca1..fab7fc515 100644 --- a/src/keeper/contracts/defi/AaveCreditTemplate.ts +++ b/src/keeper/contracts/defi/AaveCreditTemplate.ts @@ -8,7 +8,7 @@ import { AaveConfig } from '../../../models' import { TxParameters } from '../ContractBase' import { aaveCreditTemplateServiceAgreementTemplate } from './AaveCreditTemplate.serviceAgreementTemplate' import { ServiceType, ValidationParams } from '../../../ddo' -import { ContractReceipt } from 'ethers' +import { ContractTransactionReceipt, EventLog } from 'ethers' import { AaveBorrowCondition, AaveCollateralDepositCondition, @@ -108,7 +108,7 @@ export class AaveCreditTemplate extends BaseTemplate]> { + ): Promise<[ContractTransactionReceipt, AgreementInstance]> { const _collateralAmount = parseEther(collateralAmount.toString()) const _delegatedAmount = parseEther(delegatedAmount.toString()) @@ -162,7 +162,7 @@ export class AaveCreditTemplate extends BaseTemplate]> { + ): Promise<[ContractTransactionReceipt, string, AgreementInstance]> { const vaultAddress = await this.deployVault( this.aaveConfig.lendingPoolAddress, this.aaveConfig.dataProviderAddress, @@ -208,7 +208,7 @@ export class AaveCreditTemplate extends BaseTemplate { - const contractReceipt: ContractReceipt = await this.send('deployVault', from, [ + const contractReceipt: ContractTransactionReceipt = await this.send('deployVault', from, [ lendingPool, dataProvider, weth, @@ -217,7 +217,9 @@ export class AaveCreditTemplate extends BaseTemplate e.event === 'VaultCreated') + const vaultCreatedEvent = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'VaultCreated', + ) as EventLog const { _vaultAddress } = vaultCreatedEvent.args return _vaultAddress } diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index 26e0a897b..b24997e18 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -81,12 +81,12 @@ export abstract class AgreementTemplate extends ContractBase { return 1 } - public paymentData(service: Service): PaymentData { + public async paymentData(service: Service): Promise { const assetPrice = getAssetPriceFromService(service) const payment = findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') return { - rewardAddress: this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), + rewardAddress: await this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), tokenAddress: payment.parameters.find((p) => p.name === '_tokenAddress').value as string, amounts: assetPrice.getAmounts(), receivers: assetPrice.getReceivers(), @@ -253,7 +253,6 @@ export abstract class AgreementTemplate extends ContractBase { parameters: Params, consumer: Account, from: Account, - timeOuts?: number[], txParams?: TxParameters, observer?: (OrderProgressStep) => void, ): Promise { @@ -271,7 +270,8 @@ export abstract class AgreementTemplate extends ContractBase { const assetPrice = getAssetPriceFromService(service) const payment = findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') - const rewardAddress = this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress() + const rewardAddress = + await this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress() const tokenAddress = payment.parameters.find((p) => p.name === '_tokenAddress').value as string const amounts = assetPrice.getAmounts() const receivers = assetPrice.getReceivers() @@ -413,7 +413,7 @@ export abstract class AgreementTemplate extends ContractBase { if (token) { this.logger.debug('Approving tokens', totalAmount) - await token.approve(lockPaymentCondition.getAddress(), totalAmount, from, txParams) + await token.approve(await lockPaymentCondition.getAddress(), totalAmount, from, txParams) } } diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index c9b1f3e16..e755f6590 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -72,7 +72,7 @@ export abstract class BaseTemplate type: this.service(), index: serviceIndex[this.service()], serviceEndpoint: this.nevermined.services.node.getServiceEndpoint(this.serviceEndpoint()), - templateId: this.getAddress(), + templateId: await this.getAddress(), attributes: { main: { creator: publisher.getId(), diff --git a/src/keeper/contracts/templates/NFT721AccessTemplate.ts b/src/keeper/contracts/templates/NFT721AccessTemplate.ts index 3c229cfa5..3696520be 100644 --- a/src/keeper/contracts/templates/NFT721AccessTemplate.ts +++ b/src/keeper/contracts/templates/NFT721AccessTemplate.ts @@ -94,6 +94,6 @@ export class NFT721AccessTemplate extends BaseTemplate< this.nevermined.keeper.conditions.nft721HolderCondition.nftContractFromService(service) const nftContract = await this.nevermined.contracts.loadNft721(contractAddress) - return (await nftContract.balanceOf(new Account(params.consumer_address))).gt(0) + return (await nftContract.balanceOf(new Account(params.consumer_address))) > 0n } } diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index 705456fcb..a8964f3d8 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -91,6 +91,6 @@ export class NFTAccessTemplate extends BaseTemplate= limit } } diff --git a/src/keeper/utils.ts b/src/keeper/utils.ts index a60f0c92b..035c9b48f 100644 --- a/src/keeper/utils.ts +++ b/src/keeper/utils.ts @@ -76,8 +76,8 @@ export interface JsonRpcResponse { } export class Web3ProviderWrapper { - provider: ethers.providers.JsonRpcProvider - constructor(provider: ethers.providers.JsonRpcProvider) { + provider: ethers.JsonRpcProvider + constructor(provider: ethers.JsonRpcProvider) { this.provider = provider } send( diff --git a/src/nevermined/Token.ts b/src/nevermined/Token.ts index e5073a32b..9b8131af8 100644 --- a/src/nevermined/Token.ts +++ b/src/nevermined/Token.ts @@ -27,7 +27,7 @@ export class TokenUtils extends Instantiable { return await this.nevermined.keeper.token.symbol() } - public getAddress(): string { + public async getAddress(): Promise { return this.nevermined.keeper.token.getAddress() } diff --git a/src/nevermined/api/AccountsApi.ts b/src/nevermined/api/AccountsApi.ts index 4c876f13e..ca6ae138c 100644 --- a/src/nevermined/api/AccountsApi.ts +++ b/src/nevermined/api/AccountsApi.ts @@ -88,13 +88,6 @@ export class AccountsApi extends Instantiable { } public async addresses(): Promise { - let ethAccounts: string[] = [] - try { - ethAccounts = await this.web3.listAccounts() - } catch (e) { - // ignore - } - const addresses = await Promise.all((this.config.accounts || []).map((a) => a.getAddress())) - return addresses.concat(ethAccounts) + return await Promise.all((this.config.accounts || []).map((a) => a.getAddress())) } } diff --git a/src/nevermined/api/AssetsApi.ts b/src/nevermined/api/AssetsApi.ts index c3892359f..b050aafef 100644 --- a/src/nevermined/api/AssetsApi.ts +++ b/src/nevermined/api/AssetsApi.ts @@ -5,7 +5,7 @@ import { InstantiableConfig } from '../../Instantiable.abstract' import { TxParameters, RoyaltyScheme } from '../../keeper' import { AssetError, DDOError } from '../../errors' import { Nevermined } from '../../sdk' -import { ContractReceipt } from 'ethers' +import { ContractTransactionReceipt } from 'ethers' import { DIDResolvePolicy, RegistryBaseApi } from './RegistryBaseApi' import { CreateProgressStep, OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' import { Providers } from '../Provider' @@ -292,7 +292,7 @@ export class AssetsApi extends RegistryBaseApi { newOwner: string, owner: string | Account, txParams?: TxParameters, - ): Promise { + ): Promise { // const owner = await this.nevermined.assets.owner(did) const ownerAddress = owner instanceof Account ? owner.getId() : owner return this.nevermined.keeper.didRegistry.transferDIDOwnership( diff --git a/src/nevermined/api/ConditionsApi.ts b/src/nevermined/api/ConditionsApi.ts index 0fd08a23c..b1122468e 100644 --- a/src/nevermined/api/ConditionsApi.ts +++ b/src/nevermined/api/ConditionsApi.ts @@ -5,7 +5,7 @@ import { findServiceConditionByName, ZeroAddress } from '../../utils' import { Token, CustomToken, TxParameters as txParams } from '../../keeper' import { AssetPrice } from '../../models' import { KeeperError } from '../../errors/KeeperError' -import { ContractReceipt } from 'ethers' +import { ContractTransactionReceipt, EventLog } from 'ethers' /** * Nevermined Conditions API. It the interaction with the Smart Contracts building the conditions attached @@ -66,14 +66,14 @@ export class ConditionsApi extends Instantiable { if (token) { this.logger.debug('Approving tokens', totalAmount) - await token.approve(lockPaymentCondition.getAddress(), totalAmount, from, txParams) + await token.approve(await lockPaymentCondition.getAddress(), totalAmount, from, txParams) } - const contractReceipt: ContractReceipt = await lockPaymentCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await lockPaymentCondition.fulfill( agreementId, did, - escrowPaymentCondition.getAddress(), - token ? token.getAddress() : erc20TokenAddress, + await escrowPaymentCondition.getAddress(), + token ? await token.getAddress() : erc20TokenAddress, amounts, receivers, from, @@ -107,7 +107,7 @@ export class ConditionsApi extends Instantiable { try { const { accessCondition } = this.nevermined.keeper.conditions - const contractReceipt: ContractReceipt = await accessCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await accessCondition.fulfill( agreementId, did, grantee, @@ -138,7 +138,7 @@ export class ConditionsApi extends Instantiable { try { const { computeExecutionCondition } = this.nevermined.keeper.conditions - const contractReceipt: ContractReceipt = await computeExecutionCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await computeExecutionCondition.fulfill( agreementId, did, grantee, @@ -199,14 +199,14 @@ export class ConditionsApi extends Instantiable { agreementId, ) storedAgreement.conditionIds - const contractReceipt: ContractReceipt = await escrowPaymentCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await escrowPaymentCondition.fulfill( agreementId, did, amounts, receivers, returnAddress, - escrowPaymentCondition.getAddress(), - token ? token.getAddress() : erc20TokenAddress, + await escrowPaymentCondition.getAddress(), + token ? await token.getAddress() : erc20TokenAddress, storedAgreement.conditionIds[1], storedAgreement.conditionIds[0], from, @@ -246,12 +246,13 @@ export class ConditionsApi extends Instantiable { ) const { escrowPaymentCondition } = this.nevermined.keeper.conditions - const contractReceipt: ContractReceipt = await escrowPaymentCondition.fulfillInstance( - instance.instances[2] as any, - {}, - from || publisher, - txParams, - ) + const contractReceipt: ContractTransactionReceipt = + await escrowPaymentCondition.fulfillInstance( + instance.instances[2] as any, + {}, + from || publisher, + txParams, + ) if (!this.isFulfilled(contractReceipt)) { this.logger.error('Failed to fulfill escrowPaymentCondition', contractReceipt) @@ -286,12 +287,13 @@ export class ConditionsApi extends Instantiable { ) const { escrowPaymentCondition } = this.nevermined.keeper.conditions - const contractReceipt: ContractReceipt = await escrowPaymentCondition.fulfillInstance( - instance.instances[2] as any, - {}, - from || publisher, - txParams, - ) + const contractReceipt: ContractTransactionReceipt = + await escrowPaymentCondition.fulfillInstance( + instance.instances[2] as any, + {}, + from || publisher, + txParams, + ) if (!this.isFulfilled(contractReceipt)) { this.logger.error('Failed to fulfill escrowPaymentCondition', contractReceipt) @@ -321,8 +323,8 @@ export class ConditionsApi extends Instantiable { params?: txParams, ) { const { nftHolderCondition } = this.nevermined.keeper.conditions - - const contractReceipt: ContractReceipt = await nftHolderCondition.fulfill( + ContractTransactionReceipt + const contractReceipt: ContractTransactionReceipt = await nftHolderCondition.fulfill( agreementId, did, holder, @@ -355,8 +357,8 @@ export class ConditionsApi extends Instantiable { const accessService = ddo.findServiceByType('nft-access') const holder = findServiceConditionByName(accessService, 'nftHolder') - - const contractReceipt: ContractReceipt = await nft721HolderCondition.fulfill( + ContractTransactionReceipt + const contractReceipt: ContractTransactionReceipt = await nft721HolderCondition.fulfill( agreementId, ddo.shortId(), holderAddress, @@ -385,8 +387,8 @@ export class ConditionsApi extends Instantiable { params?: txParams, ) { const { nftAccessCondition } = this.nevermined.keeper.conditions - - const contractReceipt: ContractReceipt = await nftAccessCondition.fulfill( + ContractTransactionReceipt + const contractReceipt: ContractTransactionReceipt = await nftAccessCondition.fulfill( agreementId, did, grantee, @@ -424,7 +426,7 @@ export class ConditionsApi extends Instantiable { template.params(accessConsumer, nftAmount), ) - const contractReceipt: ContractReceipt = await transferNftCondition.fulfillInstance( + const contractReceipt: ContractTransactionReceipt = await transferNftCondition.fulfillInstance( instance.instances[1] as any, {}, from, @@ -463,7 +465,7 @@ export class ConditionsApi extends Instantiable { ) const [did, nftHolder, nftReceiver, _nftAmount, lockPaymentCondition, , transferAsset] = instance.instances[1].list - const contractReceipt: ContractReceipt = await transferNftCondition.fulfillPlain( + const contractReceipt: ContractTransactionReceipt = await transferNftCondition.fulfillPlain( agreementId, [did, nftHolder, nftReceiver, _nftAmount, lockPaymentCondition, transferAsset], from, @@ -504,19 +506,20 @@ export class ConditionsApi extends Instantiable { await nft.setApprovalForAll(transferNft721Condition.address, true, publisher, txParams) - const contractReceipt: ContractReceipt = await transferNft721Condition.fulfillInstance( - instance.instances[1] as any, - {}, - publisher, - txParams, - ) + const contractReceipt: ContractTransactionReceipt = + await transferNft721Condition.fulfillInstance( + instance.instances[1] as any, + {}, + publisher, + txParams, + ) await nft.setApprovalForAll(transferNft721Condition.address, false, publisher, txParams) return this.isFulfilled(contractReceipt) } - private isFulfilled(contractReceipt: ContractReceipt): boolean { - return contractReceipt.events.some((e) => e.event === 'Fulfilled') + private isFulfilled(contractReceipt: ContractTransactionReceipt): boolean { + return contractReceipt.logs.some((e: EventLog) => e.eventName === 'Fulfilled') } } diff --git a/src/nevermined/api/ProvenanceApi.ts b/src/nevermined/api/ProvenanceApi.ts index e4c48a8b6..8b6ab5653 100644 --- a/src/nevermined/api/ProvenanceApi.ts +++ b/src/nevermined/api/ProvenanceApi.ts @@ -55,7 +55,7 @@ export class ProvenanceApi extends Instantiable { provenanceId, did, agentId, - ethers.utils.hexZeroPad(zeroX(activityId), 32), + ethers.zeroPadValue(zeroX(activityId), 32), signature, attributes, from.getId(), @@ -91,7 +91,7 @@ export class ProvenanceApi extends Instantiable { newEntityDid, usedEntityDid, agentId, - ethers.utils.hexZeroPad(zeroX(activityId), 32), + ethers.zeroPadValue(zeroX(activityId), 32), attributes, from.getId(), txParams, @@ -123,7 +123,7 @@ export class ProvenanceApi extends Instantiable { provenanceId, did, agentId, - ethers.utils.hexZeroPad(zeroX(activityId), 32), + ethers.zeroPadValue(zeroX(activityId), 32), attributes, from.getId(), txParams, @@ -160,7 +160,7 @@ export class ProvenanceApi extends Instantiable { did, delegateAgentId, responsibleAgentId, - ethers.utils.hexZeroPad(zeroX(activityId), 32), + ethers.zeroPadValue(zeroX(activityId), 32), signature, attributes, from.getId(), diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index fe3a38b2f..40d77e62f 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -66,7 +66,7 @@ export abstract class RegistryBaseApi extends Instantiable { const { neverminedNodeUri } = this.config const { didRegistry } = this.nevermined.keeper const tokenAddress = - assetAttributes.price.getTokenAddress() || this.nevermined.utils.token.getAddress() + assetAttributes.price.getTokenAddress() || (await this.nevermined.utils.token.getAddress()) // create ddo itself const ddo = DDO.getInstance( diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index 0f4866479..21f6fb255 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -13,7 +13,7 @@ import { TxParameters, Nft1155Contract } from '../../../keeper' import { DDO } from '../../../ddo' import { NFTError } from '../../../errors' import { NFTsBaseApi } from './NFTsBaseApi' -import { ContractReceipt } from 'ethers' +import { ContractTransactionReceipt } from 'ethers' import { CreateProgressStep, OrderProgressStep } from '../../ProgressSteps' /** @@ -72,7 +72,7 @@ export class NFT1155Api extends NFTsBaseApi { } /** - * Creates a new Nevermined asset associted to a NFT (ERC-1155). + * Creates a new Nevermined asset associated to a NFT (ERC-1155). * * @example * ```ts @@ -139,7 +139,7 @@ export class NFT1155Api extends NFTsBaseApi { * @param data - Data * @param txParams - Optional transaction parameters. * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async mint( did: string, @@ -179,7 +179,7 @@ export class NFT1155Api extends NFTsBaseApi { * @param account - The account of the publisher of the NFT. * @param txParams - Optional transaction parameters. * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async burn(did: string, nftAmount: bigint, account: Account, txParams?: TxParameters) { return await this.nftContract.burn(account.getId(), did, nftAmount, txParams) @@ -225,7 +225,6 @@ export class NFT1155Api extends NFTsBaseApi { nftSalesTemplate.params(consumer.getId(), numberEditions), consumer, consumer, - undefined, txParams, (a) => observer.next(a), ) @@ -438,14 +437,14 @@ export class NFT1155Api extends NFTsBaseApi { * @param from - The account that wants to give transfer rights to the operator. * @param txParams - Transaction additional parameters * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceiptnReceiptnReceipt} */ public async setApprovalForAll( operatorAddress: string, approved: boolean, from: Account, txParams?: TxParameters, - ): Promise { + ): Promise { const isApproved = await this.nftContract.isApprovedForAll(from.getId(), operatorAddress) if (isApproved) { @@ -546,13 +545,13 @@ export class NFT1155Api extends NFTsBaseApi { * @param from - The account giving operator permissions * @param txParams - Optional transaction parameters. * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async grantOperatorRole( operatorAddress: string, from?: Account, txParams?: TxParameters, - ): Promise { + ): Promise { return this.nftContract.grantOperatorRole(operatorAddress, from, txParams) } @@ -572,13 +571,13 @@ export class NFT1155Api extends NFTsBaseApi { * @param from - The account revoking operator permissions * @param txParams - Optional transaction parameters. * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async revokeOperatorRole( operatorAddress: string, from?: Account, txParams?: TxParameters, - ): Promise { + ): Promise { return this.nftContract.revokeOperatorRole(operatorAddress, from, txParams) } diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index e9cb41180..9b2b5f58d 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -6,7 +6,7 @@ import { Account } from '../../Account' import { Nft721Contract, TxParameters } from '../../../keeper' import { PublishMetadata } from '../AssetsApi' import { NFTError } from '../../../errors/NFTError' -import { ContractReceipt, ethers } from 'ethers' +import { ContractTransactionReceipt, ethers } from 'ethers' import { NFTsBaseApi } from './NFTsBaseApi' import { CreateProgressStep, OrderProgressStep } from '../../ProgressSteps' import { SubscriptionToken } from '../../../services' @@ -142,7 +142,6 @@ export class NFT721Api extends NFTsBaseApi { nft721SalesTemplate.params(consumer.getId()), consumer, consumer, - undefined, txParams, (a) => observer.next(a), ) @@ -292,13 +291,13 @@ export class NFT721Api extends NFTsBaseApi { * @param did - The Decentralized Identifier of the NFT asset. * @param publisher - The account of the minter * @param txParams - Optional transaction parameters. - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async mint( did: string, publisher: Account, txParams?: TxParameters, - ): Promise { + ): Promise { return await this.nftContract.mint(did, publisher.getId(), txParams) } @@ -320,7 +319,7 @@ export class NFT721Api extends NFTsBaseApi { * @param account - The account of the publisher of the NFT. * @param txParams - Optional transaction parameters. * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async burn(tokenId: string, account: Account, txParams?: TxParameters) { return await this.nftContract.burn(tokenId, account, txParams) @@ -340,7 +339,7 @@ export class NFT721Api extends NFTsBaseApi { * @param url - The URL with NFT metadata * @param from - The account of the minter * @param txParams - Optional transaction parameters. - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async mintWithURL( to: string, @@ -348,7 +347,7 @@ export class NFT721Api extends NFTsBaseApi { url: string, from?: Account, txParams?: TxParameters, - ): Promise { + ): Promise { return await this.nftContract.mintWithURL(to, did, url, from, txParams) } @@ -368,14 +367,14 @@ export class NFT721Api extends NFTsBaseApi { * @param approved - Give or remove transfer rights from the operator. * @param from - The account that wants to give transfer rights to the operator. * @param txParams - Optional transaction parameters. - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async setApprovalForAll( target: string, approved: boolean, from: Account, txParams?: TxParameters, - ): Promise { + ): Promise { return await this.nftContract.setApprovalForAll(target, approved, from.getId(), txParams) } @@ -444,8 +443,9 @@ export class NFT721Api extends NFTsBaseApi { * @returns The address of the NFT owner. */ public async ownerOfAssetByAgreement(did: string, agreementId: string) { - const tokenId = ethers.utils.keccak256( - ethers.utils.defaultAbiCoder.encode(['bytes32', 'bytes32'], [zeroX(did), zeroX(agreementId)]), + const abiCoder = ethers.AbiCoder.defaultAbiCoder() + const tokenId = ethers.keccak256( + abiCoder.encode(['bytes32', 'bytes32'], [zeroX(did), zeroX(agreementId)]), ) return this.ownerOfTokenId(tokenId) } @@ -555,13 +555,13 @@ export class NFT721Api extends NFTsBaseApi { * @param from - The account giving operator permissions * @param txParams - Optional transaction parameters. * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async grantOperatorRole( operatorAddress: string, from?: Account, txParams?: TxParameters, - ): Promise { + ): Promise { return this.nftContract.grantOperatorRole(operatorAddress, from, txParams) } @@ -581,13 +581,13 @@ export class NFT721Api extends NFTsBaseApi { * @param from - The account revoking operator permissions * @param txParams - Optional transaction parameters. * - * @returns The {@link ethers.ContractReceipt} + * @returns The {@link ethers.ContractTransactionReceipt} */ public async revokeOperatorRole( operatorAddress: string, from?: Account, txParams?: TxParameters, - ): Promise { + ): Promise { return this.nftContract.revokeOperatorRole(operatorAddress, from, txParams) } diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index dd6176c76..6251119e0 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -252,7 +252,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { nftSalesTemplateConditions, ddo, assetPrice, - token.getAddress(), + await token.getAddress(), undefined, provider || owner, nftAmount, @@ -263,7 +263,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { type: serviceType, index: 6, serviceEndpoint: this.nevermined.services.node.getNftEndpoint(), - templateId: nftSalesTemplate.getAddress(), + templateId: await nftSalesTemplate.getAddress(), did: ddo.id, attributes: { main: { diff --git a/src/nevermined/api/nfts/PoapApi.ts b/src/nevermined/api/nfts/PoapApi.ts index ed8140def..08186458c 100644 --- a/src/nevermined/api/nfts/PoapApi.ts +++ b/src/nevermined/api/nfts/PoapApi.ts @@ -31,6 +31,10 @@ export default class PoapNFTApi extends NFT721Api { const { instanceConfig } = (await Nevermined.getInstance(config)) as any const contractHandler = new ContractHandler(instanceConfig) const nftContract = await contractHandler.deployAbi(contractABI, from, args) - return PoapNFTApi.getInstanceUsingABI(instanceConfig, nftContract.address, contractABI) + return PoapNFTApi.getInstanceUsingABI( + instanceConfig, + await nftContract.getAddress(), + contractABI, + ) } } diff --git a/src/nevermined/api/nfts/SoulBoundApi.ts b/src/nevermined/api/nfts/SoulBoundApi.ts index 733456120..3a80e422a 100644 --- a/src/nevermined/api/nfts/SoulBoundApi.ts +++ b/src/nevermined/api/nfts/SoulBoundApi.ts @@ -31,6 +31,10 @@ export default class SoulBoundNFTApi extends NFT721Api { const { instanceConfig } = (await Nevermined.getInstance(config)) as any const contractHandler = new ContractHandler(instanceConfig) const nftContract = await contractHandler.deployAbi(contractABI, from, args) - return SoulBoundNFTApi.getInstanceUsingABI(instanceConfig, nftContract.address, contractABI) + return SoulBoundNFTApi.getInstanceUsingABI( + instanceConfig, + await nftContract.getAddress(), + contractABI, + ) } } diff --git a/src/nevermined/api/nfts/SubscriptionNFTApi.ts b/src/nevermined/api/nfts/SubscriptionNFTApi.ts index aff5c704f..dff754da2 100644 --- a/src/nevermined/api/nfts/SubscriptionNFTApi.ts +++ b/src/nevermined/api/nfts/SubscriptionNFTApi.ts @@ -31,6 +31,10 @@ export class SubscriptionNFTApi extends NFT721Api { const { instanceConfig } = (await Nevermined.getInstance(config)) as any const contractHandler = new ContractHandler(instanceConfig) const nftContract = await contractHandler.deployAbi(contractABI, from, args) - return SubscriptionNFTApi.getInstanceUsingABI(instanceConfig, nftContract.address, contractABI) + return SubscriptionNFTApi.getInstanceUsingABI( + instanceConfig, + await nftContract.getAddress(), + contractABI, + ) } } diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index c06069b63..708da900c 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -1,7 +1,7 @@ import { importJWK, SignJWT, JWSHeaderParameters } from 'jose' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { Account } from '../Account' -import { Bytes, ethers } from 'ethers' +import { ethers } from 'ethers' import { Babysig } from '../../models' export interface Eip712Data { @@ -60,7 +60,7 @@ export class EthSignJWT extends SignJWT { sign = await EthSignJWT.signText(decoder.decode(data), signer) } - const input = ethers.utils.arrayify(sign) + const input = ethers.getBytes(sign) const signed = this.base64url(input) const grantToken = `${decoder.decode(encodedHeader)}.${decoder.decode( @@ -70,7 +70,7 @@ export class EthSignJWT extends SignJWT { return grantToken } - public static async signText(text: string | Bytes, signer: ethers.Signer): Promise { + public static async signText(text: string | Uint8Array, signer: ethers.Signer): Promise { try { return await signer.signMessage(text) } catch (e) { @@ -138,7 +138,7 @@ export class JwtUtils extends Instantiable { } public async generateClientAssertion(account: Account, message?: string) { - const address = ethers.utils.getAddress(account.getId()) + const address = ethers.getAddress(account.getId()) const signer = await this.nevermined.accounts.findSigner(address) let eip712Data: Eip712Data @@ -164,7 +164,7 @@ export class JwtUtils extends Instantiable { buyer?: string, babysig?: Babysig, ): Promise { - const address = ethers.utils.getAddress(account.getId()) + const address = ethers.getAddress(account.getId()) const signer = await this.nevermined.accounts.findSigner(address) return new EthSignJWT({ @@ -189,7 +189,7 @@ export class JwtUtils extends Instantiable { aud: string, obj: any, ): Promise { - const address = ethers.utils.getAddress(account.getId()) + const address = ethers.getAddress(account.getId()) const signer = await this.nevermined.accounts.findSigner(address) return new EthSignJWT({ @@ -212,7 +212,7 @@ export class JwtUtils extends Instantiable { buyer?: string, babysig?: Babysig, ): Promise { - const address = ethers.utils.getAddress(account.getId()) + const address = ethers.getAddress(account.getId()) const signer = await this.nevermined.accounts.findSigner(address) return new EthSignJWT({ @@ -253,7 +253,7 @@ export class JwtUtils extends Instantiable { serviceAgreementId: string, workflowId: string, ): Promise { - const address = ethers.utils.getAddress(account.getId()) + const address = ethers.getAddress(account.getId()) const signer = await this.nevermined.accounts.findSigner(address) return new EthSignJWT({ @@ -274,7 +274,7 @@ export class JwtUtils extends Instantiable { serviceAgreementId: string, executionId: string, ): Promise { - const address = ethers.utils.getAddress(account.getId()) + const address = ethers.getAddress(account.getId()) const signer = await this.nevermined.accounts.findSigner(address) return new EthSignJWT({ @@ -297,7 +297,7 @@ export class JwtUtils extends Instantiable { buyer?: string, babysig?: Babysig, ): Promise { - const address = ethers.utils.getAddress(account.getId()) + const address = ethers.getAddress(account.getId()) const signer = await this.nevermined.accounts.findSigner(address) const params = { diff --git a/src/nevermined/utils/ServiceAgreement.ts b/src/nevermined/utils/ServiceAgreement.ts index 2790a63c2..80efcdc76 100644 --- a/src/nevermined/utils/ServiceAgreement.ts +++ b/src/nevermined/utils/ServiceAgreement.ts @@ -56,7 +56,7 @@ export class ServiceAgreement extends Instantiable { ) const serviceAgreementHashSignature = await this.nevermined.utils.signature.signText( - ethers.utils.arrayify(serviceAgreementHash), + ethers.getBytes(serviceAgreementHash), consumer.getId(), ) @@ -77,7 +77,7 @@ export class ServiceAgreement extends Instantiable { { type: 'uint256[]', value: timeouts }, { type: 'bytes32', value: zeroX(serviceAgreementId) }, ] - return ethers.utils.solidityKeccak256( + return ethers.solidityPackedKeccak256( args.map((arg: { type: string }) => arg.type), args.map((arg: { value: any }) => arg.value), ) diff --git a/src/nevermined/utils/SignatureUtils.ts b/src/nevermined/utils/SignatureUtils.ts index 6ed2d3a98..56975eb97 100644 --- a/src/nevermined/utils/SignatureUtils.ts +++ b/src/nevermined/utils/SignatureUtils.ts @@ -1,5 +1,5 @@ import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' -import { Bytes, ethers } from 'ethers' +import { ethers } from 'ethers' export class SignatureUtils extends Instantiable { constructor(config: InstantiableConfig) { @@ -7,7 +7,7 @@ export class SignatureUtils extends Instantiable { this.setInstanceConfig(config) } - public async signText(text: string | Bytes, address: string): Promise { + public async signText(text: string | Uint8Array, address: string): Promise { const signer = await this.nevermined.accounts.findSigner(address) try { return await signer.signMessage(text) @@ -20,12 +20,10 @@ export class SignatureUtils extends Instantiable { } public async verifyText(text: string, signature: string): Promise { - return ethers.utils.verifyMessage(text, signature) + return ethers.verifyMessage(text, signature) } static hash(seed: string): string { - return ethers.utils - .keccak256(ethers.utils.toUtf8Bytes(seed)) - .replace(/^0x([a-f0-9]{64})(:!.+)?$/i, '0x$1') + return ethers.keccak256(ethers.toUtf8Bytes(seed)).replace(/^0x([a-f0-9]{64})(:!.+)?$/i, '0x$1') } } diff --git a/src/services/aave/AaveCredit.ts b/src/services/aave/AaveCredit.ts index 62b9b3f05..6bb918206 100644 --- a/src/services/aave/AaveCredit.ts +++ b/src/services/aave/AaveCredit.ts @@ -12,7 +12,7 @@ import { } from '../../keeper' import { AaveConfig } from '../../models' import { didZeroX, formatEther, generateId, parseEther, zeroX } from '../../utils' -import { ContractReceipt, ethers } from 'ethers' +import { ContractTransactionReceipt } from 'ethers' /** * AaveCredit allows taking loans from Aave protocol using NFT tokens as collateral @@ -139,7 +139,7 @@ export class AaveCredit extends Instantiable { return false } } - const contractReceipt: ContractReceipt = await lockCond.fulfill( + const contractReceipt: ContractTransactionReceipt = await lockCond.fulfill( agreementId, did, vaultAddress, @@ -174,8 +174,8 @@ export class AaveCredit extends Instantiable { if (!did) { did = agreementData.did } - const _collateralAmount = ethers.utils.parseEther(collateralAmount.toString()).toString() - const _delegatedAmount = ethers.utils.parseEther(delegatedAmount.toString()).toString() + const _collateralAmount = parseEther(collateralAmount.toString()).toString() + const _delegatedAmount = parseEther(delegatedAmount.toString()).toString() const _value = useWethGateway ? _collateralAmount.toString() : '0' if (!useWethGateway) { this.logger.log( @@ -192,7 +192,7 @@ export class AaveCredit extends Instantiable { ) } - const contractReceipt: ContractReceipt = + const contractReceipt: ContractTransactionReceipt = await this.nevermined.keeper.conditions.aaveCollateralDepositCondition.fulfill( agreementId, did, @@ -235,7 +235,7 @@ export class AaveCredit extends Instantiable { } const amount = parseEther(delegatedAmount.toString()).toString() - const contractReceipt: ContractReceipt = + const contractReceipt: ContractTransactionReceipt = await this.nevermined.keeper.conditions.aaveBorrowCondition.fulfill( agreementId, did, @@ -280,7 +280,7 @@ export class AaveCredit extends Instantiable { // Verify that the borrower has sufficient balance for the repayment const weiBalance = await erc20Token.balanceOf(from.getId()) - if (weiBalance.lt(weiAllowanceAmount)) { + if (weiBalance < weiAllowanceAmount) { this.logger.warn( `borrower does not have enough balance to repay the debt: token=${delegatedAsset}, weiBalance=${weiBalance}, totalDebt(wei)=${weiAllowanceAmount}`, @@ -296,7 +296,7 @@ export class AaveCredit extends Instantiable { const weiAmount = parseEther(delegatedAmount.toString()).toString() // use the aaveRepayCondition to apply the repayment - const contractReceipt: ContractReceipt = + const contractReceipt: ContractTransactionReceipt = await this.nevermined.keeper.conditions.aaveRepayCondition.fulfill( agreementId, did, @@ -334,7 +334,7 @@ export class AaveCredit extends Instantiable { vaultAddress = (await this.getVaultContract(agreementId, from.getId(), vaultAddress)).address } - const contractReceipt: ContractReceipt = + const contractReceipt: ContractTransactionReceipt = await this.nevermined.keeper.conditions.aaveCollateralWithdrawCondition.fulfill( agreementId, did, @@ -369,7 +369,7 @@ export class AaveCredit extends Instantiable { vaultAddress = vaultContract.address // use the distributeNftCollateralCondition to withdraw the lender's collateral - const contractReceipt: ContractReceipt = + const contractReceipt: ContractTransactionReceipt = await this.nevermined.keeper.conditions.distributeNftCollateralCondition.fulfill( agreementId, did, diff --git a/src/utils/MakeAccounts.ts b/src/utils/MakeAccounts.ts index dccab83b8..6704a259c 100644 --- a/src/utils/MakeAccounts.ts +++ b/src/utils/MakeAccounts.ts @@ -1,8 +1,7 @@ import { ethers } from 'ethers' -import { HDNode } from 'ethers/lib/utils' export function makeAccounts(seedphrase: string): ethers.Wallet[] { - const node = HDNode.fromMnemonic(seedphrase) + const node = ethers.HDNodeWallet.fromPhrase(seedphrase) const accounts: ethers.Wallet[] = [] for (let i = 0; i < 10; i++) { const acc = node.derivePath("m/44'/60'/0'/0/" + i) From fe6eae173c42dba66ce017418d7688999f093e67 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 12 Jul 2023 18:07:25 +0200 Subject: [PATCH 010/151] feat: update tests to use ethers v6 --- .../nevermined/AaveCredit.test.ts | 5 +- integration/compute/ComputeAsset.test.ts | 3 +- integration/external/Datasets.e2e.test.ts | 31 ++- integration/external/Services.e2e.test.ts | 30 +- .../nevermined/AgreementStoreManager.test.ts | 2 +- .../nevermined/AssetsPriceQuery.test.ts | 25 +- .../ClaimPaymentAbortedAgreement.test.ts | 32 +-- integration/nevermined/ConsumeAsset.test.ts | 5 +- .../nevermined/ConsumeAssetViaNode.test.ts | 5 +- .../nevermined/ConsumeBigAsset.test.ts | 2 +- .../ConsumeExternalDDOAsset.test.ts | 7 +- integration/nevermined/ContractEvent.test.ts | 4 +- integration/nevermined/CustomToken.test.ts | 2 +- integration/nevermined/DDO.test.ts | 7 +- integration/nevermined/MetaTx.test.ts | 48 ++-- integration/nevermined/NFT.test.ts | 55 ++-- integration/nevermined/NFT1155.test.ts | 19 +- integration/nevermined/NFT1155Api.e2e.test.ts | 109 ++++---- integration/nevermined/NFT721.test.ts | 37 +-- integration/nevermined/NFT721Api.e2e.test.ts | 45 ++- .../nevermined/NFT721Templates.test.ts | 202 +++++++------- integration/nevermined/NFTTemplates.test.ts | 259 +++++++++--------- .../nevermined/NFTTemplatesWithEther.test.ts | 56 ++-- integration/nevermined/Poap.test.ts | 29 +- integration/nevermined/Provenance.test.ts | 4 +- .../nevermined/RegisterAccessTemplate.test.ts | 43 +-- ...sterEscrowComputeExecutionTemplate.test.ts | 36 +-- .../nevermined/SdkWithoutArtifacts.test.ts | 5 +- .../nevermined/SecondaryMarket.test.ts | 157 +++++------ integration/nevermined/SubgraphEvent.test.ts | 5 +- .../nevermined/SubscriptionDuration.test.ts | 13 +- .../nevermined/Subscriptions.e2e.test.ts | 43 ++- integration/nevermined/TestEncoding.test.ts | 3 +- integration/nevermined/Web3Providers.test.ts | 10 +- integration/tsconfig.json | 4 +- integration/utils/ddo-metadata-generator.ts | 3 +- integration/utils/utils.ts | 2 +- package.json | 2 +- scripts/generate-ddos.ts | 7 +- src/keeper/ContractHandler.ts | 11 +- src/keeper/utils.ts | 5 +- test/keeper/ContractEvent.test.ts | 2 +- test/keeper/ContractHandler.test.ts | 10 +- test/keeper/DIDRegistry.test.ts | 19 +- test/keeper/Keeper.test.ts | 4 +- test/keeper/TestContractHandler.ts | 205 +++++++------- .../conditions/AaveBorrowCondition.test.ts | 3 +- .../AaveCollateralDepositCondition.test.ts | 5 +- .../conditions/AaveRepayCondition.test.ts | 3 +- .../conditions/EscrowPaymentCondition.test.ts | 3 +- .../conditions/LockPaymentCondition.test.ts | 29 +- .../conditions/NFT721LockCondition.test.ts | 17 +- .../conditions/NFTAccessCondition.test.ts | 16 +- .../conditions/NFTHolderCondition.test.ts | 27 +- .../conditions/NFTLockCondition.test.ts | 29 +- .../TransferDIDOwnershipCondition.test.ts | 20 +- .../conditions/TransferNFTCondition.test.ts | 40 +-- .../keeper/templates/DIDSalesTemplate.test.ts | 16 +- .../templates/NFT721AccessTemplate.test.ts | 33 ++- .../templates/NFT721SalesTemplate.test.ts | 16 +- .../templates/NFTAccessTemplate.test.ts | 16 +- .../keeper/templates/NFTSalesTemplate.test.ts | 16 +- test/models/AssetRewards.test.ts | 128 +++------ test/nevermined/Account.test.ts | 23 +- test/nevermined/Accounts.test.ts | 9 +- test/nevermined/Nevermined.test.ts | 2 +- test/tsconfig.json | 5 +- 67 files changed, 995 insertions(+), 1073 deletions(-) diff --git a/aave_integration/nevermined/AaveCredit.test.ts b/aave_integration/nevermined/AaveCredit.test.ts index 0b2acae94..896d6d88a 100644 --- a/aave_integration/nevermined/AaveCredit.test.ts +++ b/aave_integration/nevermined/AaveCredit.test.ts @@ -1,6 +1,6 @@ import { getMetadata } from '../../integration/utils/index' import TestContractHandler from '../../test/keeper/TestContractHandler' -import { Account, ConditionState, DDO, generateId } from '../../src/index' +import { AaveConfig, Account, ConditionState, DDO, generateId } from '../../src/index' import ERC721 from '../../test/resources/artifacts/NFT721SubscriptionUpgradeable.json' import { Nevermined } from '../../src/nevermined' import { didZeroX, zeroX } from '../../src/utils/index' @@ -21,7 +21,6 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' import { decodeJwt } from 'jose' import { Contract } from 'ethers' -import { BigNumber } from '../../src/utils' import { NFTAttributes } from '../../src/models/NFTAttributes' chai.use(chaiAsPromised) @@ -81,7 +80,7 @@ describe('AaveCredit', () => { // await TestContractHandler.prepareContracts() nevermined = await Nevermined.getInstance(config) - ;({ agreementFee } = config.aaveConfig) + ;({ agreementFee } = config.aaveConfig as AaveConfig) ;({ aaveCreditTemplate } = nevermined.keeper.templates) ;({ conditionStoreManager, didRegistry, agreementStoreManager } = nevermined.keeper) ;({ nft721LockCondition, aaveRepayCondition } = nevermined.keeper.conditions) diff --git a/integration/compute/ComputeAsset.test.ts b/integration/compute/ComputeAsset.test.ts index f48d99d8c..afafa9f7b 100644 --- a/integration/compute/ComputeAsset.test.ts +++ b/integration/compute/ComputeAsset.test.ts @@ -5,7 +5,6 @@ import { config } from '../config' import { workflowMetadatas } from '../utils' import { Nevermined, DDO, Account, AssetPrice, AssetAttributes } from '../../src' -import { BigNumber } from '../../src/utils' describe('Compute Asset', () => { let nevermined: Nevermined @@ -33,7 +32,7 @@ describe('Compute Asset', () => { const payload = decodeJwt(config.marketplaceAuthToken) userId = payload.sub - assetPrice = new AssetPrice(publisher.getId(), BigNumber.from(0)) + assetPrice = new AssetPrice(publisher.getId(), 0n) }) it('should register the assets', async () => { diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index 37ed9b503..828850bdc 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -6,7 +6,6 @@ import { config } from '../config' import { generateMetadata, getMetadata } from '../utils' import TestContractHandler from '../../test/keeper/TestContractHandler' import { ethers } from 'ethers' -import { BigNumber } from '../../src/utils' import { didZeroX } from '../../src/utils' import { EventOptions } from '../../src/events' import { @@ -33,8 +32,8 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { // Configuration of First Sale: // Editor -> Subscriber, the Reseller get a cut (25%) - let subscriptionPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + let subscriptionPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice: AssetPrice let royaltyAttributes: RoyaltyAttributes @@ -54,7 +53,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' let initialBalances: any - let scale: BigNumber + let scale: bigint // let nft: ethers.Contract let subscriptionNFT: NFT721Api @@ -121,10 +120,10 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { // components ;({ token } = nevermined.keeper) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - subscriptionPrice = subscriptionPrice.mul(scale) - amounts = amounts.map((v) => v.mul(scale)) + subscriptionPrice = subscriptionPrice * scale + amounts = amounts.map((v) => v * scale) receivers = [publisher.getId(), reseller.getId()] assetPrice = new AssetPrice( new Map([ @@ -139,7 +138,9 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { editor: await token.balanceOf(publisher.getId()), subscriber: await token.balanceOf(subscriber.getId()), reseller: await token.balanceOf(reseller.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } console.log(`USING CONFIG:`) @@ -218,10 +219,10 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('I am ordering the subscription NFT', async () => { - await subscriber.requestTokens(subscriptionPrice.div(scale)) + await subscriber.requestTokens(subscriptionPrice / scale) const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) - assert.isTrue(subscriberBalanceBefore.eq(initialBalances.subscriber.add(subscriptionPrice))) + assert.isTrue(subscriberBalanceBefore == initialBalances.subscriber + subscriptionPrice) agreementId = await nevermined.nfts721.order(subscriptionDDO.id, subscriber) @@ -229,7 +230,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) - assert.isTrue(subscriberBalanceAfter.sub(initialBalances.subscriber).eq(0)) + assert.equal(subscriberBalanceAfter - initialBalances.subscriber, 0n) }) it('The Publisher can check the payment and transfer the NFT to the Subscriber', async () => { @@ -252,9 +253,9 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { const receiver0Balance = await token.balanceOf(assetPrice.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice.getReceivers()[1]) - assert.isTrue(receiver0Balance.eq(initialBalances.editor.add(assetPrice.getAmounts()[0]))) + assert.equal(receiver0Balance, initialBalances.editor + assetPrice.getAmounts()[0]) - assert.isTrue(receiver1Balance.eq(initialBalances.reseller.add(assetPrice.getAmounts()[1]))) + assert.equal(receiver1Balance, initialBalances.reseller + assetPrice.getAmounts()[1]) }) it('the subscription can be checked on chain', async () => { @@ -291,12 +292,12 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { assert.equal(eventValues._did, didZeroX(subscriptionDDO.id)) // thegraph stores the addresses in lower case - assert.equal(ethers.utils.getAddress(eventValues._receiver), subscriber.getId()) + assert.equal(ethers.getAddress(eventValues._receiver), subscriber.getId()) }) it('The Subscriber should have an NFT balance', async () => { const balance = await subscriptionNFT.balanceOf(subscriber.getId()) - assert.equal(balance.toNumber(), 1) + assert.equal(balance, 1n) }) it('The Subscriber should have access to the dataset', async () => { diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index a1ad197cc..e051999b1 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -14,7 +14,6 @@ import { config } from '../config' import { generateWebServiceMetadata, getMetadata } from '../utils' import TestContractHandler from '../../test/keeper/TestContractHandler' import { ethers } from 'ethers' -import { BigNumber } from '../../src/utils' import { didZeroX } from '../../src/utils' import { EventOptions } from '../../src/events' import { @@ -45,8 +44,8 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { // Configuration of First Sale: // Editor -> Subscriber, the Reseller get a cut (25%) - let subscriptionPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + let subscriptionPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice: AssetPrice let royaltyAttributes: RoyaltyAttributes @@ -94,7 +93,7 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { const opts: RequestInit = {} let initialBalances: any - let scale: BigNumber + let scale: bigint // let nft: ethers.Contract let subscriptionNFT: NFT721Api @@ -163,10 +162,10 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { // components ;({ token } = nevermined.keeper) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - subscriptionPrice = subscriptionPrice.mul(scale) - amounts = amounts.map((v) => v.mul(scale)) + subscriptionPrice = subscriptionPrice * scale + amounts = amounts.map((v) => v * scale) receivers = [publisher.getId(), reseller.getId()] assetPrice = new AssetPrice( new Map([ @@ -181,7 +180,9 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { editor: await token.balanceOf(publisher.getId()), subscriber: await token.balanceOf(subscriber.getId()), reseller: await token.balanceOf(reseller.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } console.log(`USING CONFIG:`) @@ -328,10 +329,10 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { }) it('I am ordering the subscription NFT', async () => { - await subscriber.requestTokens(subscriptionPrice.div(scale)) + await subscriber.requestTokens(subscriptionPrice / scale) const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) - assert.isTrue(subscriberBalanceBefore.eq(initialBalances.subscriber.add(subscriptionPrice))) + assert.equal(subscriberBalanceBefore, initialBalances.subscriber + subscriptionPrice) agreementId = await nevermined.nfts721.order(subscriptionDDO.id, subscriber) @@ -339,7 +340,7 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) - assert.isTrue(subscriberBalanceAfter.sub(initialBalances.subscriber).eq(0)) + assert.equal(subscriberBalanceAfter, subscriberBalanceAfter - initialBalances.subscriber) }) it('The Publisher can check the payment and transfer the NFT to the Subscriber', async () => { @@ -362,9 +363,8 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { const receiver0Balance = await token.balanceOf(assetPrice.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice.getReceivers()[1]) - assert.isTrue(receiver0Balance.eq(initialBalances.editor.add(assetPrice.getAmounts()[0]))) - - assert.isTrue(receiver1Balance.eq(initialBalances.reseller.add(assetPrice.getAmounts()[1]))) + assert.equal(receiver0Balance, initialBalances.editor + assetPrice.getAmounts()[0]) + assert.equal(receiver1Balance, initialBalances.reseller + assetPrice.getAmounts()[1]) }) it('the subscription can be checked on chain', async () => { @@ -401,7 +401,7 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { assert.equal(eventValues._did, didZeroX(subscriptionDDO.id)) // thegraph stores the addresses in lower case - assert.equal(ethers.utils.getAddress(eventValues._receiver), subscriber.getId()) + assert.equal(ethers.getAddress(eventValues._receiver), subscriber.getId()) }) }) diff --git a/integration/nevermined/AgreementStoreManager.test.ts b/integration/nevermined/AgreementStoreManager.test.ts index ac12e6093..d33c4ba6d 100644 --- a/integration/nevermined/AgreementStoreManager.test.ts +++ b/integration/nevermined/AgreementStoreManager.test.ts @@ -53,7 +53,7 @@ describe('Agreement Store Manager', () => { const num = agreements.length await account2.requestTokens( - +ddo.getPriceByService() * 10 ** -(await nevermined.keeper.token.decimals()), + ddo.getPriceByService() * 10n ** -BigInt(await nevermined.keeper.token.decimals()), ) agreementId = await nevermined.assets.order(ddo.id, account2) diff --git a/integration/nevermined/AssetsPriceQuery.test.ts b/integration/nevermined/AssetsPriceQuery.test.ts index d7ea8ba58..f1f62b883 100644 --- a/integration/nevermined/AssetsPriceQuery.test.ts +++ b/integration/nevermined/AssetsPriceQuery.test.ts @@ -3,17 +3,16 @@ import { decodeJwt, JWTPayload } from 'jose' import { Account, DDO, Nevermined, NFTAttributes, AssetAttributes, AssetPrice } from '../../src' import { CustomToken } from '../../src/keeper' import { getRoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' -import { generateId } from '../../src/utils' -import { BigNumber } from '../../src/utils' +import { generateId, parseUnits } from '../../src/utils' import { config } from '../config' import { getMetadata } from '../utils' import { sleep } from '../utils/utils' describe('Assets Query by Price', () => { let nevermined: Nevermined - let price1: BigNumber - let price2: BigNumber - let royalties: BigNumber + let price1: bigint + let price2: bigint + let royalties: bigint let payload: JWTPayload let account: Account let account2: Account @@ -24,11 +23,11 @@ describe('Assets Query by Price', () => { before(async () => { nevermined = await Nevermined.getInstance(config) - token = await nevermined.contracts.loadErc20(nevermined.utils.token.getAddress()) + token = await nevermined.contracts.loadErc20(await nevermined.utils.token.getAddress()) - price1 = BigNumber.parseUnits('2', await token.decimals()) - price2 = BigNumber.parseUnits('17.86', await token.decimals()) - royalties = BigNumber.parseUnits('2', await token.decimals()) + price1 = parseUnits('2', await token.decimals()) + price2 = parseUnits('17.86', await token.decimals()) + royalties = parseUnits('2', await token.decimals()) appId = generateId() ;[account, account2] = await nevermined.accounts.list() const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(account) @@ -40,7 +39,9 @@ describe('Assets Query by Price', () => { // publish asset with priced service `access` let metadata = getMetadata() metadata.userId = payload.sub - let assetPrice = new AssetPrice(account.getId(), price1).setTokenAddress(token.getAddress()) + let assetPrice = new AssetPrice(account.getId(), price1).setTokenAddress( + await token.getAddress(), + ) const _attributes = AssetAttributes.getInstance({ metadata, @@ -54,7 +55,7 @@ describe('Assets Query by Price', () => { metadata.userId = payload.sub assetPrice = new AssetPrice( new Map([ - [account.getId(), price2.sub(royalties)], + [account.getId(), price2 - royalties], [account2.getId(), royalties], ]), ) @@ -69,7 +70,7 @@ describe('Assets Query by Price', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(1), + cap: 1n, royaltyAttributes, }) ddoNftSales = await nevermined.nfts1155.create(nftAttributes, account) diff --git a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts index 1e2b8795f..89fc21bdd 100644 --- a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts +++ b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts @@ -11,7 +11,7 @@ import { import { config } from '../config' import { getMetadata } from '../utils' import { ethers } from 'ethers' -import { BigNumber, generateId } from '../../src/utils' +import { generateId } from '../../src/utils' import '../globals' import { mineBlocks } from '../utils/utils' @@ -30,15 +30,15 @@ describe('Claim aborted agreements End-to-End', () => { // Configuration of First Sale: // Publisher -> Collector1, other account get a cut (25%) - let nftPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + let nftPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice1: AssetPrice - let scale: BigNumber - let neverminedNodeAddress + let scale: bigint + let neverminedNodeAddress: string - let nft: ethers.Contract + let nft: ethers.BaseContract let nftContract: Nft721Contract let payload: JWTPayload @@ -68,7 +68,7 @@ describe('Claim aborted agreements End-to-End', () => { nftContract = await Nft721Contract.getInstance( (nevermined.keeper as any).instanceConfig, - nft.address, + await nft.getAddress(), ) await nevermined.contracts.loadNft721(nftContract.address) @@ -88,10 +88,10 @@ describe('Claim aborted agreements End-to-End', () => { // components ;({ token } = nevermined.keeper) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - nftPrice = nftPrice.mul(scale) - amounts = amounts.map((v) => v.mul(scale)) + nftPrice = nftPrice * scale + amounts = amounts.map((v) => v * scale) receivers = [publisher.getId(), other.getId()] assetPrice1 = new AssetPrice( new Map([ @@ -101,7 +101,7 @@ describe('Claim aborted agreements End-to-End', () => { ) await nftContract.grantOperatorRole(transferNft721Condition.address, publisher) - await collector1.requestTokens(nftPrice.div(scale).mul(10)) + await collector1.requestTokens((nftPrice / scale) * 10n) }) describe('As a publisher I want to register a new asset', () => { @@ -209,7 +209,7 @@ describe('Claim aborted agreements End-to-End', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceAfter.add(nftPrice).eq(collector1BalanceBefore)) + assert.equal(collector1BalanceAfter + nftPrice, collector1BalanceBefore) }) it('I can order the NFT after the timelock', async () => { @@ -256,8 +256,8 @@ describe('Claim aborted agreements End-to-End', () => { const publisherBalanceAfter = await token.balanceOf(publisher.getId()) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBefore.eq(collector1BalanceAfter)) - assert.isTrue(publisherBalanceBefore.add(amounts[0]).eq(publisherBalanceAfter)) + assert.equal(collector1BalanceBefore, collector1BalanceAfter) + assert.equal(publisherBalanceBefore + amounts[0], publisherBalanceAfter) }) }) @@ -275,7 +275,7 @@ describe('Claim aborted agreements End-to-End', () => { ) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBeforeOrder.sub(nftPrice).eq(collector1BalanceAfter)) + assert.equal(collector1BalanceBeforeOrder - nftPrice, collector1BalanceAfter) await mineBlocks(nevermined, collector1, accessTimeout + 1) @@ -309,7 +309,7 @@ describe('Claim aborted agreements End-to-End', () => { assert.equal(agreementStatusReleased['escrowPayment'].state, ConditionState.Fulfilled) const collector1BalanceReleased = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBeforeOrder.eq(collector1BalanceReleased)) + assert.equal(collector1BalanceBeforeOrder, collector1BalanceReleased) }) }) diff --git a/integration/nevermined/ConsumeAsset.test.ts b/integration/nevermined/ConsumeAsset.test.ts index f6147ebd7..18488f231 100644 --- a/integration/nevermined/ConsumeAsset.test.ts +++ b/integration/nevermined/ConsumeAsset.test.ts @@ -17,7 +17,6 @@ import { AssetAttributes, } from '../../src' import { AgreementPrepareResult } from '../../src/nevermined' -import { BigNumber } from '../../src/utils' describe('Consume Asset', () => { let nevermined: Nevermined @@ -63,7 +62,7 @@ describe('Consume Asset', () => { it('should be able to request tokens for consumer', async () => { const initialBalance = (await consumer.getBalance()).nevermined - const claimedTokens = BigNumber.from(100) + const claimedTokens = 100n try { await consumer.requestTokens(claimedTokens) @@ -72,7 +71,7 @@ describe('Consume Asset', () => { } const balanceAfter = (await consumer.getBalance()).nevermined - assert.isTrue(balanceAfter.gt(initialBalance)) + assert.isTrue(balanceAfter > initialBalance) }) it('should sign the service agreement', async () => { diff --git a/integration/nevermined/ConsumeAssetViaNode.test.ts b/integration/nevermined/ConsumeAssetViaNode.test.ts index 09b72de68..2c3f2dc06 100644 --- a/integration/nevermined/ConsumeAssetViaNode.test.ts +++ b/integration/nevermined/ConsumeAssetViaNode.test.ts @@ -17,7 +17,6 @@ import { } from '../../src' import { repeat, sleep } from '../utils/utils' import { ethers } from 'ethers' -import { BigNumber } from '../../src/utils' describe('Consume Asset (Nevermined Node)', () => { let nevermined: Nevermined @@ -42,7 +41,7 @@ describe('Consume Asset (Nevermined Node)', () => { await nevermined.services.marketplace.login(clientAssertion) const payload = decodeJwt(config.marketplaceAuthToken) - assetPrice = new AssetPrice(publisher.getId(), BigNumber.from(0)) + assetPrice = new AssetPrice(publisher.getId(), 0n) metadata = getMetadata() metadata.main.name = `${metadata.main.name} - ${Math.random()}` @@ -78,7 +77,7 @@ describe('Consume Asset (Nevermined Node)', () => { assert.deepEqual(steps, [0, 1, 2, 3, 4, 5, 6, 9, 10, 12]) const assetProviders = await nevermined.assets.providers.list(ddo.id) - assert.deepEqual(assetProviders, [ethers.utils.getAddress(config.neverminedNodeAddress)]) + assert.deepEqual(assetProviders, [ethers.getAddress(config.neverminedNodeAddress)]) }) it('should order the asset', async () => { diff --git a/integration/nevermined/ConsumeBigAsset.test.ts b/integration/nevermined/ConsumeBigAsset.test.ts index e203fc575..d34f3d8df 100644 --- a/integration/nevermined/ConsumeBigAsset.test.ts +++ b/integration/nevermined/ConsumeBigAsset.test.ts @@ -57,7 +57,7 @@ describe.skip('Consume Asset (Large size)', () => { it('should order the asset', async () => { try { await consumer.requestTokens( - +ddo.getPriceByService() * 10 ** -(await nevermined.keeper.token.decimals()), + ddo.getPriceByService() * 10n ** -BigInt(await nevermined.keeper.token.decimals()), ) } catch (error) { Logger.error(error) diff --git a/integration/nevermined/ConsumeExternalDDOAsset.test.ts b/integration/nevermined/ConsumeExternalDDOAsset.test.ts index 3d0b92022..82b2dd157 100644 --- a/integration/nevermined/ConsumeExternalDDOAsset.test.ts +++ b/integration/nevermined/ConsumeExternalDDOAsset.test.ts @@ -14,7 +14,6 @@ import { } from '../../src' import { getMetadata } from '../utils' import { repeat, sleep } from '../utils/utils' -import { BigNumber } from '../../src/utils' import { AgreementPrepareResult } from '../../src/nevermined/api/AgreementsApi' describe('Consume Asset (Documentation example)', () => { @@ -43,7 +42,7 @@ describe('Consume Asset (Documentation example)', () => { metadata = await getMetadata() metadata.userId = payload.sub - assetPrice = new AssetPrice(publisher.getId(), BigNumber.from('0')) + assetPrice = new AssetPrice(publisher.getId(), 0n) }) it('should register an asset', async () => { @@ -63,7 +62,7 @@ describe('Consume Asset (Documentation example)', () => { it('should be able to request tokens for consumer', async () => { const initialBalance = (await consumer.getBalance()).nevermined - const claimedTokens = BigNumber.from(1) + const claimedTokens = 1n try { await consumer.requestTokens(claimedTokens) @@ -72,7 +71,7 @@ describe('Consume Asset (Documentation example)', () => { } const balanceAfter = (await consumer.getBalance()).nevermined - assert.isTrue(balanceAfter.gt(initialBalance)) + assert.isTrue(balanceAfter > initialBalance) }) it('should sign the service agreement', async () => { diff --git a/integration/nevermined/ContractEvent.test.ts b/integration/nevermined/ContractEvent.test.ts index 6218887c6..4221782f8 100644 --- a/integration/nevermined/ContractEvent.test.ts +++ b/integration/nevermined/ContractEvent.test.ts @@ -38,8 +38,8 @@ describe('ContractEvent', () => { eventName: 'Transfer', }) assert.strictEqual( - ethers.utils.getAddress(response.pop().args.to), - ethers.utils.getAddress(account.getId()), + ethers.getAddress(response.pop().args.to), + ethers.getAddress(account.getId()), ) }) diff --git a/integration/nevermined/CustomToken.test.ts b/integration/nevermined/CustomToken.test.ts index 6deefcc79..151f5a0d0 100644 --- a/integration/nevermined/CustomToken.test.ts +++ b/integration/nevermined/CustomToken.test.ts @@ -12,7 +12,7 @@ describe('CustomToken', () => { before(async () => { nevermined = await Nevermined.getInstance(config) ;[account] = await nevermined.accounts.list() - erc20TokenAddress = process.env.TOKEN_ADDRESS || nevermined.utils.token.getAddress() + erc20TokenAddress = process.env.TOKEN_ADDRESS || (await nevermined.utils.token.getAddress()) }) it('should get a custom token instance', async () => { diff --git a/integration/nevermined/DDO.test.ts b/integration/nevermined/DDO.test.ts index 1a4dfee9d..0e7ef2e53 100644 --- a/integration/nevermined/DDO.test.ts +++ b/integration/nevermined/DDO.test.ts @@ -1,4 +1,3 @@ -import { BigNumber } from 'ethers' import { decodeJwt } from 'jose' import { Account, DDO, MetaData, Nevermined } from '../../src' import { AssetAttributes, AssetPrice } from '../../src/models/' @@ -39,7 +38,7 @@ describe('DDO Tests', () => { const payload = decodeJwt(config.marketplaceAuthToken) userId = payload.sub - price = new AssetPrice(publisher.getId(), BigNumber.from(1)) + price = new AssetPrice(publisher.getId(), 1n) }) it('should create correct dataset DDO', async () => { @@ -142,8 +141,8 @@ describe('DDO Tests', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(10), - amount: BigNumber.from(1), + cap: 10n, + amount: 1n, royaltyAttributes, preMint: true, }) diff --git a/integration/nevermined/MetaTx.test.ts b/integration/nevermined/MetaTx.test.ts index cab9a1c82..709456429 100644 --- a/integration/nevermined/MetaTx.test.ts +++ b/integration/nevermined/MetaTx.test.ts @@ -3,9 +3,8 @@ import { decodeJwt, JWTPayload } from 'jose' import { config } from '../config' import { getMetadata } from '../utils' import { Nevermined, Account, DDO, NFTAttributes } from '../../src' -import { BigNumber, makeAccounts } from '../../src/utils' +import { makeAccounts } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' -import { ethers } from 'ethers' import fs from 'fs' import { RelayProvider } from '@opengsn/provider' import { Web3ProviderWrapper } from '../../src/keeper' @@ -49,23 +48,23 @@ describe.skip('MetaTx test with nfts', () => { metadata, serviceTypes: ['nft-sales', 'nft-access'], nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(10), + cap: 10n, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) }) it('should mint 10 nft tokens', async () => { - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(10)) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 10n) }) it('should transfer 2 nft tokens with default token', async () => { - const agreementId = await nevermined.nfts1155.order(ddo.id, BigNumber.from(2), collector) + const agreementId = await nevermined.nfts1155.order(ddo.id, 2n, collector) - await nevermined.nfts1155.transfer(agreementId, ddo.id, BigNumber.from(2), artist) + await nevermined.nfts1155.transfer(agreementId, ddo.id, 2n, artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(8)) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, collector), BigNumber.from(2)) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 8n) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, collector), 2n) }) it('metatransactions should work', async () => { @@ -74,41 +73,32 @@ describe.skip('MetaTx test with nfts', () => { await nevermined.keeper.nftUpgradeable.transferNft( ddo.id, await wallet.getAddress(), - BigNumber.from(2), + 2n, artist.getId(), ) - assert.deepEqual( - BigNumber.from( - await nevermined.keeper.nftUpgradeable.balance(await wallet.getAddress(), ddo.id), - ), - BigNumber.from(4), + assert.equal( + await nevermined.keeper.nftUpgradeable.balance(await wallet.getAddress(), ddo.id), + 4n, ) - const config = await { + const config = { paymasterAddress: paymasterAddress, auditorsCount: 0, preferredRelays: ['http://opengsn.nevermined.localnet'], } - const gsnProvider = RelayProvider.newProvider({ + const { gsnSigner } = await RelayProvider.newEthersV6Provider({ provider: new Web3ProviderWrapper(nevermined.web3), config, }) - await gsnProvider.init() - gsnProvider.addAccount(wallet.privateKey) - const etherProvider = new ethers.providers.Web3Provider(gsnProvider) - const signer = etherProvider.getSigner(wallet.address) + const signerAccount = new Account(await gsnSigner.getAddress()) - const signerAccount = new Account(await signer.getAddress()) - - await nevermined.nfts1155.burn(ddo.id, BigNumber.from(2), signerAccount) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(6)) - assert.deepEqual( - BigNumber.from( - await nevermined.keeper.nftUpgradeable.balance(await wallet.getAddress(), ddo.id), - ), - BigNumber.from(2), + await nevermined.nfts1155.burn(ddo.id, 2n, signerAccount) + assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 6n) + assert.equal( + await nevermined.keeper.nftUpgradeable.balance(await wallet.getAddress(), ddo.id), + 2n, ) }) }) diff --git a/integration/nevermined/NFT.test.ts b/integration/nevermined/NFT.test.ts index 179469239..53f9da10b 100644 --- a/integration/nevermined/NFT.test.ts +++ b/integration/nevermined/NFT.test.ts @@ -3,8 +3,7 @@ import { decodeJwt, JWTPayload } from 'jose' import { config } from '../config' import { getMetadata } from '../utils' import { Nevermined, Account, DDO, AssetPrice, NFTAttributes } from '../../src' -import { ZeroAddress } from '../../src/utils' -import { BigNumber } from '../../src/utils' +import { parseEther, ZeroAddress } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' describe('Nfts operations', () => { @@ -38,7 +37,7 @@ describe('Nfts operations', () => { metadata, serviceTypes: ['nft-sales', 'nft-access'], nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(10), + cap: 10n, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) @@ -52,15 +51,15 @@ describe('Nfts operations', () => { }) it('should mint 10 nft tokens', async () => { - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(10)) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 10n) }) it('should transfer 2 nft tokens with default token', async () => { - const agreementId = await nevermined.nfts1155.order(ddo.id, BigNumber.from(2), collector) - await nevermined.nfts1155.transfer(agreementId, ddo.id, BigNumber.from(2), artist) + const agreementId = await nevermined.nfts1155.order(ddo.id, 2n, collector) + await nevermined.nfts1155.transfer(agreementId, ddo.id, 2n, artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(8)) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, collector), BigNumber.from(2)) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 8n) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, collector), 2n) }) it('should the operation be approved', async () => { @@ -73,8 +72,8 @@ describe('Nfts operations', () => { }) it('should burn nft tokens', async () => { - await nevermined.nfts1155.burn(ddo.id, BigNumber.from(6), artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(2)) + await nevermined.nfts1155.burn(ddo.id, 6n, artist) + assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 2n) }) }) @@ -87,27 +86,27 @@ describe('Nfts operations', () => { metadata, serviceTypes: ['nft-sales', 'nft-access'], nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(10), + cap: 20n, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) }) it('should mint 10 nft tokens', async () => { - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(10)) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 10n) }) it('should transfer 2 nft tokens with custom token', async () => { - const agreementId = await nevermined.nfts1155.order(ddo.id, BigNumber.from(2), collector) - await nevermined.nfts1155.transfer(agreementId, ddo.id, BigNumber.from(2), artist) + const agreementId = await nevermined.nfts1155.order(ddo.id, 2n, collector) + await nevermined.nfts1155.transfer(agreementId, ddo.id, 2n, artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(8)) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, collector), BigNumber.from(2)) + assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 8n) + assert.equal(await nevermined.nfts1155.balance(ddo.id, collector), 2n) }) it('should burn nft tokens', async () => { - await nevermined.nfts1155.burn(ddo.id, BigNumber.from(6), artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(2)) + await nevermined.nfts1155.burn(ddo.id, 6n, artist) + assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 2n) }) }) @@ -119,32 +118,30 @@ describe('Nfts operations', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ metadata, serviceTypes: ['nft-sales', 'nft-access'], - price: new AssetPrice(artist.getId(), BigNumber.parseEther('0.1')).setTokenAddress( - ZeroAddress, - ), + price: new AssetPrice(artist.getId(), parseEther('0.1')).setTokenAddress(ZeroAddress), nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(10), + cap: 10n, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) }) it('should mint 10 nft tokens', async () => { - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(10)) + assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 10n) }) it('should transfer 2 nft tokens with ether', async () => { - const agreementId = await nevermined.nfts1155.order(ddo.id, BigNumber.from(2), collector) - await nevermined.nfts1155.transfer(agreementId, ddo.id, BigNumber.from(2), artist) + const agreementId = await nevermined.nfts1155.order(ddo.id, 2n, collector) + await nevermined.nfts1155.transfer(agreementId, ddo.id, 2n, artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(8)) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, collector), BigNumber.from(2)) + assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 8n) + assert.equal(await nevermined.nfts1155.balance(ddo.id, collector), 2n) }) it('should burn nft tokens', async () => { - await nevermined.nfts1155.burn(ddo.id, BigNumber.from(6), artist) + await nevermined.nfts1155.burn(ddo.id, 6n, artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), BigNumber.from(2)) + assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 2n) }) }) }) diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 2e2a348d6..b8786ba69 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -14,7 +14,6 @@ import { config } from '../config' import { getMetadata } from '../utils' import { getRoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' import { ethers } from 'ethers' -import { BigNumber } from '../../src/utils' import '../globals' chai.use(chaiAsPromised) @@ -24,20 +23,20 @@ describe('NFT1155 End-to-End', () => { let publisher: Account let someone: Account let minter: Account - let nftContract: ethers.Contract + let nftContract: ethers.BaseContract let nevermined: Nevermined let ddo: DDO let token let nftUpgradeable - const amounts = [BigNumber.from(15), BigNumber.from(5)] + const amounts = [15n, 5n] const metadata = getMetadata() const royalties = 0 // 10% of royalties in the secondary market - const cappedAmount = BigNumber.from(10) + const cappedAmount = 10n const preMint = false - const numberNFTs = BigNumber.from(1) + const numberNFTs = 1n let royaltyAttributes let receivers: string[] @@ -78,17 +77,17 @@ describe('NFT1155 End-to-End', () => { nftContract = await nevermined.utils.contractHandler.deployAbi(erc1155ABI, deployer, [ deployer.getId(), - nevermined.keeper.didRegistry.getAddress(), + await nevermined.keeper.didRegistry.getAddress(), 'NFT1155', 'NVM', '', ]) assert.isDefined(nftContract) - console.log(`NFT (ERC-1155) deployed at address ${nftContract.address}`) + console.log(`NFT (ERC-1155) deployed at address ${await nftContract.getAddress()}`) }) - it('Clonning an instance', async () => { + it('Cloning an instance', async () => { const cloneAddress = await nevermined.nfts1155.getContract.createClone( 'My New NFT', 'xyz', @@ -143,7 +142,7 @@ describe('NFT1155 End-to-End', () => { const owner = new Account(await nftUpgradeable.owner()) await nftUpgradeable.grantOperatorRole(minter.getId(), owner) - await nftUpgradeable.mint(someone.getId(), ddo.shortId(), BigNumber.from(1), minter.getId()) + await nftUpgradeable.mint(someone.getId(), ddo.shortId(), 1n, minter.getId()) const afterBalance = await nftUpgradeable.balance(someone.getId(), ddo.shortId()) assert.isTrue(beforeBalance.add(1).eq(afterBalance)) @@ -152,7 +151,7 @@ describe('NFT1155 End-to-End', () => { it('Should be able to burn', async () => { const beforeBalance = await nftUpgradeable.balance(someone.getId(), ddo.shortId()) - await nftUpgradeable.burn(someone.getId(), ddo.shortId(), BigNumber.from(1)) + await nftUpgradeable.burn(someone.getId(), ddo.shortId(), 1n) const afterBalance = await nftUpgradeable.balance(someone.getId(), ddo.shortId()) assert.isTrue(beforeBalance.sub(1).eq(afterBalance)) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index b6ddb4973..66311b7e2 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -21,7 +21,6 @@ import '../globals' import { AssetAttributes } from '../../src/models/AssetAttributes' import { NFTAttributes } from '../../src/models/NFTAttributes' import { DIDResolvePolicy } from '../../src/nevermined/api/RegistryBaseApi' -import { BigNumber } from '../../src/utils' import { sleep } from '../utils/utils' chai.use(chaiAsPromised) @@ -44,20 +43,20 @@ function makeTest(isCustom) { const metadata = getMetadata() const royalties1 = 100000 // 10% of royalties in the secondary market const royalties = 10 // 10% of royalties in the secondary market - const cappedAmount = BigNumber.from(5) + const cappedAmount = 5n let agreementId: string let agreementId2: string // Configuration of First Sale: // Artist -> Collector1, the gallery get a cut (25%) - const numberEditions = BigNumber.from(1) - let nftPrice = BigNumber.from(100) - let amounts = [BigNumber.from(75), BigNumber.from(25)] + const numberEditions = 1n + let nftPrice = 100n + let amounts = [75n, 25n] let receivers: string[] let assetPrice1: AssetPrice let initialBalances: any - let scale: BigNumber + let scale: bigint let payload: JWTPayload before(async () => { @@ -102,7 +101,7 @@ function makeTest(isCustom) { const nftContract = await Nft1155Contract.getInstance( (nevermined.keeper as any).instanceConfig, - nft.address, + await nft.getAddress(), ) await nevermined.contracts.loadNft1155(nftContract.address) @@ -115,33 +114,35 @@ function makeTest(isCustom) { // eslint-disable-next-line @typescript-eslint/no-extra-semi ;({ token } = nevermined.keeper) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - amounts = amounts.map((v) => v.mul(scale)) + amounts = amounts.map((v) => v * scale) receivers = [artist.getId(), gallery.getId()] - const lst: [string, BigNumber][] = [ + const lst: [string, bigint][] = [ [receivers[0], amounts[0]], [receivers[1], amounts[1]], ] if (feeReceiver !== '0x0000000000000000000000000000000000000000') { receivers.push(feeReceiver) - const price = amounts.reduce((a, b) => a.add(b), BigNumber.from(0)) - amounts.push(price.mul(fee).div(BigNumber.from(1000000).sub(fee))) + const price = amounts.reduce((a, b) => a + b, 0n) + amounts.push((price * fee) / 1000000n - fee) lst.push([receivers[2], amounts[2]]) } - nftPrice = amounts.reduce((a, b) => a.add(b), BigNumber.from(0)) + nftPrice = amounts.reduce((a, b) => a + b, 0n) assetPrice1 = new AssetPrice(new Map(lst)) - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) console.debug( - `Contract balance (initial) ${await token.balanceOf(escrowPaymentCondition.getAddress())}`, + `Contract balance (initial) ${await token.balanceOf( + await escrowPaymentCondition.getAddress(), + )}`, ) initialBalances = { artist: await token.balanceOf(artist.getId()), collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.getAddress()), + escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), } }) @@ -168,7 +169,7 @@ function makeTest(isCustom) { assert.isDefined(ddo) const balance = await nevermined.nfts1155.balance(ddo.id, artist.getId()) - assert.deepEqual(balance, BigNumber.from(5)) + assert.deepEqual(balance, 5n) }) it('should give Nevermined the operator role', async () => { @@ -182,7 +183,7 @@ function makeTest(isCustom) { it('Should set the Node as a provider by default', async () => { const providers = await nevermined.assets.providers.list(ddo.id) - assert.deepEqual(providers, [ethers.utils.getAddress(config.neverminedNodeAddress)]) + assert.deepEqual(providers, [ethers.getAddress(config.neverminedNodeAddress)]) }) }) @@ -190,21 +191,21 @@ function makeTest(isCustom) { it('I check the details of the NFT', async () => { await nevermined.assets.resolve(ddo.id, DIDResolvePolicy.ImmutableFirst) const details = await nevermined.nfts1155.details(ddo.id) - assert.equal(details.mintCap.toNumber(), 5) - assert.equal(details.nftSupply.toNumber(), 5) + assert.equal(details.mintCap, 5n) + assert.equal(details.nftSupply, 5n) assert.equal(details.royaltyScheme, RoyaltyKind.Standard) assert.equal(details.royalties, 100000) assert.equal(details.owner, artist.getId()) - assert.equal(details.mintCap.toNumber(), 5) - assert.equal(details.nftSupply.toNumber(), 5) + assert.equal(details.mintCap, 5n) + assert.equal(details.nftSupply, 5n) }) it('I am ordering the NFT', async () => { const collector1BalanceBefore = await token.balanceOf(collector1.getId()) + assert.isTrue(collector1BalanceBefore >= nftPrice) - assert.isTrue(collector1BalanceBefore.gte(nftPrice)) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) agreementId = await nevermined.nfts1155.order(ddo.id, numberEditions, collector1) @@ -213,7 +214,7 @@ function makeTest(isCustom) { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) console.debug( @@ -221,9 +222,10 @@ function makeTest(isCustom) { `${escrowPaymentConditionBalanceBefore} + ${nftPrice} == ${escrowPaymentConditionBalanceAfter}`, ) - assert.isTrue(collector1BalanceBefore.sub(nftPrice).eq(collector1BalanceAfter)) - assert.isTrue( - escrowPaymentConditionBalanceBefore.add(nftPrice).eq(escrowPaymentConditionBalanceAfter), + assert.equal(collector1BalanceBefore - nftPrice, collector1BalanceAfter) + assert.equal( + escrowPaymentConditionBalanceBefore + nftPrice, + escrowPaymentConditionBalanceAfter, ) }) @@ -232,7 +234,7 @@ function makeTest(isCustom) { const nftBalanceCollectorBefore = await nevermined.nfts1155.balance(ddo.id, collector1) console.debug( - `Contract balance ${await token.balanceOf(escrowPaymentCondition.getAddress())}`, + `Contract balance ${await token.balanceOf(await escrowPaymentCondition.getAddress())}`, ) const receipt = await nevermined.nfts1155.transfer( @@ -245,7 +247,9 @@ function makeTest(isCustom) { await sleep(DELAY) console.debug( - `Contract balance (after) ${await token.balanceOf(escrowPaymentCondition.getAddress())}`, + `Contract balance (after) ${await token.balanceOf( + await escrowPaymentCondition.getAddress(), + )}`, ) const nftBalanceArtistAfter = await nevermined.nfts1155.balance(ddo.id, artist) const nftBalanceCollectorAfter = await nevermined.nfts1155.balance(ddo.id, collector1) @@ -262,7 +266,7 @@ function makeTest(isCustom) { it('the artist asks and receives the payment', async () => { await sleep(DELAY) const escrowPaymentConditionBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) await sleep(DELAY) const receipt = await nevermined.nfts1155.releaseRewards( @@ -275,7 +279,7 @@ function makeTest(isCustom) { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) @@ -288,12 +292,10 @@ function makeTest(isCustom) { `${escrowPaymentConditionBefore} - ${nftPrice} == ${escrowPaymentConditionBalanceAfter}`, ) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(assetPrice1.getAmounts()[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(assetPrice1.getAmounts()[1]))) - assert.isTrue(initialBalances.collector1.sub(nftPrice).eq(collectorBalance)) - assert.isTrue( - escrowPaymentConditionBefore.sub(nftPrice).eq(escrowPaymentConditionBalanceAfter), - ) + assert.equal(receiver0Balance, initialBalances.artist + assetPrice1.getAmounts()[0]) + assert.equal(receiver1Balance, initialBalances.gallery + assetPrice1.getAmounts()[1]) + assert.equal(initialBalances.collector1 - nftPrice, collectorBalance) + assert.equal(escrowPaymentConditionBefore - nftPrice, escrowPaymentConditionBalanceAfter) }) }) @@ -333,13 +335,13 @@ function makeTest(isCustom) { assert.isDefined(ddo) const balance = await nevermined.nfts1155.balance(ddo.id, artist) - assert.deepEqual(balance, BigNumber.from(5)) + assert.equal(balance, 5n) await nevermined.nfts1155.setApprovalForAll(config.neverminedNodeAddress, true, artist) }) it('The collector orders the nft', async () => { - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) agreementId = await nevermined.nfts1155.order(ddo.id, numberEditions, collector1) assert.isDefined(agreementId) @@ -371,7 +373,7 @@ function makeTest(isCustom) { describe('As a collector I should not be able to buy a sold out nft', () => { it('The artist gives the Node permissions to transfer his nfts', async () => { - const message = 'shold throw this error message' + const message = 'should throw this error message' try { await nevermined.nfts1155.setApprovalForAll(config.neverminedNodeAddress, true, artist) @@ -394,7 +396,7 @@ function makeTest(isCustom) { const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(1), + cap: 1n, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) @@ -402,11 +404,11 @@ function makeTest(isCustom) { assert.isDefined(ddo) const balance = await nevermined.nfts1155.balance(ddo.id, artist) - assert.deepEqual(balance, BigNumber.from(1)) + assert.deepEqual(balance, 1n) }) it('Collector1 orders the nft', async () => { - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) agreementId = await nevermined.nfts1155.order(ddo.id, numberEditions, collector1) assert.isDefined(agreementId) @@ -417,7 +419,7 @@ function makeTest(isCustom) { agreementId, artist.getId(), collector1.getId(), - BigNumber.from(1), + 1n, ) assert.isTrue(result) }) @@ -429,11 +431,11 @@ function makeTest(isCustom) { it('The artist nft balance should be zero', async () => { const balance = await nevermined.nfts1155.balance(ddo.id, artist) - assert.deepEqual(balance, BigNumber.from(0)) + assert.equal(balance, 0n) }) it('Collector 2 setups a service agreement to buy the nft', async () => { - await collector2.requestTokens(nftPrice.div(scale)) + await collector2.requestTokens(nftPrice / scale) agreementId2 = await nevermined.nfts1155.order(ddo.id, numberEditions, collector2) assert.isDefined(agreementId2) @@ -441,12 +443,7 @@ function makeTest(isCustom) { it('The Node should not be able to transfer the nft', async () => { await assert.isRejected( - nevermined.nfts1155.claim( - agreementId2, - artist.getId(), - collector2.getId(), - BigNumber.from(1), - ), + nevermined.nfts1155.claim(agreementId2, artist.getId(), collector2.getId(), 1n), ) }) }) @@ -470,7 +467,7 @@ function makeTest(isCustom) { const nftContract = await Nft1155Contract.getInstance( (nevermined.keeper as any).instanceConfig, - nft.address, + await nft.getAddress(), ) await nevermined.contracts.loadNft1155(nftContract.address) @@ -478,12 +475,12 @@ function makeTest(isCustom) { const assetAttributes = AssetAttributes.getInstance({ metadata: getMetadata(), serviceTypes: ['nft-sales'], - price: new AssetPrice(artist.getId(), BigNumber.from(0)), + price: new AssetPrice(artist.getId(), 0n), }) const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(1), + cap: 1n, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) diff --git a/integration/nevermined/NFT721.test.ts b/integration/nevermined/NFT721.test.ts index 32e0aafab..a5b43f255 100644 --- a/integration/nevermined/NFT721.test.ts +++ b/integration/nevermined/NFT721.test.ts @@ -3,17 +3,16 @@ import { decodeJwt, JWTPayload } from 'jose' import { config } from '../config' import { getMetadata } from '../utils' import { Nevermined, Account, DDO, NFTAttributes, AssetPrice } from '../../src' -import { generateId, ZeroAddress, zeroX } from '../../src/utils' +import { generateId, parseEther, ZeroAddress, zeroX } from '../../src/utils' import { TokenUtils } from '../../src/nevermined' import { ethers } from 'ethers' import { ContractHandler, Nft721Contract, TransferNFT721Condition } from '../../src/keeper' -import { BigNumber } from '../../src/utils' describe('Nfts721 operations', async () => { let nevermined: Nevermined let transferNft721Condition: TransferNFT721Condition - let nft: ethers.Contract + let nft: ethers.BaseContract let nftContract: Nft721Contract let deployer: Account @@ -48,7 +47,7 @@ describe('Nfts721 operations', async () => { ]) nftContract = await Nft721Contract.getInstance( (nevermined.keeper as any).instanceConfig, - nft.address, + await nft.getAddress(), ) await nevermined.contracts.loadNft721(nftContract.address) @@ -73,23 +72,16 @@ describe('Nfts721 operations', async () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, serviceTypes: ['nft-sales', 'nft-access'], - nftContractAddress: nft.address, + nftContractAddress: await nft.getAddress(), }) assert.equal(nftAttributes.fulfillAccessTimelock, 0) ddo = await nevermined.nfts721.create(nftAttributes, artist) }) it('should clone an existing erc-721 nft contract', async () => { - const cloneAddress = await nftContract.createClone( - 'My New NFT', - 'xyz', - '', - BigNumber.from(10), - [], - artist, - ) + const cloneAddress = await nftContract.createClone('My New NFT', 'xyz', '', 10n, [], artist) assert.isDefined(cloneAddress) - console.log(`NFT (ERC-721) clonned into address ${cloneAddress}`) + console.log(`NFT (ERC-721) cloned into address ${cloneAddress}`) }) it('should mint and burn a nft token', async () => { @@ -104,7 +96,7 @@ describe('Nfts721 operations', async () => { console.log(`Checking owner of DID ${ddo.id}`) assert.equal(await nevermined.nfts721.ownerOfAsset(zeroX(ddo.shortId())), artist.getId()) - assert.isTrue(BigNumber.from(0).eq(await nevermined.nfts721.balanceOf(collector.getId()))) + assert.equal(await nevermined.nfts721.balanceOf(collector.getId()), 0n) // collector orders the nft const agreementId = await nevermined.nfts721.order(ddo.id, collector) @@ -113,7 +105,7 @@ describe('Nfts721 operations', async () => { await nevermined.nfts721.transfer(agreementId, ddo.id, artist) assert.equal(await nevermined.nfts721.ownerOfAsset(zeroX(ddo.shortId())), collector.getId()) - assert.isTrue(BigNumber.from(1).eq(await nevermined.nfts721.balanceOf(collector.getId()))) + assert.equal(await nevermined.nfts721.balanceOf(collector.getId()), 1n) // artist fetches the payment await nevermined.nfts721.releaseRewards(agreementId, ddo.id, artist) @@ -128,9 +120,9 @@ describe('Nfts721 operations', async () => { // artist creates the nft const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, - price: new AssetPrice().setTokenAddress(token.getAddress()), + price: new AssetPrice().setTokenAddress(await token.getAddress()), serviceTypes: ['nft-sales', 'nft-access'], - nftContractAddress: nft.address, + nftContractAddress: await nft.getAddress(), preMint: false, }) ddo = await nevermined.nfts721.create(nftAttributes, artist) @@ -163,16 +155,15 @@ describe('Nfts721 operations', async () => { metadata.userId = payload.sub // artist creates the nft - const assetPrice = new AssetPrice( - artist.getId(), - BigNumber.parseEther('0.1'), - ).setTokenAddress(ZeroAddress) // With ETH + const assetPrice = new AssetPrice(artist.getId(), parseEther('0.1')).setTokenAddress( + ZeroAddress, + ) // With ETH const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, price: assetPrice, serviceTypes: ['nft-sales', 'nft-access'], - nftContractAddress: nft.address, + nftContractAddress: await nft.getAddress(), preMint: false, }) ddo = await nevermined.nfts721.create(nftAttributes, artist) diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index 18b20b8fd..660aab91d 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -11,7 +11,6 @@ import { import { config } from '../config' import { getMetadata } from '../utils' import { ethers } from 'ethers' -import { BigNumber } from '../../src/utils' import '../globals' describe('NFTs721 Api End-to-End', () => { @@ -31,15 +30,15 @@ describe('NFTs721 Api End-to-End', () => { // Configuration of First Sale: // Artist -> Collector1, the gallery get a cut (25%) - let nftPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + let nftPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice1: AssetPrice let initialBalances: any - let scale: BigNumber + let scale: bigint - let nft: ethers.Contract + let nft: ethers.BaseContract let nftContract: Nft721Contract let payload: JWTPayload @@ -66,7 +65,7 @@ describe('NFTs721 Api End-to-End', () => { nftContract = await Nft721Contract.getInstance( (nevermined.keeper as any).instanceConfig, - nft.address, + await nft.getAddress(), ) await nevermined.contracts.loadNft721(nftContract.address) @@ -85,10 +84,10 @@ describe('NFTs721 Api End-to-End', () => { // components ;({ token } = nevermined.keeper) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - nftPrice = nftPrice.mul(scale) - amounts = amounts.map((v) => v.mul(scale)) + nftPrice = nftPrice * scale + amounts = amounts.map((v) => v * scale) receivers = [artist.getId(), gallery.getId()] assetPrice1 = new AssetPrice( new Map([ @@ -103,7 +102,9 @@ describe('NFTs721 Api End-to-End', () => { artist: await token.balanceOf(artist.getId()), collector1: await token.balanceOf(collector1.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } }) @@ -140,10 +141,10 @@ describe('NFTs721 Api End-to-End', () => { }) it('I am ordering the NFT', async () => { - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) const collector1BalanceBefore = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBefore.eq(initialBalances.collector1.add(nftPrice))) + assert.equal(initialBalances.collector1 + nftPrice, collector1BalanceBefore) agreementId = await nevermined.nfts721.order(ddo.id, collector1) @@ -151,7 +152,7 @@ describe('NFTs721 Api End-to-End', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceAfter.sub(initialBalances.collector1).eq(0)) + assert.equal(collector1BalanceAfter - initialBalances.collector1, 0n) }) it('The artist can check the payment and transfer the NFT to the collector', async () => { @@ -165,7 +166,7 @@ describe('NFTs721 Api End-to-End', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.nfts721.releaseRewards(agreementId, ddo.id, artist) @@ -173,21 +174,19 @@ describe('NFTs721 Api End-to-End', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) const collectorBalance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(assetPrice1.getAmounts()[0]))) + assert.equal(initialBalances.artist + assetPrice1.getAmounts()[0], receiver0Balance) + assert.equal(initialBalances.gallery + assetPrice1.getAmounts()[1], receiver1Balance) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(assetPrice1.getAmounts()[1]))) - - assert.isTrue(collectorBalance.sub(initialBalances.collector1).eq(0)) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(assetPrice1.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(collectorBalance - initialBalances.collector1, 0n) + assert.equal( + escrowPaymentConditionBalanceBefore - assetPrice1.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) }) diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index c21fdaccd..56beeae44 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -26,8 +26,8 @@ import { config } from '../config' import { NFT721Api } from '../../src' import { getMetadata } from '../utils' import { setNFTRewardsFromDDOByService } from '../../src/utils' -import { BigNumber } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' +import { EventLog } from 'ethers' describe('NFT721Templates E2E', () => { let nftContractOwner: Account @@ -71,20 +71,20 @@ describe('NFT721Templates E2E', () => { let agreementId2Seed: string // Configuration of First Sale: // Artist -> Collector1, the gallery get a cut (25%) - let nftPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + let nftPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice1: AssetPrice // Configuration of Sale in secondary market: // Collector1 -> Collector2, the artist get 10% royalties - let nftPrice2 = BigNumber.from(100) - let amounts2 = [BigNumber.from(90), BigNumber.from(10)] + let nftPrice2 = 100n + let amounts2 = [90n, 10n] let receivers2: string[] let assetPrice2: AssetPrice let initialBalances: any - let scale: BigNumber + let scale: bigint before(async () => { nevermined = await Nevermined.getInstance(config) @@ -115,7 +115,7 @@ describe('NFT721Templates E2E', () => { receivers2 = [collector1.getId(), artist.getId()] // load the nft contract at given address - nft = await nevermined.contracts.loadNft721(nftContract.address) + nft = await nevermined.contracts.loadNft721(await nftContract.getAddress()) nftContractOwner = new Account((await nft.nftContract.owner()) as string) // components @@ -135,12 +135,12 @@ describe('NFT721Templates E2E', () => { // templates ;({ nft721SalesTemplate, nft721AccessTemplate } = nevermined.keeper.templates) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - nftPrice = nftPrice.mul(scale) - amounts = amounts.map((v) => v.mul(scale)) - nftPrice2 = nftPrice2.mul(scale) - amounts2 = amounts2.map((v) => v.mul(scale)) + nftPrice = nftPrice * scale + amounts = amounts.map((v) => v * scale) + nftPrice2 = nftPrice2 * scale + amounts2 = amounts2.map((v) => v * scale) assetPrice1 = new AssetPrice( new Map([ @@ -165,7 +165,9 @@ describe('NFT721Templates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -244,14 +246,14 @@ describe('NFT721Templates E2E', () => { ), ) - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) const collector1BalanceBefore = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBefore.eq(initialBalances.collector1.add(nftPrice))) + assert.equal(initialBalances.collector1 + nftPrice, collector1BalanceBefore) - await token.approve(lockPaymentCondition.getAddress(), nftPrice, collector1) - await token.approve(escrowPaymentCondition.getAddress(), nftPrice, collector1) + await token.approve(await lockPaymentCondition.getAddress(), nftPrice, collector1) + await token.approve(await escrowPaymentCondition.getAddress(), nftPrice, collector1) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const result = await nft721SalesTemplate.createAgreementAndPay( @@ -262,14 +264,14 @@ describe('NFT721Templates E2E', () => { [0, 0, 0], collector1.getId(), 0, - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), amounts, receivers, collector1, ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdEscrow[1])).state, ConditionState.Unfulfilled, @@ -284,13 +286,12 @@ describe('NFT721Templates E2E', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector1BalanceAfter.sub(initialBalances.collector1).eq(0)) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .add(AssetPrice.sumAmounts(amounts)) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(collector1BalanceAfter, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore + AssetPrice.sumAmounts(amounts), + escrowPaymentConditionBalanceAfter, ) }) @@ -317,7 +318,7 @@ describe('NFT721Templates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) await escrowPaymentCondition.fulfill( agreementId, @@ -325,8 +326,8 @@ describe('NFT721Templates E2E', () => { amounts, receivers, collector1.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), conditionIdLockPayment[1], conditionIdTransferNFT[1], artist, @@ -336,19 +337,18 @@ describe('NFT721Templates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) const collectorBalance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(amounts[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(amounts[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector1).eq(0)) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(AssetPrice.sumAmounts(amounts)) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(initialBalances.artist + amounts[0], receiver0Balance) + assert.equal(initialBalances.gallery + amounts[1], receiver1Balance) + assert.equal(collectorBalance, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore - AssetPrice.sumAmounts(amounts), + escrowPaymentConditionBalanceAfter, ) }) }) @@ -375,7 +375,7 @@ describe('NFT721Templates E2E', () => { collector1, ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdNFTAccess[1])).state, @@ -429,8 +429,8 @@ describe('NFT721Templates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: await token.balanceOf(lockPaymentCondition.getAddress()), - escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.getAddress()), + lockPaymentCondition: await token.balanceOf(await lockPaymentCondition.getAddress()), + escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), } }) it('As collector2 I setup an agreement for buying an NFT from collector1', async () => { @@ -478,7 +478,7 @@ describe('NFT721Templates E2E', () => { collector2, ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdLockPayment2[1])).state, @@ -495,16 +495,16 @@ describe('NFT721Templates E2E', () => { }) it('As collector2 I am locking the payment', async () => { - await collector2.requestTokens(nftPrice2.div(scale)) + await collector2.requestTokens(nftPrice2 / scale) const collector2BalanceBefore = await token.balanceOf(collector2.getId()) - assert.isTrue(collector2BalanceBefore.eq(initialBalances.collector2.add(nftPrice2))) + assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) - await token.approve(lockPaymentCondition.getAddress(), nftPrice2, collector2) + await token.approve(await lockPaymentCondition.getAddress(), nftPrice2, collector2) await lockPaymentCondition.fulfill( agreementId2, ddo.shortId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), amounts2, receivers2, collector2, @@ -515,11 +515,12 @@ describe('NFT721Templates E2E', () => { const collector2BalanceAfter = await token.balanceOf(collector2.getId()) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector2BalanceAfter.sub(initialBalances.collector2).eq(0)) - assert.isTrue( - escrowPaymentConditionBalance.sub(initialBalances.escrowPaymentCondition).eq(nftPrice2), + assert.equal(collector2BalanceAfter, initialBalances.collector2) + assert.equal( + escrowPaymentConditionBalance - initialBalances.escrowPaymentCondition, + nftPrice2, ) }) @@ -555,8 +556,8 @@ describe('NFT721Templates E2E', () => { amounts2, receivers2, collector2.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), conditionIdLockPayment2[1], conditionIdTransferNFT2[1], collector1, @@ -566,18 +567,16 @@ describe('NFT721Templates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) const collectorBalance = await token.balanceOf(collector2.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.collector1.add(amounts2[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.artist.add(amounts2[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector2).eq(0)) - assert.isTrue( - escrowPaymentConditionBalance.sub(initialBalances.escrowPaymentCondition).eq(0), - ) + assert.equal(receiver0Balance, initialBalances.collector1 + amounts2[0]) + assert.equal(receiver1Balance, initialBalances.artist + amounts2[1]) + assert.equal(collectorBalance, initialBalances.collector2) + assert.equal(escrowPaymentConditionBalance, initialBalances.escrowPaymentCondition) }) }) }) @@ -590,7 +589,9 @@ describe('NFT721Templates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -624,12 +625,12 @@ describe('NFT721Templates E2E', () => { '', '0', ]) - nft = await nevermined.contracts.loadNft721(nftContract.address) + nft = await nevermined.contracts.loadNft721(await nftContract.getAddress()) nftContractOwner = new Account((await nft.nftContract.owner()) as string) await nft.nftContract.grantOperatorRole(transferNft721Condition.address, nftContractOwner) - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) }) describe('As an artist I want to register a new artwork', () => { @@ -656,9 +657,9 @@ describe('NFT721Templates E2E', () => { it('I am setting an agreement for buying a NFT and paying it in the same transaction', async () => { const collector1BalanceBefore = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector1BalanceBefore.eq(initialBalances.collector1.add(nftPrice))) + assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) const result = await nft721SalesTemplate.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, @@ -675,13 +676,12 @@ describe('NFT721Templates E2E', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector1BalanceAfter.sub(initialBalances.collector1).eq(0)) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .add(assetPrice1.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(collector1BalanceAfter, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore + assetPrice1.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) @@ -702,7 +702,7 @@ describe('NFT721Templates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.releaseNft721Reward( agreementId, @@ -712,19 +712,18 @@ describe('NFT721Templates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) const collectorBalance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(amounts[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(amounts[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector1).eq(0)) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(assetPrice1.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.artist + amounts[0]) + assert.equal(receiver1Balance, initialBalances.gallery + amounts[1]) + assert.equal(collectorBalance, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore - assetPrice1.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) }) @@ -779,9 +778,11 @@ describe('NFT721Templates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: Number(await token.balanceOf(lockPaymentCondition.getAddress())), + lockPaymentCondition: Number( + await token.balanceOf(await lockPaymentCondition.getAddress()), + ), escrowPaymentCondition: Number( - await token.balanceOf(escrowPaymentCondition.getAddress()), + await token.balanceOf(await escrowPaymentCondition.getAddress()), ), } setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) @@ -803,12 +804,13 @@ describe('NFT721Templates E2E', () => { }) it('As collector2 I am locking the payment', async () => { - await collector2.requestTokens(nftPrice2.div(scale)) + await collector2.requestTokens(nftPrice2 / scale) const collector2BalanceBefore = await token.balanceOf(collector2.getId()) - assert.isTrue(collector2BalanceBefore.eq(initialBalances.collector2.add(nftPrice2))) + assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) + const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.lockPayment( @@ -816,20 +818,19 @@ describe('NFT721Templates E2E', () => { ddo.shortId(), assetPrice2.getAmounts(), assetPrice2.getReceivers(), - token.getAddress(), + await token.getAddress(), collector2, ) assert.isTrue(receipt) const collector2BalanceAfter = await token.balanceOf(collector2.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector2BalanceAfter.sub(initialBalances.collector2).eq(0)) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .add(assetPrice2.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(collector2BalanceAfter, initialBalances.collector2) + assert.equal( + escrowPaymentConditionBalanceBefore + assetPrice2.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) @@ -850,7 +851,7 @@ describe('NFT721Templates E2E', () => { it('Collector1 and Artist get the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.releaseNft721Reward( agreementId2, @@ -860,19 +861,18 @@ describe('NFT721Templates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) const collectorBalance = await token.balanceOf(collector2.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.collector1.add(amounts2[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.artist.add(amounts2[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector2).eq(0)) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(assetPrice2.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.collector1 + amounts2[0]) + assert.equal(receiver1Balance, initialBalances.artist + amounts2[1]) + assert.equal(collectorBalance, initialBalances.collector2) + assert.equal( + escrowPaymentConditionBalanceBefore - assetPrice2.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) }) diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index 081b452f3..41cf2cf61 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -23,10 +23,10 @@ import { Token, } from '../../src/keeper' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' -import { BigNumber } from '../../src/utils' import { setNFTRewardsFromDDOByService } from '../../src/utils' import { config } from '../config' import { getMetadata } from '../utils' +import { EventLog } from 'ethers' describe('NFTTemplates E2E', () => { let owner: Account @@ -58,7 +58,7 @@ describe('NFTTemplates E2E', () => { let ddo: DDO const royalties = 10 // 10% of royalties in the secondary market - const cappedAmount = BigNumber.from(5) + const cappedAmount = 5n let agreementId: string let agreementAccessId: string let agreementId2: string @@ -68,22 +68,22 @@ describe('NFTTemplates E2E', () => { // Configuration of First Sale: // Artist -> Collector1, the gallery get a cut (25%) - const numberNFTs = BigNumber.from(1) - let nftPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + const numberNFTs = 1n + let nftPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice1: AssetPrice // Configuration of Sale in secondary market: // Collector1 -> Collector2, the artist get 10% royalties - const numberNFTs2 = BigNumber.from(1) - let nftPrice2 = BigNumber.from(100) - let amounts2 = [BigNumber.from(90), BigNumber.from(10)] + const numberNFTs2 = 1n + let nftPrice2 = 100n + let amounts2 = [90n, 10n] let receivers2: string[] let assetPrice2: AssetPrice let initialBalances: any - let scale: BigNumber + let scale: bigint let royaltyAttributes: RoyaltyAttributes before(async () => { @@ -108,26 +108,26 @@ describe('NFTTemplates E2E', () => { // templates ;({ nftSalesTemplate, nftAccessTemplate } = nevermined.keeper.templates) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - nftPrice = nftPrice.mul(scale) - amounts = amounts.map((v) => v.mul(scale)) - nftPrice2 = nftPrice2.mul(scale) - amounts2 = amounts2.map((v) => v.mul(scale)) + nftPrice = nftPrice * scale + amounts = amounts.map((v) => v * scale) + nftPrice2 = nftPrice2 * scale + amounts2 = amounts2.map((v) => v * scale) assetPrice1 = new AssetPrice( new Map([ [receivers[0], amounts[0]], [receivers[1], amounts[1]], ]), - ).setTokenAddress(token.getAddress()) + ).setTokenAddress(await token.getAddress()) assetPrice2 = new AssetPrice( new Map([ [receivers2[0], amounts2[0]], [receivers2[1], amounts2[1]], ]), - ).setTokenAddress(token.getAddress()) + ).setTokenAddress(await token.getAddress()) }) describe('Full flow', () => { @@ -138,7 +138,9 @@ describe('NFTTemplates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } agreementIdSeed = generateId() @@ -185,10 +187,14 @@ describe('NFTTemplates E2E', () => { describe('As an artist I want to register a new artwork', () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll(transferNftCondition.getAddress(), true, artist) + await nftUpgradeable.setApprovalForAll( + await transferNftCondition.getAddress(), + true, + artist, + ) const balance = await nftUpgradeable.balance(artist.getId(), ddo.id) - assert.deepEqual(balance, BigNumber.from(5)) + assert.deepEqual(balance, 5n) }) }) @@ -238,7 +244,7 @@ describe('NFTTemplates E2E', () => { collector1, ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdLockPayment[1])).state, @@ -255,18 +261,18 @@ describe('NFTTemplates E2E', () => { }) it('I am locking the payment', async () => { - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) const escrowPaymentConditionBefore = await token.balanceOf(escrowPaymentCondition.address) const collector1BalanceBefore = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBefore.eq(initialBalances.collector1.add(nftPrice))) + assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) - await token.approve(lockPaymentCondition.getAddress(), nftPrice, collector1) - await token.approve(escrowPaymentCondition.getAddress(), nftPrice, collector1) + await token.approve(await lockPaymentCondition.getAddress(), nftPrice, collector1) + await token.approve(await escrowPaymentCondition.getAddress(), nftPrice, collector1) await lockPaymentCondition.fulfill( agreementId, ddo.id, - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), amounts, receivers, collector1, @@ -277,11 +283,11 @@ describe('NFTTemplates E2E', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.equal(collector1BalanceAfter.sub(initialBalances.collector1).toNumber(), 0) - assert.isTrue(escrowPaymentConditionBefore.add(nftPrice).eq(escrowPaymentConditionBalance)) + assert.equal(collector1BalanceAfter, initialBalances.collector1) + assert.equal(escrowPaymentConditionBefore + nftPrice, escrowPaymentConditionBalance) }) it('The artist can check the payment and transfer the NFT to the collector', async () => { @@ -317,7 +323,7 @@ describe('NFTTemplates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) await escrowPaymentCondition.fulfill( @@ -326,8 +332,8 @@ describe('NFTTemplates E2E', () => { amounts, receivers, collector1.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), conditionIdLockPayment[1], conditionIdTransferNFT[1], artist, @@ -337,19 +343,18 @@ describe('NFTTemplates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) const collectorBalance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(amounts[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(amounts[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector1).isZero()) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(AssetPrice.sumAmounts(amounts)) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.artist + amounts[0]) + assert.equal(receiver1Balance, initialBalances.gallery + amounts[1]) + assert.equal(collectorBalance, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore - AssetPrice.sumAmounts(amounts), + escrowPaymentConditionBalanceAfter, ) }) }) @@ -376,7 +381,7 @@ describe('NFTTemplates E2E', () => { collector1, ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdNFTAccess[1])).state, @@ -425,9 +430,11 @@ describe('NFTTemplates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: Number(await token.balanceOf(lockPaymentCondition.getAddress())), + lockPaymentCondition: Number( + await token.balanceOf(await lockPaymentCondition.getAddress()), + ), escrowPaymentCondition: Number( - await token.balanceOf(escrowPaymentCondition.getAddress()), + await token.balanceOf(await escrowPaymentCondition.getAddress()), ), } }) @@ -477,7 +484,7 @@ describe('NFTTemplates E2E', () => { collector2, ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdLockPayment2[1])).state, @@ -494,17 +501,17 @@ describe('NFTTemplates E2E', () => { }) it('As collector2 I am locking the payment', async () => { - await collector2.requestTokens(nftPrice2.div(scale)) + await collector2.requestTokens(nftPrice2 / scale) const escrowPaymentConditionBefore = await token.balanceOf(escrowPaymentCondition.address) const collector2BalanceBefore = await token.balanceOf(collector2.getId()) - assert.isTrue(collector2BalanceBefore.eq(initialBalances.collector2.add(nftPrice2))) + assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) - await token.approve(lockPaymentCondition.getAddress(), nftPrice2, collector2) + await token.approve(await lockPaymentCondition.getAddress(), nftPrice2, collector2) await lockPaymentCondition.fulfill( agreementId2, ddo.id, - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), amounts2, receivers2, collector2, @@ -515,10 +522,11 @@ describe('NFTTemplates E2E', () => { const collector2BalanceAfter = await token.balanceOf(collector2.getId()) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.equal(collector2BalanceAfter.sub(initialBalances.collector2).toNumber(), 0) - assert.isTrue(escrowPaymentConditionBefore.add(nftPrice2).eq(escrowPaymentConditionBalance)) + + assert.equal(collector2BalanceAfter, initialBalances.collector2) + assert.equal(escrowPaymentConditionBefore + nftPrice2, escrowPaymentConditionBalance) }) it('As collector1 I can check the payment and transfer the NFT to collector2', async () => { @@ -554,7 +562,7 @@ describe('NFTTemplates E2E', () => { it('Collector1 and Artist get the payment', async () => { const escrowPaymentConditionBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) await escrowPaymentCondition.fulfill( @@ -563,8 +571,8 @@ describe('NFTTemplates E2E', () => { amounts2, receivers2, collector2.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), conditionIdLockPayment2[1], conditionIdTransferNFT2[1], collector1, @@ -574,19 +582,18 @@ describe('NFTTemplates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) const collectorBalance = await token.balanceOf(collector2.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.collector1.add(amounts2[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.artist.add(amounts2[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector2).isZero()) - assert.isTrue( - escrowPaymentConditionBefore - .sub(AssetPrice.sumAmounts(amounts2)) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.collector1 + amounts2[0]) + assert.equal(receiver1Balance, initialBalances.artist + amounts2[1]) + assert.equal(collectorBalance, initialBalances.collector2) + assert.equal( + escrowPaymentConditionBefore - AssetPrice.sumAmounts(amounts2), + escrowPaymentConditionBalanceAfter, ) }) }) @@ -600,7 +607,9 @@ describe('NFTTemplates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -637,15 +646,19 @@ describe('NFTTemplates E2E', () => { }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) }) describe('As an artist I want to register a new artwork', () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll(transferNftCondition.getAddress(), true, artist) + await nftUpgradeable.setApprovalForAll( + await transferNftCondition.getAddress(), + true, + artist, + ) const balance = await nftUpgradeable.balance(artist.getId(), ddo.id) - assert.deepEqual(balance, BigNumber.from(5)) + assert.deepEqual(balance, 5n) }) }) @@ -653,7 +666,8 @@ describe('NFTTemplates E2E', () => { it('I am setting an agreement for buying a NFT', async () => { const escrowPaymentConditionBefore = await token.balanceOf(escrowPaymentCondition.address) const collector1BalanceBefore = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBefore.eq(initialBalances.collector1.add(nftPrice))) + assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) + const result = await nftSalesTemplate.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, @@ -670,10 +684,10 @@ describe('NFTTemplates E2E', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.equal(collector1BalanceAfter.sub(initialBalances.collector1).toNumber(), 0) - assert.isTrue(escrowPaymentConditionBalance.sub(nftPrice).eq(escrowPaymentConditionBefore)) + assert.equal(collector1BalanceAfter, initialBalances.collector1) + assert.equal(escrowPaymentConditionBalance - nftPrice, escrowPaymentConditionBefore) }) it('The artist can check the payment and transfer the NFT to the collector', async () => { @@ -703,7 +717,7 @@ describe('NFTTemplates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId, @@ -714,19 +728,18 @@ describe('NFTTemplates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) const collectorBalance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(amounts[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(amounts[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector1).isZero()) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(assetPrice1.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.artist + amounts[0]) + assert.equal(receiver1Balance, initialBalances.gallery + amounts[1]) + assert.equal(collectorBalance, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore - assetPrice1.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) }) @@ -781,9 +794,11 @@ describe('NFTTemplates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: Number(await token.balanceOf(lockPaymentCondition.getAddress())), + lockPaymentCondition: Number( + await token.balanceOf(await lockPaymentCondition.getAddress()), + ), escrowPaymentCondition: Number( - await token.balanceOf(escrowPaymentCondition.getAddress()), + await token.balanceOf(await escrowPaymentCondition.getAddress()), ), } setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) @@ -806,33 +821,33 @@ describe('NFTTemplates E2E', () => { }) it('As collector2 I am locking the payment', async () => { - await collector2.requestTokens(nftPrice2.div(scale)) + await collector2.requestTokens(nftPrice2 / scale) const collector2BalanceBefore = await token.balanceOf(collector2.getId()) - assert.isTrue(collector2BalanceBefore.eq(initialBalances.collector2.add(nftPrice2))) + assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.lockPayment( agreementId2, ddo.id, assetPrice2.getAmounts(), assetPrice2.getReceivers(), - token.getAddress(), + await token.getAddress(), collector2, ) assert.isTrue(receipt) const collector2BalanceAfter = await token.balanceOf(collector2.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector2BalanceAfter.sub(initialBalances.collector2).isZero()) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .add(assetPrice2.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + + assert.equal(collector2BalanceAfter, initialBalances.collector2) + assert.equal( + escrowPaymentConditionBalanceBefore + assetPrice2.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) @@ -864,7 +879,7 @@ describe('NFTTemplates E2E', () => { it('Collector1 and Artist get the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId2, @@ -875,19 +890,18 @@ describe('NFTTemplates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) const collectorBalance = await token.balanceOf(collector2.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.collector1.add(amounts2[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.artist.add(amounts2[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector2).isZero()) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(assetPrice2.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.collector1 + amounts2[0]) + assert.equal(receiver1Balance, initialBalances.artist + amounts2[1]) + assert.equal(collectorBalance, initialBalances.collector2) + assert.equal( + escrowPaymentConditionBalanceBefore - assetPrice2.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) }) @@ -900,7 +914,9 @@ describe('NFTTemplates E2E', () => { artist: await token.balanceOf(artist.getId()), collector1: await token.balanceOf(collector1.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -941,7 +957,7 @@ describe('NFTTemplates E2E', () => { describe('As an artist I want to register a new artwork', () => { it('I want to register a new artwork and give a Marketplace permissions to transfer it', async () => { const balance = await nftUpgradeable.balance(artist.getId(), ddo.id) - assert.deepEqual(balance, BigNumber.from(5)) + assert.equal(balance, 5n) await nevermined.nfts1155.setApprovalForAll(gallery.getId(), true, artist) }) @@ -965,33 +981,33 @@ describe('NFTTemplates E2E', () => { }) it('I am locking the payment', async () => { - await collector1.requestTokens(nftPrice.div(scale)) + await collector1.requestTokens(nftPrice / scale) const collector1BalanceBefore = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector1BalanceBefore.eq(initialBalances.collector1.add(nftPrice))) + assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) const receipt = await nevermined.agreements.conditions.lockPayment( agreementId, ddo.id, assetPrice1.getAmounts(), assetPrice1.getReceivers(), - token.getAddress(), + await token.getAddress(), collector1, ) assert.isTrue(receipt) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.equal(collector1BalanceAfter.sub(initialBalances.collector1).toNumber(), 0) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .add(assetPrice1.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + + assert.equal(collector1BalanceAfter, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore + assetPrice1.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) @@ -1022,7 +1038,7 @@ describe('NFTTemplates E2E', () => { it('The Market releases the rewards to the artist', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId, @@ -1034,19 +1050,18 @@ describe('NFTTemplates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) const collectorBalance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(amounts[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(amounts[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector1).isZero()) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(assetPrice1.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.artist + amounts[0]) + assert.equal(receiver1Balance, initialBalances.gallery + amounts[1]) + assert.equal(collectorBalance, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalanceBefore - assetPrice1.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) }) diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index 16210b4ad..1ca3ed44a 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -23,9 +23,9 @@ import { } from '../../src/keeper' import { config } from '../config' import { getMetadata } from '../utils' -import { ZeroAddress } from '../../src/utils' -import { BigNumber } from '../../src/utils' +import { ZeroAddress, parseEther } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' +import { EventLog } from 'ethers' describe('NFTTemplates With Ether E2E', async () => { let artist: Account @@ -54,7 +54,7 @@ describe('NFTTemplates With Ether E2E', async () => { let ddo: DDO const royalties = 10 // 10% of royalties in the secondary market - const cappedAmount = BigNumber.from(5) + const cappedAmount = 5n let agreementId: string let agreementAccessId: string @@ -64,12 +64,8 @@ describe('NFTTemplates With Ether E2E', async () => { const networkFee = 200000 // Configuration of First Sale: // Artist -> Collector1, the gallery get a cut (25%) - const numberNFTs = BigNumber.from(1) - const amounts = [ - BigNumber.parseEther('0.3'), - BigNumber.parseEther('0.1'), - BigNumber.parseEther('0.1'), - ] + const numberNFTs = 1n + const amounts = [parseEther('0.3'), parseEther('0.1'), parseEther('0.1')] let receivers: string[] let assetPrice: AssetPrice @@ -138,7 +134,7 @@ describe('NFTTemplates With Ether E2E', async () => { gallery: await gallery.getEtherBalance(), governor: await governor.getEtherBalance(), escrowPaymentCondition: await nevermined.accounts - .getAccount(escrowPaymentCondition.getAddress()) + .getAccount(await escrowPaymentCondition.getAddress()) .getEtherBalance(), } @@ -180,10 +176,14 @@ describe('NFTTemplates With Ether E2E', async () => { describe('As an artist I want to register a new artwork', async () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll(transferNftCondition.getAddress(), true, artist) + await nftUpgradeable.setApprovalForAll( + await transferNftCondition.getAddress(), + true, + artist, + ) const balance = await nftUpgradeable.balance(artist.getId(), ddo.shortId()) - assert.deepEqual(balance, BigNumber.from(5)) + assert.deepEqual(balance, 5n) }) }) @@ -236,7 +236,7 @@ describe('NFTTemplates With Ether E2E', async () => { ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdLockPayment[1])).state, @@ -256,7 +256,7 @@ describe('NFTTemplates With Ether E2E', async () => { await lockPaymentCondition.fulfill( agreementId, ddo.shortId(), - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), @@ -295,14 +295,8 @@ describe('NFTTemplates With Ether E2E', async () => { ddo.shortId(), ) - assert.equal( - Number(nftBalanceArtistAfter), - Number(nftBalanceArtistBefore) - Number(numberNFTs), - ) - assert.equal( - Number(nftBalanceCollectorAfter), - Number(nftBalanceCollectorBefore) + Number(numberNFTs), - ) + assert.equal(nftBalanceArtistAfter, nftBalanceArtistBefore - numberNFTs) + assert.equal(nftBalanceCollectorAfter, nftBalanceCollectorBefore + numberNFTs) }) it('the artist asks and receives the payment', async function () { @@ -312,7 +306,7 @@ describe('NFTTemplates With Ether E2E', async () => { assetPrice.getAmounts(), assetPrice.getReceivers(), collector1.getId(), - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ZeroAddress, conditionIdLockPayment[1], conditionIdTransferNFT[1], @@ -323,7 +317,7 @@ describe('NFTTemplates With Ether E2E', async () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalance = await nevermined.accounts - .getAccount(escrowPaymentCondition.getAddress()) + .getAccount(await escrowPaymentCondition.getAddress()) .getEtherBalance() const receiver0Balance = await nevermined.accounts .getAccount(receivers[0]) @@ -337,14 +331,12 @@ describe('NFTTemplates With Ether E2E', async () => { // for this assert we use a delta to account for the transaction fees // of all the transactions from the artist - const delta = BigNumber.from(10).pow(16) - assert.isTrue(receiver0Balance.gte(initialBalances.artist.add(amounts[0]).sub(delta))) + const delta = 10n ** 16n + assert.isTrue(receiver0Balance >= initialBalances.artist + amounts[0] - delta) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(amounts[1]))) - assert.isTrue(receiver2Balance.eq(initialBalances.governor.add(amounts[2]))) - assert.isTrue( - escrowPaymentConditionBalance.sub(initialBalances.escrowPaymentCondition).isZero(), - ) + assert.equal(receiver1Balance, initialBalances.gallery + amounts[1]) + assert.equal(receiver2Balance, initialBalances.governor + amounts[2]) + assert.equal(escrowPaymentConditionBalance, initialBalances.escrowPaymentCondition) }) }) @@ -369,7 +361,7 @@ describe('NFTTemplates With Ether E2E', async () => { [collector1.getId()], ) assert.equal(result.status, 1) - assert.isTrue(result.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(result.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) assert.equal( (await conditionStoreManager.getCondition(conditionIdNFTAccess[1])).state, diff --git a/integration/nevermined/Poap.test.ts b/integration/nevermined/Poap.test.ts index da4179770..39949d444 100644 --- a/integration/nevermined/Poap.test.ts +++ b/integration/nevermined/Poap.test.ts @@ -3,20 +3,21 @@ import TestContractHandler from '../../test/keeper/TestContractHandler' import { config } from '../config' import POAPUpgradeable from '../../test/resources/artifacts/NFT721SubscriptionUpgradeable.json' import { assert } from 'chai' -import { BigNumber, ethers } from 'ethers' +import { ethers } from 'ethers' import { getMetadata } from '../utils' -import { getRoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' +import { getRoyaltyAttributes, NFT721Api, RoyaltyKind } from '../../src/nevermined' import { decodeJwt } from 'jose' describe('POAPs with Assets', () => { let nevermined: Nevermined - let poapContract: ethers.Contract + let poapContract: ethers.BaseContract let editor: Account let user: Account let gatewayAddress: string let poapDDO: DDO let agreementId: string let metadata: MetaData + let nft721Api: NFT721Api before(async () => { nevermined = await Nevermined.getInstance(config) @@ -44,35 +45,31 @@ describe('POAPs with Assets', () => { ]) assert.isDefined(poapContract) - await nevermined.contracts.loadNft721(poapContract.address) + nft721Api = await nevermined.contracts.loadNft721(await poapContract.getAddress()) // INFO: We allow transferNFT condition to mint NFTs // Typically this only needs to happen once per NFT contract - const tx = await poapContract.grantOperatorRole( + const response = await nft721Api.grantOperatorRole( nevermined.keeper.conditions.transferNft721Condition.address, - { from: editor.getId() }, + editor, ) - const response = await tx.wait() assert.equal(response.status, 1) // INFO: We allow the gateway to fulfill the transfer condition in behalf of the user // Typically this only needs to happen once per NFT contract - const transactionResponse = await poapContract.setApprovalForAll(gatewayAddress, true, { - from: editor.getId(), - }) - await transactionResponse.wait() + await nft721Api.setApprovalForAll(gatewayAddress, true, editor) - const isApproved = await poapContract.isApprovedForAll(editor.getId(), gatewayAddress) + const isApproved = await nft721Api.isApprovedForAll(editor.getId(), gatewayAddress) assert.isTrue(isApproved) }) it('editor should be able to register poap', async () => { const nftAttributes = NFTAttributes.getPOAPInstance({ metadata, - price: new AssetPrice(editor.getId(), BigNumber.from(0), nevermined.utils.token.getAddress()), + price: new AssetPrice(editor.getId(), 0n, await nevermined.utils.token.getAddress()), serviceTypes: ['nft-sales', 'nft-access'], providers: [gatewayAddress], - nftContractAddress: poapContract.address, + nftContractAddress: await poapContract.getAddress(), preMint: false, nftTransfer: false, royaltyAttributes: getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, 0), @@ -93,8 +90,8 @@ describe('POAPs with Assets', () => { }) it('user should have a balance of 1 poap', async () => { - const balance = await poapContract.balanceOf(user.getId()) - assert.equal(balance.toNumber(), 1) + const balance = await nft721Api.balanceOf(user) + assert.equal(balance, 1n) }) it('user should have access', async () => { diff --git a/integration/nevermined/Provenance.test.ts b/integration/nevermined/Provenance.test.ts index 464af9396..13ece66c8 100644 --- a/integration/nevermined/Provenance.test.ts +++ b/integration/nevermined/Provenance.test.ts @@ -68,7 +68,7 @@ describe('Provenance', () => { intermediary.getId(), publisher.getId(), activitiesIds.intermediary, - ethers.utils.hexZeroPad('0x0', 32), + ethers.zeroPadValue('0x0', 32), 'FirstIntermediaryStuff', publisher, ) @@ -104,7 +104,7 @@ describe('Provenance', () => { ddo.shortId(), intermediary.getId(), activitiesIds.intermediary, - ethers.utils.hexZeroPad('0x0', 32), + ethers.zeroPadValue('0x0', 32), 'FirstIntermediaryStuff', intermediary, ) diff --git a/integration/nevermined/RegisterAccessTemplate.test.ts b/integration/nevermined/RegisterAccessTemplate.test.ts index 4067cc626..9d50446f6 100644 --- a/integration/nevermined/RegisterAccessTemplate.test.ts +++ b/integration/nevermined/RegisterAccessTemplate.test.ts @@ -12,8 +12,9 @@ import { AccessTemplate, } from '../../src/keeper' import { getMetadata } from '../utils' -import { generateId, BigNumber } from '../../src/utils' +import { generateId } from '../../src/utils' import { sleep } from '../utils/utils' +import { EventLog } from 'ethers' describe('Register Escrow Access Template', () => { let nevermined: Nevermined @@ -23,8 +24,8 @@ describe('Register Escrow Access Template', () => { const url = 'https://example.com/did/nevermined/test-attr-example.txt' const checksum = generateId() - const totalAmount = BigNumber.from(12) - const amounts = [BigNumber.from(10), BigNumber.from(2)] + const totalAmount = 12n + const amounts = [10n, 2n] let templateManagerOwner: Account let publisher: Account @@ -54,14 +55,18 @@ describe('Register Escrow Access Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { - await keeper.templateStoreManager.proposeTemplate(accessTemplate.getAddress(), consumer, true) + await keeper.templateStoreManager.proposeTemplate( + await accessTemplate.getAddress(), + consumer, + true, + ) // TODO: Use a event to detect template mined await sleep(2000) }) it('should approve the template', async () => { await keeper.templateStoreManager.approveTemplate( - accessTemplate.getAddress(), + await accessTemplate.getAddress(), templateManagerOwner, true, ) @@ -131,15 +136,15 @@ describe('Register Escrow Access Template', () => { assert.deepEqual( [...conditionTypes].sort(), [ - accessCondition.getAddress(), - escrowPaymentCondition.getAddress(), - lockPaymentCondition.getAddress(), + await accessCondition.getAddress(), + await escrowPaymentCondition.getAddress(), + await lockPaymentCondition.getAddress(), ].sort(), "The conditions doesn't match", ) }) - it('should have condition instances asociated', async () => { + it('should have condition instances associated', async () => { const conditionInstances = await accessTemplate.getConditions() assert.equal(conditionInstances.length, 3, 'Expected 3 conditions.') @@ -179,20 +184,20 @@ describe('Register Escrow Access Template', () => { Logger.error(error) } - await keeper.token.approve(lockPaymentCondition.getAddress(), totalAmount, consumer) + await keeper.token.approve(await lockPaymentCondition.getAddress(), totalAmount, consumer) const contractReceipt = await lockPaymentCondition.fulfill( agreementId, did, - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), amounts, receivers, consumer, ) assert.isTrue( - contractReceipt.events.some((e) => e.event === 'Fulfilled'), + contractReceipt.logs.some((e: EventLog) => e.eventName === 'Fulfilled'), 'Not Fulfilled event.', ) }) @@ -206,7 +211,7 @@ describe('Register Escrow Access Template', () => { ) assert.isTrue( - contractReceipt.events.some((e) => e.event === 'Fulfilled'), + contractReceipt.logs.some((e: EventLog) => e.eventName === 'Fulfilled'), 'Not Fulfilled event.', ) }) @@ -218,15 +223,15 @@ describe('Register Escrow Access Template', () => { amounts, receivers, consumer.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), conditionIdLock[1], conditionIdAccess[1], consumer, ) assert.isTrue( - contractReceipt.events.some((e) => e.event === 'Fulfilled'), + contractReceipt.logs.some((e: EventLog) => e.eventName === 'Fulfilled'), 'Not Fulfilled event.', ) }) @@ -293,7 +298,7 @@ describe('Register Escrow Access Template', () => { ddo.shortId(), amounts, receivers, - token.getAddress(), + await token.getAddress(), consumer, ) }) @@ -311,7 +316,7 @@ describe('Register Escrow Access Template', () => { receivers, consumer.getId(), ddo.shortId(), - token.getAddress(), + await token.getAddress(), publisher, ) }) diff --git a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts index 73195d269..6cd004478 100644 --- a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts @@ -18,7 +18,7 @@ import { Token } from '../../src/keeper' import { getMetadata } from '../utils' import { generateId } from '../../src/utils' import { sleep } from '../utils/utils' -import { BigNumber } from '../../src/utils' +import { EventLog } from 'ethers' describe('Register Escrow Compute Execution Template', () => { let nevermined: Nevermined @@ -29,8 +29,8 @@ describe('Register Escrow Compute Execution Template', () => { const url = 'https://example.com/did/nevermined/test-attr-example.txt' const checksum = generateId() - const totalAmount = BigNumber.from(12) - const amounts = [BigNumber.from(10), BigNumber.from(2)] + const totalAmount = 12n + const amounts = [10n, 2n] let templateManagerOwner: Account let publisher: Account @@ -63,7 +63,7 @@ describe('Register Escrow Compute Execution Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { await keeper.templateStoreManager.proposeTemplate( - escrowComputeExecutionTemplate.getAddress(), + await escrowComputeExecutionTemplate.getAddress(), consumer, true, ) @@ -73,7 +73,7 @@ describe('Register Escrow Compute Execution Template', () => { it('should approve the template', async () => { await keeper.templateStoreManager.approveTemplate( - escrowComputeExecutionTemplate.getAddress(), + await escrowComputeExecutionTemplate.getAddress(), templateManagerOwner, true, ) @@ -143,9 +143,9 @@ describe('Register Escrow Compute Execution Template', () => { assert.deepEqual( [...conditionTypes].sort(), [ - computeExecutionCondition.getAddress(), - escrowPaymentCondition.getAddress(), - lockPaymentCondition.getAddress(), + await computeExecutionCondition.getAddress(), + await escrowPaymentCondition.getAddress(), + await lockPaymentCondition.getAddress(), ].sort(), "The conditions doesn't match", ) @@ -199,20 +199,20 @@ describe('Register Escrow Compute Execution Template', () => { Logger.error(error) } - await keeper.token.approve(lockPaymentCondition.getAddress(), totalAmount, consumer) + await keeper.token.approve(await lockPaymentCondition.getAddress(), totalAmount, consumer) const contractReceipt = await lockPaymentCondition.fulfill( agreementId, did, - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), amounts, receivers, consumer, ) assert.isTrue( - contractReceipt.events.some((e) => e.event === 'Fulfilled'), + contractReceipt.logs.some((e: EventLog) => e.eventName === 'Fulfilled'), 'Not Fulfilled event.', ) }) @@ -226,7 +226,7 @@ describe('Register Escrow Compute Execution Template', () => { ) assert.isTrue( - contractReceipt.events.some((e) => e.event === 'Fulfilled'), + contractReceipt.logs.some((e: EventLog) => e.eventName === 'Fulfilled'), 'Not Fulfilled event.', ) }) @@ -238,15 +238,15 @@ describe('Register Escrow Compute Execution Template', () => { amounts, receivers, consumer.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), conditionIdLock[1], conditionIdCompute[1], consumer, ) assert.isTrue( - contractReceipt.events.some((e) => e.event === 'Fulfilled'), + contractReceipt.logs.some((e: EventLog) => e.eventName === 'Fulfilled'), 'Not Fulfilled event.', ) }) @@ -321,7 +321,7 @@ describe('Register Escrow Compute Execution Template', () => { ddo.shortId(), amounts, receivers, - token.getAddress(), + await token.getAddress(), consumer, ) }) @@ -340,7 +340,7 @@ describe('Register Escrow Compute Execution Template', () => { receivers, consumer.getId(), ddo.shortId(), - token.getAddress(), + await token.getAddress(), publisher, ) }) diff --git a/integration/nevermined/SdkWithoutArtifacts.test.ts b/integration/nevermined/SdkWithoutArtifacts.test.ts index 417274cee..65a66bf81 100644 --- a/integration/nevermined/SdkWithoutArtifacts.test.ts +++ b/integration/nevermined/SdkWithoutArtifacts.test.ts @@ -2,8 +2,7 @@ import { assert } from 'chai' import { decodeJwt } from 'jose' import { config } from '../config' import { Nevermined, SearchQuery, Account } from '../../src' -import { ethers } from 'ethers' -import { HDNode } from 'ethers/lib/utils' +import { HDNodeWallet, ethers } from 'ethers' describe('Sdk working without artifacts', () => { let nevermined: Nevermined @@ -21,7 +20,7 @@ describe('Sdk working without artifacts', () => { }) it('should login to metamask without artifacts', async () => { - const node = HDNode.fromMnemonic(process.env.SEED_WORDS) + const node = HDNodeWallet.fromPhrase(process.env.SEED_WORDS) const accounts: ethers.Wallet[] = [] for (let i = 0; i < 10; i++) { const acc = node.derivePath("m/44'/60'/0'/0/" + i) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index e233815c3..a9e9b74f0 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -24,12 +24,13 @@ import { import { fillConditionsWithDDO, findServiceConditionByName, + formatUnits, getAssetPriceFromService, + parseUnits, setNFTRewardsFromDDOByService, } from '../../src/utils' import { config } from '../config' import { getMetadata } from '../utils' -import { BigNumber } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' chai.use(chaiAsPromised) @@ -53,7 +54,7 @@ describe('Secondary Markets', () => { let ddo: DDO const royalties = 10 // 10% of royalties in the secondary market - const cappedAmount = BigNumber.from(5) + const cappedAmount = 5n let royaltyAttributes: RoyaltyAttributes let agreementId: string let agreementId2: string @@ -68,17 +69,17 @@ describe('Secondary Markets', () => { // Configuration of First Sale: // Artist -> Collector1, the gallery get a cut (25%) - const numberNFTs = BigNumber.from(1) - let nftPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + const numberNFTs = 1n + let nftPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice1: AssetPrice // Configuration of Sale in secondary market: // Collector1 -> Collector2, the artist get 10% royalties - const numberNFTs2 = BigNumber.from(1) - let nftPrice2 = BigNumber.from(100) - let amounts2 = [BigNumber.from(90), BigNumber.from(10)] + const numberNFTs2 = 1n + let nftPrice2 = 100n + let amounts2 = [90n, 10n] let receivers2: string[] let receivers3: string[] let assetPrice2: AssetPrice @@ -87,8 +88,8 @@ describe('Secondary Markets', () => { let initialBalances: any let decimals: number - let nftBalanceCollector1Before: BigNumber - let nftBalanceCollector2Before: BigNumber + let nftBalanceCollector1Before: bigint + let nftBalanceCollector2Before: bigint before(async () => { nevermined = await Nevermined.getInstance(config) @@ -110,31 +111,31 @@ describe('Secondary Markets', () => { decimals = await token.decimals() - nftPrice = BigNumber.parseUnits(nftPrice.toString(), decimals) - amounts = amounts.map((v) => BigNumber.parseUnits(v.toString(), decimals)) - nftPrice2 = BigNumber.parseUnits(nftPrice2.toString(), decimals) - amounts2 = amounts2.map((v) => BigNumber.parseUnits(v.toString(), decimals)) + nftPrice = parseUnits(nftPrice.toString(), decimals) + amounts = amounts.map((v) => parseUnits(v.toString(), decimals)) + nftPrice2 = parseUnits(nftPrice2.toString(), decimals) + amounts2 = amounts2.map((v) => parseUnits(v.toString(), decimals)) assetPrice1 = new AssetPrice( new Map([ [receivers[0], amounts[0]], [receivers[1], amounts[1]], ]), - ).setTokenAddress(token.getAddress()) + ).setTokenAddress(await token.getAddress()) assetPrice2 = new AssetPrice( new Map([ [receivers2[0], amounts2[0]], [receivers2[1], amounts2[1]], ]), - ).setTokenAddress(token.getAddress()) + ).setTokenAddress(await token.getAddress()) assetPrice3 = new AssetPrice( new Map([ [receivers3[0], amounts2[0]], [receivers3[1], amounts2[1]], ]), - ).setTokenAddress(token.getAddress()) + ).setTokenAddress(await token.getAddress()) }) describe('Collector1 initiates the sales agreement', () => { @@ -145,7 +146,7 @@ describe('Secondary Markets', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.getAddress()), + escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), } agreementIdSeed = generateId() agreementId2Seed = generateId() @@ -196,10 +197,14 @@ describe('Secondary Markets', () => { describe('As an artist I want to register a new artwork', () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll(transferNftCondition.getAddress(), true, artist) + await nftUpgradeable.setApprovalForAll( + await transferNftCondition.getAddress(), + true, + artist, + ) const balance = await nftUpgradeable.balance(artist.getId(), ddo.id) - assert.deepEqual(balance, BigNumber.from(5)) + assert.equal(balance, 5n) }) }) @@ -221,28 +226,29 @@ describe('Secondary Markets', () => { }) it('I am locking the payment', async () => { - await collector1.requestTokens(BigNumber.formatUnits(nftPrice, decimals)) + await collector1.requestTokens(formatUnits(nftPrice, decimals)) const collector1BalanceBefore = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBefore.eq(initialBalances.collector1.add(nftPrice))) + assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) const receipt = await nevermined.agreements.conditions.lockPayment( agreementId, ddo.id, assetPrice1.getAmounts(), assetPrice1.getReceivers(), - token.getAddress(), + await token.getAddress(), collector1, ) assert.isTrue(receipt) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.equal(collector1BalanceAfter.sub(initialBalances.collector1).toNumber(), 0) - assert.isTrue( - escrowPaymentConditionBalance.sub(initialBalances.escrowPaymentCondition).eq(nftPrice), + assert.equal(collector1BalanceAfter, initialBalances.collector1) + assert.equal( + escrowPaymentConditionBalance - initialBalances.escrowPaymentCondition, + nftPrice, ) }) @@ -261,14 +267,8 @@ describe('Secondary Markets', () => { const nftBalanceArtistAfter = await nftUpgradeable.balance(artist.getId(), ddo.id) const nftBalanceCollectorAfter = await nftUpgradeable.balance(collector1.getId(), ddo.id) - assert.equal( - Number(nftBalanceArtistAfter), - Number(nftBalanceArtistBefore) - Number(numberNFTs), - ) - assert.equal( - Number(nftBalanceCollectorAfter), - Number(nftBalanceCollectorBefore) + Number(numberNFTs), - ) + assert.equal(nftBalanceArtistAfter, nftBalanceArtistBefore - numberNFTs) + assert.equal(nftBalanceCollectorAfter, nftBalanceCollectorBefore + numberNFTs) }) it('the artist asks and receives the payment', async () => { @@ -281,19 +281,16 @@ describe('Secondary Markets', () => { assert.isTrue(receipt) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) const collectorBalance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.artist.add(amounts[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.gallery.add(amounts[1]))) - assert.equal(collectorBalance.sub(initialBalances.collector1).toNumber(), 0) - assert.equal( - escrowPaymentConditionBalance.sub(initialBalances.escrowPaymentCondition).toNumber(), - 0, - ) + assert.equal(receiver0Balance, initialBalances.artist + amounts[0]) + assert.equal(receiver1Balance, initialBalances.gallery + amounts[1]) + assert.equal(collectorBalance, initialBalances.collector1) + assert.equal(escrowPaymentConditionBalance, initialBalances.escrowPaymentCondition) }) }) @@ -347,8 +344,8 @@ describe('Secondary Markets', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: await token.balanceOf(lockPaymentCondition.getAddress()), - escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.getAddress()), + lockPaymentCondition: await token.balanceOf(await lockPaymentCondition.getAddress()), + escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), } setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) }) @@ -364,7 +361,7 @@ describe('Secondary Markets', () => { nftSalesTemplateConditions, ddo, assetPrice2, - token.getAddress(), + await token.getAddress(), undefined, collector1.getId(), numberNFTs2, @@ -374,7 +371,7 @@ describe('Secondary Markets', () => { type: 'nft-sales', index: 6, serviceEndpoint: nevermined.services.node.getNftEndpoint(), - templateId: nftSalesTemplate.getAddress(), + templateId: await nftSalesTemplate.getAddress(), attributes: { main: { name: 'nftSalesAgreement', @@ -411,10 +408,10 @@ describe('Secondary Markets', () => { it('As collector2 I am locking the payment', async () => { // Collector2 gets the price from some marketplace // (query the service agreements from the metadata) - await collector2.requestTokens(BigNumber.formatUnits(nftPrice2, decimals)) + await collector2.requestTokens(formatUnits(nftPrice2, decimals)) const collector2BalanceBefore = await token.balanceOf(collector2.getId()) - assert.isTrue(collector2BalanceBefore.eq(initialBalances.collector2.add(nftPrice2))) + assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) // After fetching the previously created sales agreement const assetPriceFromServiceAgreement = getAssetPriceFromService(nftSalesServiceAgreement) @@ -432,11 +429,13 @@ describe('Secondary Markets', () => { const collector2BalanceAfter = await token.balanceOf(collector2.getId()) const escrowPaymentConditionBalance = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) - assert.isTrue(collector2BalanceAfter.sub(initialBalances.collector2).isZero()) - assert.isTrue( - escrowPaymentConditionBalance.sub(initialBalances.escrowPaymentCondition).eq(nftPrice2), + + assert.equal(collector2BalanceAfter, initialBalances.collector2) + assert.equal( + escrowPaymentConditionBalance - initialBalances.escrowPaymentCondition, + nftPrice2, ) }) @@ -471,7 +470,7 @@ describe('Secondary Markets', () => { const assetPriceFromServiceAgreement = getAssetPriceFromService(nftSalesServiceAgreement) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receipt = await nevermined.agreements.conditions.releaseNftReward( @@ -483,20 +482,19 @@ describe('Secondary Markets', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) const collectorBalance = await token.balanceOf(collector2.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.collector1.add(amounts2[0]))) - assert.isTrue(receiver1Balance.eq(initialBalances.artist.add(amounts2[1]))) - assert.isTrue(collectorBalance.sub(initialBalances.collector2).toNumber() === 0) + assert.equal(receiver0Balance, initialBalances.collector1 + amounts2[0]) + assert.equal(receiver1Balance, initialBalances.artist + amounts2[1]) + assert.equal(collectorBalance, initialBalances.collector2) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(assetPriceFromServiceAgreement.getTotalPrice()) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal( + escrowPaymentConditionBalanceBefore - assetPriceFromServiceAgreement.getTotalPrice(), + escrowPaymentConditionBalanceAfter, ) }) }) @@ -576,23 +574,19 @@ describe('Secondary Markets', () => { }) it('As collector1 I buy the secondary market NFT', async () => { - await collector1.requestTokens(BigNumber.formatUnits(nftPrice2, decimals)) + await collector1.requestTokens(formatUnits(nftPrice2, decimals)) nftBalanceCollector1Before = await nftUpgradeable.balance(collector1.getId(), ddo.id) nftBalanceCollector2Before = await nftUpgradeable.balance(collector2.getId(), ddo.id) - const result = await nevermined.nfts1155.buySecondaryMarketNft( - collector1, - BigNumber.from(1), - agreementId3, - ) + const result = await nevermined.nfts1155.buySecondaryMarketNft(collector1, 1n, agreementId3) assert.isTrue(result) }) it('As collector2 I see the bid locked and trigger the reward release', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const result = await nevermined.nfts1155.releaseSecondaryMarketRewards( @@ -605,30 +599,23 @@ describe('Secondary Markets', () => { const nftBalanceCollector1After = await nftUpgradeable.balance(collector1.getId(), ddo.id) const nftBalanceCollector2After = await nftUpgradeable.balance(collector2.getId(), ddo.id) - assert.equal( - Number(nftBalanceCollector1After), - Number(nftBalanceCollector1Before) + Number(numberNFTs2), - ) - assert.equal( - Number(nftBalanceCollector2After), - Number(nftBalanceCollector2Before) - Number(numberNFTs2), - ) + assert.equal(nftBalanceCollector1After, nftBalanceCollector1Before + numberNFTs2) + assert.equal(nftBalanceCollector2After, nftBalanceCollector2Before - numberNFTs2) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ) const receiver0Balance = await token.balanceOf(receivers3[0]) const receiver1Balance = await token.balanceOf(receivers3[1]) const artistBalance = await token.balanceOf(artist.getId()) const collector1Balance = await token.balanceOf(collector1.getId()) - assert.isTrue(receiver0Balance.eq(initialBalances.collector2.add(amounts2[0]))) - assert.isTrue(receiver1Balance.eq(artistBalance)) - assert.isTrue(collector1Balance.gte(BigNumber.from(nftPrice2))) - assert.isTrue( - escrowPaymentConditionBalanceBefore - .sub(AssetPrice.sumAmounts(amounts2)) - .eq(escrowPaymentConditionBalanceAfter), + assert.equal(receiver0Balance, initialBalances.collector2 + amounts2[0]) + assert.equal(receiver1Balance, artistBalance) + assert.isTrue(collector1Balance >= nftPrice2) + assert.equal( + escrowPaymentConditionBalanceBefore - AssetPrice.sumAmounts(amounts2), + escrowPaymentConditionBalanceAfter, ) }) }) diff --git a/integration/nevermined/SubgraphEvent.test.ts b/integration/nevermined/SubgraphEvent.test.ts index fcaaf3d5c..0dd6aa4e6 100644 --- a/integration/nevermined/SubgraphEvent.test.ts +++ b/integration/nevermined/SubgraphEvent.test.ts @@ -34,10 +34,7 @@ describe('SubgraphEvent', () => { value: true, }, }) - assert.strictEqual( - ethers.utils.getAddress(response.pop().to), - ethers.utils.getAddress(account.getId()), - ) + assert.strictEqual(ethers.getAddress(response.pop().to), ethers.getAddress(account.getId())) }) it('should be able to listen to events', async () => { diff --git a/integration/nevermined/SubscriptionDuration.test.ts b/integration/nevermined/SubscriptionDuration.test.ts index dbfe1e37e..b3e1a012a 100644 --- a/integration/nevermined/SubscriptionDuration.test.ts +++ b/integration/nevermined/SubscriptionDuration.test.ts @@ -3,7 +3,6 @@ import { Account, AssetPrice, DDO, NFTAttributes, Nevermined, SubscriptionNFTApi import TestContractHandler from '../../test/keeper/TestContractHandler' import { config } from '../config' import { getMetadata } from '../utils' -import { BigNumber } from 'ethers' describe('Subscription Durations', () => { let publisher: Account @@ -48,7 +47,7 @@ describe('Subscription Durations', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + price: new AssetPrice(publisher.getId(), 0n), serviceTypes: ['nft-sales'], providers: [config.neverminedNodeAddress], duration: 0, @@ -89,7 +88,7 @@ describe('Subscription Durations', () => { it('The subscriber should have an nft balance', async () => { const balance = await subscriptionNFT.balanceOf(subscriber.getId()) - assert.equal(balance.toNumber(), 1) + assert.equal(balance, 1n) }) it('The subscriber should have access to the dataset', async () => { @@ -133,7 +132,7 @@ describe('Subscription Durations', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + price: new AssetPrice(publisher.getId(), 0n), serviceTypes: ['nft-sales'], providers: [config.neverminedNodeAddress], duration: 1000, @@ -174,7 +173,7 @@ describe('Subscription Durations', () => { it('The subscriber should have an nft balance', async () => { const balance = await subscriptionNFT.balanceOf(subscriber.getId()) - assert.equal(balance.toNumber(), 1) + assert.equal(balance, 1n) }) it('The subscriber should have access to the dataset', async () => { @@ -218,7 +217,7 @@ describe('Subscription Durations', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + price: new AssetPrice(publisher.getId(), 0n), serviceTypes: ['nft-sales'], providers: [config.neverminedNodeAddress], duration: 1, @@ -259,7 +258,7 @@ describe('Subscription Durations', () => { it('The subscriber should NOT have an nft balance for subscribed subscription', async () => { const balance = await subscriptionNFT.balanceOf(subscriber.getId()) - assert.equal(balance.toNumber(), 0) + assert.equal(balance, 0n) }) it('The subscriber should NOT have access to the dataset of an expired subscription', async () => { diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index 9e72b3b6f..8606e7e80 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -8,7 +8,6 @@ import { config } from '../config' import { getMetadata } from '../utils' import TestContractHandler from '../../test/keeper/TestContractHandler' import { ethers } from 'ethers' -import { BigNumber } from '../../src/utils' import { didZeroX } from '../../src/utils' import { EventOptions } from '../../src/events' import { @@ -37,8 +36,8 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { // Configuration of First Sale: // Editor -> Subscriber, the Reseller get a cut (25%) - let subscriptionPrice = BigNumber.from(20) - let amounts = [BigNumber.from(15), BigNumber.from(5)] + let subscriptionPrice = 20n + let amounts = [15n, 5n] let receivers: string[] let assetPrice1: AssetPrice let royaltyAttributes: RoyaltyAttributes @@ -52,7 +51,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { const subscriptionDuration = 1000 // in blocks let initialBalances: any - let scale: BigNumber + let scale: bigint // let nft: ethers.Contract let subscriptionNFT: NFT721Api @@ -84,10 +83,10 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { // components ;({ token } = nevermined.keeper) - scale = BigNumber.from(10).pow(await token.decimals()) + scale = 10n ** BigInt(await token.decimals()) - subscriptionPrice = subscriptionPrice.mul(scale) - amounts = amounts.map((v) => v.mul(scale)) + subscriptionPrice = subscriptionPrice * scale + amounts = amounts.map((v) => v * scale) receivers = [editor.getId(), reseller.getId()] assetPrice1 = new AssetPrice( new Map([ @@ -102,7 +101,9 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { editor: await token.balanceOf(editor.getId()), subscriber: await token.balanceOf(subscriber.getId()), reseller: await token.balanceOf(reseller.getId()), - escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.getAddress())), + escrowPaymentCondition: Number( + await token.balanceOf(await escrowPaymentCondition.getAddress()), + ), } }) @@ -128,7 +129,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { await subscriptionNFT.grantOperatorRole(transferNft721Condition.address, editor) - assert.isTrue(BigNumber.from(0).eq(await subscriptionNFT.balanceOf(editor.getId()))) + assert.equal(await subscriptionNFT.balanceOf(editor.getId()), 0n) const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: subscriptionMetadata, @@ -143,8 +144,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, editor) - assert.isTrue(BigNumber.from(0).eq(await subscriptionNFT.balanceOf(editor.getId()))) - + assert.equal(await subscriptionNFT.balanceOf(editor.getId()), 0n) assert.isDefined(subscriptionDDO) }) @@ -180,10 +180,10 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { }) it('I am ordering the subscription NFT', async () => { - await subscriber.requestTokens(subscriptionPrice.div(scale)) + await subscriber.requestTokens(subscriptionPrice / scale) const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) - assert.isTrue(subscriberBalanceBefore.eq(initialBalances.subscriber.add(subscriptionPrice))) + assert.equal(subscriberBalanceBefore, initialBalances.subscriber + subscriptionPrice) agreementId = await nevermined.nfts721.order(subscriptionDDO.id, subscriber) @@ -191,13 +191,13 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) - assert.isTrue(subscriberBalanceAfter.sub(initialBalances.subscriber).eq(0)) + assert.equal(subscriberBalanceAfter, initialBalances.subscriber) }) it('The seller can check the payment and transfer the NFT to the subscriber', async () => { // Let's use the Node to mint the subscription and release the payments - assert.isTrue(BigNumber.from(0).eq(await subscriptionNFT.balanceOf(subscriber.getId()))) + assert.equal(await subscriptionNFT.balanceOf(subscriber.getId()), 0n) const receipt = await nevermined.nfts721.claim( agreementId, @@ -215,16 +215,15 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { const minted = await subscriptionNFT.getContract.getMintedEntries(subscriber.getId()) console.log(`Minted: ${JSON.stringify(minted)}`) - assert.isTrue(BigNumber.from(1).eq(await subscriptionNFT.balanceOf(subscriber.getId()))) + assert.equal(await subscriptionNFT.balanceOf(subscriber.getId()), 1n) }) it('the editor and reseller can receive their payment', async () => { const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) - assert.isTrue(receiver0Balance.eq(initialBalances.editor.add(assetPrice1.getAmounts()[0]))) - - assert.isTrue(receiver1Balance.eq(initialBalances.reseller.add(assetPrice1.getAmounts()[1]))) + assert.equal(receiver0Balance, initialBalances.editor + assetPrice1.getAmounts()[0]) + assert.equal(receiver1Balance, initialBalances.reseller + assetPrice1.getAmounts()[1]) }) it('the subscription can be checked on chain', async () => { @@ -261,14 +260,14 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { assert.equal(eventValues._did, didZeroX(subscriptionDDO.id)) // thegraph stores the addresses in lower case - assert.equal(ethers.utils.getAddress(eventValues._receiver), subscriber.getId()) + assert.equal(ethers.getAddress(eventValues._receiver), subscriber.getId()) }) }) describe('As subscriber I want to get access to assets include as part of my subscription', () => { it('The Subscriber should have an NFT balance', async () => { const balance = await subscriptionNFT.balanceOf(subscriber.getId()) - assert.equal(balance.toNumber(), 1) + assert.equal(balance, 1n) }) it('The collector access the files', async () => { @@ -305,7 +304,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { const nftAttributes = NFTAttributes.getSubscriptionInstance({ metadata: getMetadata(), - price: new AssetPrice(editor.getId(), BigNumber.from(0)), + price: new AssetPrice(editor.getId(), 0n), serviceTypes: ['nft-sales'], providers: [neverminedNodeAddress], duration: subscriptionDuration, diff --git a/integration/nevermined/TestEncoding.test.ts b/integration/nevermined/TestEncoding.test.ts index 4ce1215bc..1f2676c62 100644 --- a/integration/nevermined/TestEncoding.test.ts +++ b/integration/nevermined/TestEncoding.test.ts @@ -1,7 +1,6 @@ import { assert } from 'chai' import { Nevermined } from '../../src' import { LockPaymentCondition } from '../../src/keeper' -import { BigNumber } from '../../src/utils' import { config } from '../config' describe('Test Encoding', () => { @@ -9,7 +8,7 @@ describe('Test Encoding', () => { const agreementId = '0x6098b775850142a1bd13ceca600a1dfad5c58aae6cd8499c9f02c0cf1e052a17' const tokenAddress = '0x80163Dec819063F87ad4F1b6A24DA551C93c5777' - const amounts = [BigNumber.from(10), BigNumber.from(2)] + const amounts = [10n, 2n] const receivers = [ '0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e', '0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0', diff --git a/integration/nevermined/Web3Providers.test.ts b/integration/nevermined/Web3Providers.test.ts index 19dc92614..c17d3c713 100644 --- a/integration/nevermined/Web3Providers.test.ts +++ b/integration/nevermined/Web3Providers.test.ts @@ -6,15 +6,14 @@ import { getMetadata } from '../utils' import { Nevermined, Account, AssetAttributes } from '../../src' import * as keyFile from '../KeyFile.json' -import { ethers } from 'ethers' -import { HDNode } from 'ethers/lib/utils' +import { HDNodeWallet, ethers } from 'ethers' describe('Web3Providers', () => { let nevermined: Nevermined let account: Account it('should register an asset (mnemonic)', async () => { - const node = HDNode.fromMnemonic(process.env.SEED_WORDS) + const node = HDNodeWallet.fromPhrase(process.env.SEED_WORDS) const accounts: ethers.Wallet[] = [] for (let i = 0; i < 10; i++) { const acc = node.derivePath("m/44'/60'/0'/0/" + i) @@ -41,7 +40,10 @@ describe('Web3Providers', () => { it('should register an asset (keyfile)', async () => { // Get account from keyfile - const keyFileAccount = ethers.Wallet.fromEncryptedJsonSync(JSON.stringify(keyFile), 'test') + const keyFileAccount = ethers.Wallet.fromEncryptedJsonSync( + JSON.stringify(keyFile), + 'test', + ) as ethers.Wallet const accounts: ethers.Wallet[] = [keyFileAccount] config.accounts = accounts diff --git a/integration/tsconfig.json b/integration/tsconfig.json index 7286bef20..bd2f066ca 100644 --- a/integration/tsconfig.json +++ b/integration/tsconfig.json @@ -1,7 +1,9 @@ { "compilerOptions": { + "moduleResolution": "NodeNext", "resolveJsonModule": true, - "lib": ["es6", "es7", "dom"], + "lib": ["es6", "es7", "dom", "ES2020"], + "target": "ES2020", "noUnusedLocals": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true diff --git a/integration/utils/ddo-metadata-generator.ts b/integration/utils/ddo-metadata-generator.ts index 1f999b1ac..268bb803d 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/integration/utils/ddo-metadata-generator.ts @@ -1,5 +1,4 @@ import { MetaData, AssetPrice, ResourceAuthentication } from '../../src' -import { BigNumber } from '../../src/utils' const metadata: Partial = { main: { @@ -154,4 +153,4 @@ export const getMetadata = (nonce: string | number = Math.random(), name = 'Test generateMetadata(name, nonce) as MetaData export const getAssetPrice = (receiver: string) => - new AssetPrice(receiver, BigNumber.from('21' + '0'.repeat(18))) + new AssetPrice(receiver, BigInt('21' + '0'.repeat(18))) diff --git a/integration/utils/utils.ts b/integration/utils/utils.ts index 568208b0d..3da5cc433 100644 --- a/integration/utils/utils.ts +++ b/integration/utils/utils.ts @@ -47,7 +47,7 @@ export async function mineBlocks(nevermined: Nevermined, account: Account, block generateId(), account.getId(), account.getId(), - ethers.utils.hexZeroPad('0x0', 32), + ethers.zeroPadValue('0x0', 32), 'mining', account, ) diff --git a/package.json b/package.json index d774d58dd..d72cf0c73 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@commitlint/cli": "^17.4.2", "@commitlint/config-conventional": "^17.4.2", "@faker-js/faker": "^6.3.1", - "@opengsn/provider": "2.2.5", + "@opengsn/provider": "^3.0.0-beta.8", "@release-it/bumper": "^1.4.1", "@types/chai": "^4.2.12", "@types/chai-as-promised": "^7.1.3", diff --git a/scripts/generate-ddos.ts b/scripts/generate-ddos.ts index e94cad034..e6a53640a 100644 --- a/scripts/generate-ddos.ts +++ b/scripts/generate-ddos.ts @@ -5,7 +5,6 @@ import { generateId } from '../src/utils' import { config } from '../integration/config' import { getRoyaltyAttributes, RoyaltyKind } from '../src/nevermined/api/AssetsApi' import { NFTAttributes } from '../src/models/NFTAttributes' -import BigNumber from '../src/utils/BigNumber' import { decodeJwt } from 'jose' import * as fs from 'fs' @@ -105,8 +104,8 @@ const generateNftDDO = async ( const nftAttributes = NFTAttributes.getNFT1155Instance({ ...assetAttributes, nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: BigNumber.from(10), - amount: BigNumber.from(1), + cap: 10n, + amount: 1n, royaltyAttributes, preMint: true }) @@ -314,7 +313,7 @@ const main = async () => { const payload = decodeJwt(config.marketplaceAuthToken!) const userId = payload.sub! - const price = new AssetPrice(publisher.getId(), BigNumber.from(1)) + const price = new AssetPrice(publisher.getId(), 1n) const destination = process.argv[2] || process.cwd() console.log(process.argv) diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index 90cf3ecae..c1971dc07 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -20,7 +20,7 @@ export class ContractHandler extends Instantiable { protected static setContract( what: string, networkId: number, - contractInstance: ethers.Contract, + contractInstance: ethers.BaseContract, address?: string, ) { ContractHandler.contracts.set(this.getHash(what, networkId, address), contractInstance) @@ -30,7 +30,10 @@ export class ContractHandler extends Instantiable { return ContractHandler.contracts.has(this.getHash(what, networkId, address)) } - private static contracts: Map = new Map() + private static contracts: Map = new Map< + string, + ethers.BaseContract + >() private static getHash(what: string, networkId: number, address?: string): string { return address ? `${what}/#${networkId}/#${address}` : `${what}/#${networkId}` @@ -46,7 +49,7 @@ export class ContractHandler extends Instantiable { optional = false, artifactsFolder: string, address?: string, - ): Promise { + ): Promise { const networkId = await this.nevermined.keeper.getNetworkId() const where = (await this.nevermined.keeper.getNetworkName()).toLowerCase() try { @@ -167,7 +170,7 @@ export class ContractHandler extends Instantiable { networkId: number, artifactsFolder: string, address?: string, - ): Promise { + ): Promise { this.logger.debug(`Loading ${what} from ${where} and folder ${artifactsFolder}`) let artifact if (artifactsFolder.startsWith('http')) diff --git a/src/keeper/utils.ts b/src/keeper/utils.ts index 035c9b48f..d927e6984 100644 --- a/src/keeper/utils.ts +++ b/src/keeper/utils.ts @@ -76,8 +76,9 @@ export interface JsonRpcResponse { } export class Web3ProviderWrapper { - provider: ethers.JsonRpcProvider - constructor(provider: ethers.JsonRpcProvider) { + provider: ethers.JsonRpcProvider | ethers.BrowserProvider + + constructor(provider: ethers.JsonRpcProvider | ethers.BrowserProvider) { this.provider = provider } send( diff --git a/test/keeper/ContractEvent.test.ts b/test/keeper/ContractEvent.test.ts index d403df036..1665f427f 100644 --- a/test/keeper/ContractEvent.test.ts +++ b/test/keeper/ContractEvent.test.ts @@ -13,7 +13,7 @@ describe('ContractEvent', () => { let account2: Account let account3: Account let account4: Account - let web3: ethers.providers.JsonRpcProvider + let web3: ethers.JsonRpcProvider | ethers.BrowserProvider beforeEach(async () => { await TestContractHandler.prepareContracts() diff --git a/test/keeper/ContractHandler.test.ts b/test/keeper/ContractHandler.test.ts index 27ff3d1b1..288cd045d 100644 --- a/test/keeper/ContractHandler.test.ts +++ b/test/keeper/ContractHandler.test.ts @@ -1,8 +1,8 @@ import { assert } from 'chai' -import { FormatTypes, Interface } from 'ethers/lib/utils' import { ContractHandler } from '../../src/keeper' import { Nevermined } from '../../src/nevermined' import config from '../config' +import { ethers } from 'ethers' describe('ContractHandler', () => { let contractHandler: ContractHandler @@ -22,8 +22,8 @@ describe('ContractHandler', () => { 'NFT721SubscriptionUpgradeable', './test/resources/artifacts/', ) - const iface = new Interface(solidityABI.abi) - const output = iface.format(FormatTypes.full) + const iface = new ethers.Interface(solidityABI.abi) + const output = iface.format() assert(output) }) @@ -33,8 +33,8 @@ describe('ContractHandler', () => { './artifacts/', networkName, ) - const iface = new Interface(solidityABI.abi) - const output = iface.format(FormatTypes.full) + const iface = new ethers.Interface(solidityABI.abi) + const output = iface.format() assert(output) }) }) diff --git a/test/keeper/DIDRegistry.test.ts b/test/keeper/DIDRegistry.test.ts index 80d3cdf7c..c1b135b28 100644 --- a/test/keeper/DIDRegistry.test.ts +++ b/test/keeper/DIDRegistry.test.ts @@ -5,9 +5,8 @@ import { generateId } from '../../src/utils' import config from '../config' import TestContractHandler from './TestContractHandler' import { Logger, LogLevel } from '../../src/utils' -import { ContractReceipt, ethers } from 'ethers' +import { ContractTransactionReceipt, ethers, EventLog } from 'ethers' import { TxParameters, Web3Provider } from '../../src/keeper' -// import { NonceManager } from '@ethersproject/experimental' let nevermined: Nevermined let didRegistry: DIDRegistry @@ -18,7 +17,7 @@ describe('DIDRegistry', () => { await TestContractHandler.prepareContracts() nevermined = await Nevermined.getInstance(config) ;({ didRegistry } = nevermined.keeper) - checksum = ethers.utils.hexlify(ethers.utils.randomBytes(32)) + checksum = ethers.hexlify(ethers.randomBytes(32)) }) describe('#registerAttribute()', () => { @@ -26,7 +25,7 @@ describe('DIDRegistry', () => { const [ownerAccount] = await nevermined.accounts.list() const did = generateId() const data = 'my nice provider, is nice' - const contractReceipt: ContractReceipt = await didRegistry.registerAttribute( + const contractReceipt: ContractTransactionReceipt = await didRegistry.registerAttribute( did, checksum, [], @@ -34,7 +33,9 @@ describe('DIDRegistry', () => { ownerAccount.getId(), ) assert.equal(contractReceipt.status, 1) - assert.isTrue(contractReceipt.events.some((e) => e.event === 'DIDAttributeRegistered')) + assert.isTrue( + contractReceipt.logs.some((e: EventLog) => e.eventName === 'DIDAttributeRegistered'), + ) }) it('should register an attribute in a new did modifying the nonce', async () => { @@ -45,7 +46,7 @@ describe('DIDRegistry', () => { const txCount = await provider.getTransactionCount(ownerAccount.getId(), 'pending') const txParams: TxParameters = { nonce: txCount } - const contractReceipt: ContractReceipt = await didRegistry.registerAttribute( + const contractReceipt: ContractTransactionReceipt = await didRegistry.registerAttribute( did, checksum, [], @@ -54,7 +55,9 @@ describe('DIDRegistry', () => { txParams, ) assert.equal(contractReceipt.status, 1) - assert.isTrue(contractReceipt.events.some((e) => e.event === 'DIDAttributeRegistered')) + assert.isTrue( + contractReceipt.logs.some((e: EventLog) => e.eventName === 'DIDAttributeRegistered'), + ) }) }) @@ -73,7 +76,7 @@ describe('DIDRegistry', () => { it('should get 0x0 for a not registered did', async () => { const owner = await didRegistry.getDIDOwner(generateId()) - assert.equal(owner, ethers.constants.AddressZero) + assert.equal(owner, ethers.ZeroAddress) }) }) diff --git a/test/keeper/Keeper.test.ts b/test/keeper/Keeper.test.ts index e34ee4cb4..5f0dfebb5 100644 --- a/test/keeper/Keeper.test.ts +++ b/test/keeper/Keeper.test.ts @@ -50,7 +50,7 @@ describe('Keeper', () => { it('Get Network Fee', async () => { const networkFee = await keeper.nvmConfig.getNetworkFee() console.log(`NETWORK FEE = ${networkFee}`) - assert.isTrue(networkFee.eq(0)) + assert.equal(networkFee, 0n) }) it('Get Fee Receiver', async () => { @@ -67,7 +67,7 @@ describe('Keeper', () => { console.log(`NETWORK FEE = ${networkFee}`) console.log(`FEE RECEIVER = ${feeReceiver}`) - assert.isTrue(networkFee.eq(newNetworkFee)) + assert.equal(networkFee, BigInt(newNetworkFee)) assert.equal(feeReceiver, deployerAddress) }) }) diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index d15c1911a..a6498d8cc 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -4,12 +4,11 @@ import * as KeeperUtils from '../../src/keeper/utils' import Logger from '../../src/utils/Logger' import config from '../config' import { ZeroAddress } from '../../src/utils' -import { ContractReceipt, ethers } from 'ethers' -import { TransactionResponse } from '@ethersproject/abstract-provider' +import { ContractTransactionReceipt, ContractTransactionResponse, ethers } from 'ethers' import fs from 'fs' import { NeverminedOptions } from '../../src' -interface ContractTest extends ethers.Contract { +interface ContractTest extends ethers.BaseContract { testContract?: boolean $initialized?: boolean } @@ -18,12 +17,9 @@ export default abstract class TestContractHandler extends ContractHandler { public static async prepareContracts(): Promise { TestContractHandler.setConfig(config) - const [deployerAddress] = await TestContractHandler.addresses( - TestContractHandler.config, - TestContractHandler.web3, - ) - TestContractHandler.networkId = (await TestContractHandler.web3.getNetwork()).chainId - TestContractHandler.minter = ethers.utils.formatBytes32String('minter') + const [deployerAddress] = await TestContractHandler.addresses(TestContractHandler.config) + TestContractHandler.networkId = Number((await TestContractHandler.web3.getNetwork()).chainId) + TestContractHandler.minter = ethers.encodeBytes32String('minter') // deploy contracts await TestContractHandler.deployContracts(deployerAddress) @@ -56,7 +52,7 @@ export default abstract class TestContractHandler extends ContractHandler { ]) const dispenser = await TestContractHandler.deployContract('Dispenser', deployerAddress, [ - token.address, + await token.getAddress(), deployerAddress, ]) @@ -74,10 +70,12 @@ export default abstract class TestContractHandler extends ContractHandler { deployerAddress, ) const contract = token.connect(signer) - const args = [TestContractHandler.minter, dispenser.address] + const args = [TestContractHandler.minter, await dispenser.getAddress()] const methodSignature = ContractHandler.getSignatureOfMethod(contract, 'grantRole', args) - const transactionResponse: TransactionResponse = await contract[methodSignature](...args) - const contractReceipt: ContractReceipt = await transactionResponse.wait() + const transactionResponse: ContractTransactionResponse = await contract[methodSignature]( + ...args, + ) + const contractReceipt: ContractTransactionReceipt = await transactionResponse.wait() if (contractReceipt.status !== 1) { throw new Error('Error calling "grantRole" on "token"') } @@ -87,27 +85,29 @@ export default abstract class TestContractHandler extends ContractHandler { deployerAddress, ZeroAddress, ZeroAddress, - nvmConfig.address, - royalties.address, + await nvmConfig.getAddress(), + await royalties.getAddress(), ]) const erc1155 = await TestContractHandler.deployContract( 'NFT1155Upgradeable', deployerAddress, - [deployerAddress, didRegistry.address, 'Nevermined NFT1155', 'NVM', ''], + [deployerAddress, await didRegistry.getAddress(), 'Nevermined NFT1155', 'NVM', ''], ) const erc721 = await TestContractHandler.deployContract('NFT721Upgradeable', deployerAddress, [ deployerAddress, - didRegistry.address, + await didRegistry.getAddress(), 'Nevermined NFT721', 'NVM', '', 0, ]) - let transactionResponse: TransactionResponse = await didRegistry.setNFT1155(erc1155.address) - let contractReceipt: ContractReceipt = await transactionResponse.wait() + let transactionResponse: ContractTransactionResponse = await didRegistry.getFunction( + 'setNFT1155', + )(await erc1155.getAddress()) + let contractReceipt: ContractTransactionReceipt = await transactionResponse.wait() if (contractReceipt.status !== 1) { throw new Error('Error calling "setNFT1155" on "didRegistry"') } @@ -121,16 +121,16 @@ export default abstract class TestContractHandler extends ContractHandler { const conditionStoreManager = await TestContractHandler.deployContract( 'ConditionStoreManager', deployerAddress, - [deployerAddress, deployerAddress, nvmConfig.address], + [deployerAddress, deployerAddress, await nvmConfig.getAddress()], ) const agreementStoreManager = await TestContractHandler.deployContract( 'AgreementStoreManager', deployerAddress, [ deployerAddress, - conditionStoreManager.address, - templateStoreManager.address, - didRegistry.address, + await conditionStoreManager.getAddress(), + await templateStoreManager.getAddress(), + await didRegistry.getAddress(), ], ) @@ -138,33 +138,39 @@ export default abstract class TestContractHandler extends ContractHandler { const lockPaymentCondition = await TestContractHandler.deployContract( 'LockPaymentCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address, didRegistry.address], + [deployerAddress, await conditionStoreManager.getAddress(), await didRegistry.getAddress()], ) const accessCondition = await TestContractHandler.deployContract( 'AccessCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address, agreementStoreManager.address], + [ + deployerAddress, + await conditionStoreManager.getAddress(), + await agreementStoreManager.getAddress(), + ], ) const nftHolderCondition = await TestContractHandler.deployContract( 'NFTHolderCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address, erc1155.address], + [deployerAddress, await conditionStoreManager.getAddress(), await erc1155.getAddress()], ) const nft721HolderCondition = await TestContractHandler.deployContract( 'NFT721HolderCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address], + [deployerAddress, await conditionStoreManager.getAddress()], ) const nftLockCondition = await TestContractHandler.deployContract( 'NFTLockCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address, erc1155.address], + [deployerAddress, await conditionStoreManager.getAddress(), await erc1155.getAddress()], + ) + transactionResponse = await erc1155.getFunction('grantOperatorRole')( + await nftLockCondition.getAddress(), ) - transactionResponse = await erc1155.grantOperatorRole(nftLockCondition.address) contractReceipt = await transactionResponse.wait() if (contractReceipt.status !== 1) { throw new Error('Error calling "grantOperatorRole" on "erc1155"') @@ -173,7 +179,7 @@ export default abstract class TestContractHandler extends ContractHandler { const nftAcessCondition = await TestContractHandler.deployContract( 'NFTAccessCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address, didRegistry.address], + [deployerAddress, await conditionStoreManager.getAddress(), await didRegistry.getAddress()], ) const transferNft721Condition = await TestContractHandler.deployContract( @@ -181,10 +187,10 @@ export default abstract class TestContractHandler extends ContractHandler { deployerAddress, [ deployerAddress, - conditionStoreManager.address, - didRegistry.address, - erc721.address, - lockPaymentCondition.address, + await conditionStoreManager.getAddress(), + await didRegistry.getAddress(), + await erc721.getAddress(), + await lockPaymentCondition.getAddress(), ], ) @@ -193,19 +199,23 @@ export default abstract class TestContractHandler extends ContractHandler { deployerAddress, [ deployerAddress, - conditionStoreManager.address, - didRegistry.address, - erc1155.address, + await conditionStoreManager.getAddress(), + await didRegistry.getAddress(), + await erc1155.getAddress(), ZeroAddress, ], ) - transactionResponse = await erc1155.grantOperatorRole(transferNftCondition.address) + transactionResponse = await erc1155.getFunction('grantOperatorRole')( + await transferNftCondition.getAddress(), + ) contractReceipt = await transactionResponse.wait() if (contractReceipt.status !== 1) { throw new Error('Error calling "grantOperatorRole" on "erc721"') } - transactionResponse = await erc1155.grantOperatorRole(didRegistry.address) + transactionResponse = await erc1155.getFunction('grantOperatorRole')( + await didRegistry.getAddress(), + ) contractReceipt = await transactionResponse.wait() if (contractReceipt.status !== 1) { throw new Error('Error calling "grantOperatorRole" on "erc721"') @@ -214,93 +224,97 @@ export default abstract class TestContractHandler extends ContractHandler { const transferDidOwnershipCondition = await TestContractHandler.deployContract( 'TransferDIDOwnershipCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address, didRegistry.address], + [deployerAddress, await conditionStoreManager.getAddress(), await didRegistry.getAddress()], ) // Conditions rewards const escrowPaymentCondition = await TestContractHandler.deployContract( 'EscrowPaymentCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address], + [deployerAddress, await conditionStoreManager.getAddress()], ) // Templates await TestContractHandler.deployContract('AccessTemplate', deployerAddress, [ deployerAddress, - agreementStoreManager.address, - didRegistry.address, - accessCondition.address, - lockPaymentCondition.address, - escrowPaymentCondition.address, + await agreementStoreManager.getAddress(), + await didRegistry.getAddress(), + await accessCondition.getAddress(), + await lockPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ]) await TestContractHandler.deployContract('DIDSalesTemplate', deployerAddress, [ deployerAddress, - agreementStoreManager.address, - lockPaymentCondition.address, - transferDidOwnershipCondition.address, - escrowPaymentCondition.address, + await agreementStoreManager.getAddress(), + await lockPaymentCondition.getAddress(), + await transferDidOwnershipCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ]) await TestContractHandler.deployContract('NFTAccessTemplate', deployerAddress, [ deployerAddress, - agreementStoreManager.address, - nftHolderCondition.address, - nftAcessCondition.address, + await agreementStoreManager.getAddress(), + await nftHolderCondition.getAddress(), + await nftAcessCondition.getAddress(), ]) await TestContractHandler.deployContract('NFT721AccessTemplate', deployerAddress, [ deployerAddress, - agreementStoreManager.address, - nft721HolderCondition.address, - nftAcessCondition.address, + await agreementStoreManager.getAddress(), + await nft721HolderCondition.getAddress(), + await nftAcessCondition.getAddress(), ]) await TestContractHandler.deployContract('NFTSalesTemplate', deployerAddress, [ deployerAddress, - agreementStoreManager.address, - lockPaymentCondition.address, - transferNftCondition.address, - escrowPaymentCondition.address, + await agreementStoreManager.getAddress(), + await lockPaymentCondition.getAddress(), + await transferNftCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ]) await TestContractHandler.deployContract('NFT721SalesTemplate', deployerAddress, [ deployerAddress, - agreementStoreManager.address, - lockPaymentCondition.address, - transferNft721Condition.address, - escrowPaymentCondition.address, + await agreementStoreManager.getAddress(), + await lockPaymentCondition.getAddress(), + await transferNft721Condition.getAddress(), + await escrowPaymentCondition.getAddress(), ]) const aaveCollateralDepositCondition = await TestContractHandler.deployContract( 'AaveCollateralDepositCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address], + [deployerAddress, await conditionStoreManager.getAddress()], ) const aaveBorrowCondition = await TestContractHandler.deployContract( 'AaveBorrowCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address], + [deployerAddress, await conditionStoreManager.getAddress()], ) const aaveRepayCondition = await TestContractHandler.deployContract( 'AaveRepayCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address], + [deployerAddress, await conditionStoreManager.getAddress()], ) const aaveCollateralWithdrawCondition = await TestContractHandler.deployContract( 'AaveCollateralWithdrawCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address], + [deployerAddress, await conditionStoreManager.getAddress()], ) const nft721LockCondition = await TestContractHandler.deployContract( 'NFT721LockCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address], + [deployerAddress, await conditionStoreManager.getAddress()], ) const distributeNFTCollateralCondition = await TestContractHandler.deployContract( 'DistributeNFTCollateralCondition', deployerAddress, - [deployerAddress, conditionStoreManager.address, nft721LockCondition.address], + [ + deployerAddress, + await conditionStoreManager.getAddress(), + await nft721LockCondition.getAddress(), + ], ) const vaultLibrary = await TestContractHandler.deployContract( 'AaveCreditVault', @@ -312,20 +326,20 @@ export default abstract class TestContractHandler extends ContractHandler { await TestContractHandler.deployContract('AaveCreditTemplate', deployerAddress, [ deployerAddress, - agreementStoreManager.address, - nft721LockCondition.address, - aaveCollateralDepositCondition.address, - aaveBorrowCondition.address, - aaveRepayCondition.address, - aaveCollateralWithdrawCondition.address, - distributeNFTCollateralCondition.address, - vaultLibrary.address, + await agreementStoreManager.getAddress(), + await nft721LockCondition.getAddress(), + await aaveCollateralDepositCondition.getAddress(), + await aaveBorrowCondition.getAddress(), + await aaveRepayCondition.getAddress(), + await aaveCollateralWithdrawCondition.getAddress(), + await distributeNFTCollateralCondition.getAddress(), + await vaultLibrary.getAddress(), ]) } public static async findSignerStatic( config: NeverminedOptions, - web3: ethers.providers.JsonRpcProvider, + web3: ethers.JsonRpcProvider | ethers.BrowserProvider, from: string, ): Promise { for (const acc of config.accounts || []) { @@ -337,18 +351,8 @@ export default abstract class TestContractHandler extends ContractHandler { return web3.getSigner(from) } - public static async addresses( - config: NeverminedOptions, - web3: ethers.providers.JsonRpcProvider, - ): Promise { - let ethAccounts: string[] = [] - try { - ethAccounts = await web3.listAccounts() - } catch (e) { - // ignore - } - const addresses = await Promise.all((config.accounts || []).map((a) => a.getAddress())) - return addresses.concat(ethAccounts) + public static async addresses(config: NeverminedOptions): Promise { + return await Promise.all((config.accounts || []).map((a) => a.getAddress())) } private static async deployContract( @@ -362,7 +366,7 @@ export default abstract class TestContractHandler extends ContractHandler { // dont redeploy if there is already something loaded if (TestContractHandler.hasContract(name, where)) { - const contract: ethers.Contract = await ContractHandler.getContract(name, where) + const contract: ContractTest = ContractHandler.getContract(name, where) if (contract.testContract) { return { ...contract, $initialized: true } as any } @@ -406,13 +410,10 @@ export default abstract class TestContractHandler extends ContractHandler { args = [], tokens = {}, init = true, - ): Promise { + ): Promise { if (!from) { // eslint-disable-next-line @typescript-eslint/no-extra-semi - ;[from] = await TestContractHandler.addresses( - TestContractHandler.config, - TestContractHandler.web3, - ) + ;[from] = await TestContractHandler.addresses(TestContractHandler.config) } const sendConfig = { @@ -430,7 +431,7 @@ export default abstract class TestContractHandler extends ContractHandler { TestContractHandler.replaceTokens(artifact.bytecode, tokens), signer, ) - const initializeExists = tempContract.interface.fragments.some((f) => f.name === 'initialize') + const initializeExists = tempContract.interface.hasFunction('initialize') const isZos = initializeExists && init Logger.debug({ @@ -446,8 +447,8 @@ export default abstract class TestContractHandler extends ContractHandler { }) const argument = isZos ? [] : args - const contractInstance: ethers.Contract = await tempContract.deploy(...argument, sendConfig) - await contractInstance.deployTransaction.wait() + const contractInstance: ethers.BaseContract = await tempContract.deploy(...argument, sendConfig) + await contractInstance.waitForDeployment() if (isZos) { const methodSignature = TestContractHandler.getSignatureOfMethod( @@ -456,11 +457,11 @@ export default abstract class TestContractHandler extends ContractHandler { args, ) const contract = contractInstance.connect(signer) - const transactionResponse: TransactionResponse = await contract[methodSignature]( + const transactionResponse: ContractTransactionResponse = await contract[methodSignature]( ...args, sendConfig, ) - const contractReceipt: ContractReceipt = await transactionResponse.wait() + const contractReceipt: ContractTransactionReceipt = await transactionResponse.wait() if (contractReceipt.status !== 1) { throw new Error(`Error deploying contract ${artifact.name}`) } diff --git a/test/keeper/conditions/AaveBorrowCondition.test.ts b/test/keeper/conditions/AaveBorrowCondition.test.ts index cc5d24c80..d4ed24964 100644 --- a/test/keeper/conditions/AaveBorrowCondition.test.ts +++ b/test/keeper/conditions/AaveBorrowCondition.test.ts @@ -7,7 +7,6 @@ import { didZeroX } from '../../../src/utils' import { Account } from '../../../src/nevermined' import * as utils from '../../../src/utils' import { DIDRegistry } from '../../../src/keeper' -import { BigNumber } from '../../../src/utils' let condition: AaveBorrowCondition @@ -16,7 +15,7 @@ describe('AaveBorrowCondition', () => { let agreementId: string const vaultAddress = `0x${'a'.repeat(40)}` const assetToBorrow = `0x${'a'.repeat(40)}` - const amount = BigNumber.from('11000000000000000000') + const amount = 11000000000000000000n const interestRateMode = 1 let user: Account let nevermined: Nevermined diff --git a/test/keeper/conditions/AaveCollateralDepositCondition.test.ts b/test/keeper/conditions/AaveCollateralDepositCondition.test.ts index 3c7a8139e..cbfc25bbc 100644 --- a/test/keeper/conditions/AaveCollateralDepositCondition.test.ts +++ b/test/keeper/conditions/AaveCollateralDepositCondition.test.ts @@ -7,7 +7,6 @@ import { didZeroX } from '../../../src/utils' import { Account } from '../../../src/nevermined' import * as utils from '../../../src/utils' import { DIDRegistry } from '../../../src/keeper' -import { BigNumber } from '../../../src/utils' let condition: AaveCollateralDepositCondition @@ -17,8 +16,8 @@ describe('AaveCollateralDepositCondition', () => { const vaultAddress = `0x${'a'.repeat(40)}` const assetToDeposit = `0x${'b'.repeat(40)}` const assetToBorrow = `0x${'a'.repeat(40)}` - const depositAmount = BigNumber.from('7000000000000000000') - const borrowAmount = BigNumber.from('11000000000000000000') + const depositAmount = 7000000000000000000n + const borrowAmount = 11000000000000000000n const interestRateMode = 1 let user: Account let nevermined: Nevermined diff --git a/test/keeper/conditions/AaveRepayCondition.test.ts b/test/keeper/conditions/AaveRepayCondition.test.ts index 92265e0a7..9e82cd03d 100644 --- a/test/keeper/conditions/AaveRepayCondition.test.ts +++ b/test/keeper/conditions/AaveRepayCondition.test.ts @@ -7,7 +7,6 @@ import { didZeroX } from '../../../src/utils' import { Account } from '../../../src/nevermined' import * as utils from '../../../src/utils' import { DIDRegistry } from '../../../src/keeper' -import { BigNumber } from '../../../src/utils' let condition: AaveRepayCondition @@ -16,7 +15,7 @@ describe('AaveRepayCondition', () => { let agreementId: string const vaultAddress = `0x${'a'.repeat(40)}` const assetToRepay = `0x${'a'.repeat(40)}` - const amountToRepay = BigNumber.from('11000000000000000000') + const amountToRepay = 11000000000000000000n const interestRateMode = 1 let user: Account let nevermined: Nevermined diff --git a/test/keeper/conditions/EscrowPaymentCondition.test.ts b/test/keeper/conditions/EscrowPaymentCondition.test.ts index 7a51a9f09..c860c4ca6 100644 --- a/test/keeper/conditions/EscrowPaymentCondition.test.ts +++ b/test/keeper/conditions/EscrowPaymentCondition.test.ts @@ -1,7 +1,6 @@ import { assert } from 'chai' import { EscrowPaymentCondition, Token } from '../../../src/keeper' import { Nevermined } from '../../../src/nevermined' -import { BigNumber } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' @@ -11,7 +10,7 @@ let token: Token describe('EscrowPaymentCondition', () => { const agreementId = `0x${'a'.repeat(64)}` const did = `0x${'a'.repeat(64)}` - const amounts = [BigNumber.from(15), BigNumber.from(3)] + const amounts = [15n, 3n] const publisher = `0x${'a'.repeat(40)}` const consumer = `0x${'b'.repeat(40)}` const provider = `0x${'b'.repeat(40)}` diff --git a/test/keeper/conditions/LockPaymentCondition.test.ts b/test/keeper/conditions/LockPaymentCondition.test.ts index 49b120522..8be7124b7 100644 --- a/test/keeper/conditions/LockPaymentCondition.test.ts +++ b/test/keeper/conditions/LockPaymentCondition.test.ts @@ -10,7 +10,6 @@ import config from '../../config' import TestContractHandler from '../TestContractHandler' import { Account, AssetPrice } from '../../../src' import { generateId, ZeroAddress } from '../../../src/utils' -import { BigNumber } from '../../../src/utils' let conditionStoreManager: ConditionStoreManager let lockPaymentCondition: LockPaymentCondition @@ -23,7 +22,7 @@ let buyer: Account let seller: Account describe('LockPaymentCondition', () => { - const amount = BigNumber.from(15) + const amount = 15n let agreementId let did @@ -86,19 +85,23 @@ describe('LockPaymentCondition', () => { await conditionStoreManager.createCondition( conditionId, - lockPaymentCondition.getAddress(), + await lockPaymentCondition.getAddress(), owner, ) await buyer.requestTokens(assetPrice.getTotalPrice()) - await token.approve(lockPaymentCondition.getAddress(), assetPrice.getTotalPrice(), buyer) + await token.approve( + await lockPaymentCondition.getAddress(), + assetPrice.getTotalPrice(), + buyer, + ) await lockPaymentCondition.fulfill( agreementId, did, - escrowPaymentCondition.getAddress(), - token.getAddress(), + await escrowPaymentCondition.getAddress(), + await token.getAddress(), assetPrice.getAmounts(), assetPrice.getReceivers(), buyer, @@ -119,14 +122,14 @@ describe('LockPaymentCondition', () => { await conditionStoreManager.createCondition( conditionId, - lockPaymentCondition.getAddress(), + await lockPaymentCondition.getAddress(), owner, ) await lockPaymentCondition.fulfill( agreementId, did, - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), @@ -149,7 +152,7 @@ describe('LockPaymentCondition', () => { await conditionStoreManager.createCondition( conditionId, - lockPaymentCondition.getAddress(), + await lockPaymentCondition.getAddress(), owner, ) @@ -157,7 +160,7 @@ describe('LockPaymentCondition', () => { lockPaymentCondition.fulfill( agreementId, did, - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), @@ -179,7 +182,7 @@ describe('LockPaymentCondition', () => { await conditionStoreManager.createCondition( conditionId, - lockPaymentCondition.getAddress(), + await lockPaymentCondition.getAddress(), owner, ) @@ -187,12 +190,12 @@ describe('LockPaymentCondition', () => { lockPaymentCondition.fulfill( agreementId, did, - escrowPaymentCondition.getAddress(), + await escrowPaymentCondition.getAddress(), ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), buyer, - { value: String(assetPrice.getTotalPrice().sub(1)) }, + { value: String(assetPrice.getTotalPrice() - 1n) }, ), /Transaction value does not match amount/, ) diff --git a/test/keeper/conditions/NFT721LockCondition.test.ts b/test/keeper/conditions/NFT721LockCondition.test.ts index ac6f1caba..6d354a2ca 100644 --- a/test/keeper/conditions/NFT721LockCondition.test.ts +++ b/test/keeper/conditions/NFT721LockCondition.test.ts @@ -8,8 +8,7 @@ import config from '../../config' import TestContractHandler from '../TestContractHandler' import { NFT721Api } from '../../../src' import { DIDRegistry } from '../../../src/keeper' -import { Contract, ContractReceipt, Event } from 'ethers' -import { BigNumber } from '../../../src/utils' +import { ContractTransactionReceipt, EventLog, BaseContract } from 'ethers' chai.use(chaiAsPromised) @@ -19,7 +18,7 @@ describe('NFT721LockCondition', () => { let conditionStoreManager: ConditionStoreManager let didRegistry: DIDRegistry let nftContractAddress: string - let _nftContract: Contract + let _nftContract: BaseContract let nft721Wrapper: NFT721Api let lockAddress: Account let owner: Account @@ -52,7 +51,7 @@ describe('NFT721LockCondition', () => { '', 0, ]) - nft721Wrapper = await nevermined.contracts.loadNft721(_nftContract.address) + nft721Wrapper = await nevermined.contracts.loadNft721(await _nftContract.getAddress()) nftContractAddress = nft721Wrapper.address await nft721Wrapper.nftContract.grantOperatorRole(nft721LockCondition.address) }) @@ -63,7 +62,7 @@ describe('NFT721LockCondition', () => { did = await didRegistry.hashDID(didSeed, owner.getId()) await nft721Wrapper.mint(didZeroX(did), owner) - await nft721Wrapper.setApprovalForAll(nft721LockCondition.getAddress(), true, owner) + await nft721Wrapper.setApprovalForAll(await nft721LockCondition.getAddress(), true, owner) }) describe('#hashValues()', () => { @@ -91,7 +90,7 @@ describe('NFT721LockCondition', () => { ) const conditionId = await nft721LockCondition.generateId(agreementId, hashValues) await conditionStoreManager.createCondition(conditionId, nft721LockCondition.address, owner) - const contractReceipt: ContractReceipt = await nft721LockCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await nft721LockCondition.fulfill( agreementId, did, lockAddress.getId(), @@ -102,9 +101,11 @@ describe('NFT721LockCondition', () => { const { state } = await conditionStoreManager.getCondition(conditionId) assert.equal(state, ConditionState.Fulfilled) const nftBalance = await nft721Wrapper.balanceOf(lockAddress) - assert.deepEqual(nftBalance, BigNumber.from(1)) + assert.equal(nftBalance, 1n) - const event: Event = contractReceipt.events.find((e) => e.event === 'Fulfilled') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'Fulfilled', + ) as EventLog const { _agreementId, _did, _lockAddress, _conditionId, _amount, _nftContractAddress } = event.args diff --git a/test/keeper/conditions/NFTAccessCondition.test.ts b/test/keeper/conditions/NFTAccessCondition.test.ts index fb8251b6f..7a68af9a1 100644 --- a/test/keeper/conditions/NFTAccessCondition.test.ts +++ b/test/keeper/conditions/NFTAccessCondition.test.ts @@ -13,7 +13,7 @@ import { DIDRegistry } from '../../../src/keeper' import { didZeroX, zeroX } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' -import { ContractReceipt, Event } from 'ethers' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -44,7 +44,7 @@ describe('NFTAccessCondition', () => { ;[owner, grantee, templateId, other] = await nevermined.accounts.list() await conditionStoreManager.delegateCreateRole( - agreementStoreManager.getAddress(), + await agreementStoreManager.getAddress(), owner.getId(), ) @@ -101,14 +101,14 @@ describe('NFTAccessCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [nftAccessCondition.getAddress()], + [await nftAccessCondition.getAddress()], [hashValues], [0], [2], templateId, ) - const contractReceipt: ContractReceipt = await nftAccessCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await nftAccessCondition.fulfill( agreementId, did, grantee.getId(), @@ -117,7 +117,9 @@ describe('NFTAccessCondition', () => { const { state } = await conditionStoreManager.getCondition(conditionId) assert.equal(state, ConditionState.Fulfilled) - const event: Event = contractReceipt.events.find((e) => e.event === 'Fulfilled') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'Fulfilled', + ) as EventLog const { _agreementId, _documentId, _grantee, _conditionId } = event.args assert.equal(_agreementId, zeroX(agreementId)) @@ -138,7 +140,7 @@ describe('NFTAccessCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [nftAccessCondition.getAddress()], + [await nftAccessCondition.getAddress()], [hashValues], [0], [2], @@ -161,7 +163,7 @@ describe('NFTAccessCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [nftAccessCondition.getAddress()], + [await nftAccessCondition.getAddress()], [hashValues], [0], [2], diff --git a/test/keeper/conditions/NFTHolderCondition.test.ts b/test/keeper/conditions/NFTHolderCondition.test.ts index f405e71ee..f2cef6c2b 100644 --- a/test/keeper/conditions/NFTHolderCondition.test.ts +++ b/test/keeper/conditions/NFTHolderCondition.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Account, ConditionState, @@ -15,9 +14,9 @@ import { ConditionStoreManager, } from '../../../src/keeper' import { didZeroX, zeroX, generateId } from '../../../src/utils' -import { BigNumber } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -34,7 +33,7 @@ describe('NFTHolderCondition', () => { let didSeed: string const activityId = generateId() const value = 'https://nevermined.io/did/nevermined/test-attr-example.txt' - const amount = BigNumber.from(10) + const amount = 10n before(async () => { await TestContractHandler.prepareContracts() @@ -79,7 +78,7 @@ describe('NFTHolderCondition', () => { await conditionStoreManager.createCondition( conditionId, - nftHolderCondition.getAddress(), + await nftHolderCondition.getAddress(), owner, ) @@ -88,7 +87,7 @@ describe('NFTHolderCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, preMint: false, }) @@ -104,9 +103,9 @@ describe('NFTHolderCondition', () => { activityId, ) - await nftUpgradeable.mint(holder.getId(), did, BigNumber.from(10), owner.getId()) + await nftUpgradeable.mint(holder.getId(), did, 10n, owner.getId()) - const contractReceipt: ContractReceipt = await nftHolderCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await nftHolderCondition.fulfill( agreementId, did, holder.getId(), @@ -116,7 +115,9 @@ describe('NFTHolderCondition', () => { const { state } = await conditionStoreManager.getCondition(conditionId) assert.equal(state, ConditionState.Fulfilled) - const event: Event = contractReceipt.events.find((e) => e.event === 'Fulfilled') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'Fulfilled', + ) as EventLog const { _agreementId, _did, _address, _conditionId, _amount } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) @@ -133,7 +134,7 @@ describe('NFTHolderCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, preMint: false, }) await didRegistry.registerMintableDID( @@ -148,7 +149,7 @@ describe('NFTHolderCondition', () => { activityId, ) const did = await didRegistry.hashDID(didSeed, owner.getId()) - await nftUpgradeable.mint(holder.getId(), did, BigNumber.from(10), owner.getId()) + await nftUpgradeable.mint(holder.getId(), did, 10n, owner.getId()) await assert.isRejected( nftHolderCondition.fulfill( @@ -171,7 +172,7 @@ describe('NFTHolderCondition', () => { await conditionStoreManager.createCondition( conditionId, - nftHolderCondition.getAddress(), + await nftHolderCondition.getAddress(), owner, ) @@ -180,7 +181,7 @@ describe('NFTHolderCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, preMint: false, }) @@ -196,7 +197,7 @@ describe('NFTHolderCondition', () => { activityId, ) - await nftUpgradeable.mint(holder.getId(), did, BigNumber.from(1), owner.getId()) + await nftUpgradeable.mint(holder.getId(), did, 1n, owner.getId()) await assert.isRejected( nftHolderCondition.fulfill( diff --git a/test/keeper/conditions/NFTLockCondition.test.ts b/test/keeper/conditions/NFTLockCondition.test.ts index b288fce81..e794a5be5 100644 --- a/test/keeper/conditions/NFTLockCondition.test.ts +++ b/test/keeper/conditions/NFTLockCondition.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Account, ConditionState, @@ -15,9 +14,9 @@ import { ConditionStoreManager, } from '../../../src/keeper' import { didZeroX, zeroX, generateId } from '../../../src/utils' -import { BigNumber } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -35,7 +34,7 @@ describe('NFTLockCondition', () => { let didSeed: string const activityId = generateId() const value = 'https://nevermined.io/did/nevermined/test-attr-example.txt' - const amount = BigNumber.from(10) + const amount = 10n before(async () => { await TestContractHandler.prepareContracts() @@ -78,7 +77,7 @@ describe('NFTLockCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, amount, preMint: true, }) @@ -101,25 +100,29 @@ describe('NFTLockCondition', () => { await conditionStoreManager.createCondition(conditionId, nftLockCondition.address, owner) - const contractReceipt: ContractReceipt = await nftLockCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await nftLockCondition.fulfill( agreementId, did, rewardAddress.getId(), amount, ) + const { state } = await conditionStoreManager.getCondition(conditionId) assert.equal(state, ConditionState.Fulfilled) + const nftBalance = await nftUpgradeable.balance(rewardAddress.getId(), did) - assert.deepEqual(BigNumber.from(nftBalance), BigNumber.from(amount)) + assert.equal(nftBalance, amount) - const event: Event = contractReceipt.events.find((e) => e.event === 'Fulfilled') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'Fulfilled', + ) as EventLog const { _agreementId, _did, _lockAddress, _conditionId, _amount } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) assert.equal(_conditionId, conditionId) assert.equal(_lockAddress, rewardAddress.getId()) - assert.equal(Number(_amount), Number(amount)) + assert.equal(BigInt(_amount), amount) }) }) @@ -131,7 +134,7 @@ describe('NFTLockCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, amount, preMint: true, }) @@ -163,7 +166,7 @@ describe('NFTLockCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, amount, preMint: false, }) @@ -180,7 +183,7 @@ describe('NFTLockCondition', () => { activityId, ) const did = await didRegistry.hashDID(didSeed, owner.getId()) - await nftUpgradeable.mint(owner.getId(), did, BigNumber.from(1), owner.getId()) + await nftUpgradeable.mint(owner.getId(), did, 1n, owner.getId()) const hashValues = await nftLockCondition.hashValues(did, rewardAddress.getId(), amount) const conditionId = await nftLockCondition.generateId(agreementId, hashValues) @@ -188,7 +191,7 @@ describe('NFTLockCondition', () => { await conditionStoreManager.createCondition(conditionId, nftLockCondition.address, owner) await assert.isRejected( - nftLockCondition.fulfill(agreementId, did, rewardAddress.getId(), amount.add(1)), + nftLockCondition.fulfill(agreementId, did, rewardAddress.getId(), amount + 1n), /insufficient balance/, ) }) @@ -200,7 +203,7 @@ describe('NFTLockCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, amount, preMint: true, }) diff --git a/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts b/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts index c57a7ca78..29d68be1d 100644 --- a/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts +++ b/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Account, ConditionState, Nevermined } from '../../../src' import { AgreementStoreManager, @@ -13,6 +12,7 @@ import { import { didZeroX, zeroX, generateId } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -40,7 +40,7 @@ describe('TransferDIDOwnershipCondition', () => { ;[owner, receiver, templateId] = await nevermined.accounts.list() await conditionStoreManager.delegateCreateRole( - agreementStoreManager.getAddress(), + await agreementStoreManager.getAddress(), owner.getId(), ) @@ -54,7 +54,7 @@ describe('TransferDIDOwnershipCondition', () => { } await didRegistry.grantRegistryOperatorRole( - transferDidOwnershipCondition.getAddress(), + await transferDidOwnershipCondition.getAddress(), owner.getId(), ) }) @@ -105,7 +105,7 @@ describe('TransferDIDOwnershipCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [transferDidOwnershipCondition.getAddress()], + [await transferDidOwnershipCondition.getAddress()], [hashValues], [0], [2], @@ -120,17 +120,15 @@ describe('TransferDIDOwnershipCondition', () => { const storedDIDRegister: any = await didRegistry.getDIDRegister(did) assert.equal(storedDIDRegister.owner, owner.getId()) - const contractReceipt: ContractReceipt = await transferDidOwnershipCondition.fulfill( - agreementId, - did, - receiver.getId(), - owner, - ) + const contractReceipt: ContractTransactionReceipt = + await transferDidOwnershipCondition.fulfill(agreementId, did, receiver.getId(), owner) const { state } = await conditionStoreManager.getCondition(conditionId) assert.equal(state, ConditionState.Fulfilled) - const event: Event = contractReceipt.events.find((e) => e.event === 'Fulfilled') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'Fulfilled', + ) as EventLog const { _agreementId, _conditionId, _did, _receiver } = event.args assert.equal(_agreementId, zeroX(agreementId)) diff --git a/test/keeper/conditions/TransferNFTCondition.test.ts b/test/keeper/conditions/TransferNFTCondition.test.ts index c47c58fc4..36e6f1d95 100644 --- a/test/keeper/conditions/TransferNFTCondition.test.ts +++ b/test/keeper/conditions/TransferNFTCondition.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Account, ConditionState, @@ -17,9 +16,10 @@ import { TransferNFTCondition, ConditionStoreManager, } from '../../../src/keeper' -import { didZeroX, ZeroAddress, zeroX, generateId, BigNumber } from '../../../src/utils' +import { didZeroX, ZeroAddress, zeroX, generateId } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -44,8 +44,8 @@ describe('TransferNFTCondition', () => { const activityId = generateId() const value = 'https://nevermined.io/did/nevermined/test-attr-example.txt' - const nftAmount = BigNumber.from(2) - const amounts = [BigNumber.from(10)] + const nftAmount = 2n + const amounts = [10n] before(async () => { await TestContractHandler.prepareContracts() @@ -125,7 +125,7 @@ describe('TransferNFTCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(100), + cap: 100n, amount: nftAmount, preMint: false, }) @@ -145,8 +145,8 @@ describe('TransferNFTCondition', () => { await nftReceiver.requestTokens(10) await nevermined.keeper.token.approve( - lockPaymentCondition.getAddress(), - BigNumber.from(10), + await lockPaymentCondition.getAddress(), + 10n, nftReceiver, ) @@ -154,7 +154,7 @@ describe('TransferNFTCondition', () => { agreementId, did, escrowPaymentCondition.address, - token.getAddress(), + await token.getAddress(), amounts, receivers, nftReceiver, @@ -174,7 +174,7 @@ describe('TransferNFTCondition', () => { await conditionStoreManager.createCondition(conditionId, transferNftCondition.address, owner) - const contractReceipt: ContractReceipt = await transferNftCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await transferNftCondition.fulfill( agreementId, did, nftReceiver.getId(), @@ -185,14 +185,16 @@ describe('TransferNFTCondition', () => { ;({ state } = await conditionStoreManager.getCondition(conditionId)) assert.equal(state, ConditionState.Fulfilled) - const event: Event = contractReceipt.events.find((e) => e.event === 'Fulfilled') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'Fulfilled', + ) as EventLog const { _agreementId, _did, _receiver, _conditionId, _amount } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) assert.equal(_conditionId, conditionId) assert.equal(_receiver, nftReceiver.getId()) - assert.equal(Number(_amount), Number(nftAmount)) + assert.equal(BigInt(_amount), nftAmount) }) }) @@ -222,7 +224,7 @@ describe('TransferNFTCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(0), + cap: 0n, amount: nftAmount, preMint: false, }) @@ -266,7 +268,7 @@ describe('TransferNFTCondition', () => { await conditionStoreManager.createCondition(conditionId, transferNftCondition.address, owner) - const contractReceipt: ContractReceipt = await transferNftCondition.fulfill( + const contractReceipt: ContractTransactionReceipt = await transferNftCondition.fulfill( agreementId, did, nftReceiver.getId(), @@ -277,7 +279,9 @@ describe('TransferNFTCondition', () => { ;({ state } = await conditionStoreManager.getCondition(conditionId)) assert.equal(state, ConditionState.Fulfilled) - const event: Event = contractReceipt.events.find((e) => e.event === 'Fulfilled') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'Fulfilled', + ) as EventLog const { _agreementId, _did, _receiver, _conditionId, _amount } = event.args assert.equal(_agreementId, zeroX(agreementId)) @@ -314,7 +318,7 @@ describe('TransferNFTCondition', () => { ercType: 1155, nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, - cap: BigNumber.from(0), + cap: 0n, amount: nftAmount, preMint: false, }) @@ -334,8 +338,8 @@ describe('TransferNFTCondition', () => { await nftReceiver.requestTokens(10) await nevermined.keeper.token.approve( - lockPaymentCondition.getAddress(), - BigNumber.from(10), + await lockPaymentCondition.getAddress(), + 10n, nftReceiver, ) @@ -343,7 +347,7 @@ describe('TransferNFTCondition', () => { agreementId, did, lockPaymentCondition.address, - token.getAddress(), + await token.getAddress(), amounts, receivers, nftReceiver, diff --git a/test/keeper/templates/DIDSalesTemplate.test.ts b/test/keeper/templates/DIDSalesTemplate.test.ts index e92c6df19..62f5de0e7 100644 --- a/test/keeper/templates/DIDSalesTemplate.test.ts +++ b/test/keeper/templates/DIDSalesTemplate.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Nevermined, Account, ConditionState } from '../../../src' import { DIDRegistry } from '../../../src/keeper' import { @@ -12,6 +11,7 @@ import { import { didZeroX, zeroX, generateId } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -45,7 +45,7 @@ describe('DIDSalesTemplate', () => { timeOuts = [0, 0, 0] await conditionStoreManager.delegateCreateRole( - agreementStoreManager.getAddress(), + await agreementStoreManager.getAddress(), sender.getId(), ) }) @@ -91,8 +91,8 @@ describe('DIDSalesTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(didSalesTemplate.getAddress()) - await templateStoreManager.approveTemplate(didSalesTemplate.getAddress()) + await templateStoreManager.proposeTemplate(await didSalesTemplate.getAddress()) + await templateStoreManager.approveTemplate(await didSalesTemplate.getAddress()) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( @@ -113,7 +113,7 @@ describe('DIDSalesTemplate', () => { await didRegistry.registerAttribute(didSeed, checksum, [], url, sender.getId()) const did = await didRegistry.hashDID(didSeed, sender.getId()) - const contractReceipt: ContractReceipt = await didSalesTemplate.createAgreement( + const contractReceipt: ContractTransactionReceipt = await didSalesTemplate.createAgreement( agreementIdSeed, didZeroX(did), conditionIdSeeds, @@ -123,9 +123,11 @@ describe('DIDSalesTemplate', () => { sender, ) assert.equal(contractReceipt.status, 1) - assert.isTrue(contractReceipt.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(contractReceipt.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) - const event: Event = contractReceipt.events.find((e) => e.event === 'AgreementCreated') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'AgreementCreated', + ) as EventLog const { _agreementId, _did } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) diff --git a/test/keeper/templates/NFT721AccessTemplate.test.ts b/test/keeper/templates/NFT721AccessTemplate.test.ts index aaf271433..9c9575140 100644 --- a/test/keeper/templates/NFT721AccessTemplate.test.ts +++ b/test/keeper/templates/NFT721AccessTemplate.test.ts @@ -11,7 +11,7 @@ import { import { didZeroX, zeroX, generateId } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' -import { ContractReceipt, Event } from 'ethers' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -45,7 +45,7 @@ describe('NFT721AccessTemplate', () => { timeOuts = [0, 0] await conditionStoreManager.delegateCreateRole( - agreementStoreManager.getAddress(), + await agreementStoreManager.getAddress(), sender.getId(), ) }) @@ -87,8 +87,8 @@ describe('NFT721AccessTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(nft721AccessTemplate.getAddress()) - await templateStoreManager.approveTemplate(nft721AccessTemplate.getAddress()) + await templateStoreManager.proposeTemplate(await nft721AccessTemplate.getAddress()) + await templateStoreManager.approveTemplate(await nft721AccessTemplate.getAddress()) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( @@ -109,19 +109,22 @@ describe('NFT721AccessTemplate', () => { await didRegistry.registerAttribute(didSeed, checksum, [], url, sender.getId()) const did = await didRegistry.hashDID(didSeed, sender.getId()) - const contractReceipt: ContractReceipt = await nft721AccessTemplate.createAgreement( - agreementIdSeed, - didZeroX(did), - conditionIdSeeds, - timeLocks, - timeOuts, - [receiver.getId()], - sender, - ) + const contractReceipt: ContractTransactionReceipt = + await nft721AccessTemplate.createAgreement( + agreementIdSeed, + didZeroX(did), + conditionIdSeeds, + timeLocks, + timeOuts, + [receiver.getId()], + sender, + ) assert.equal(contractReceipt.status, 1) - assert.isTrue(contractReceipt.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(contractReceipt.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) - const event: Event = contractReceipt.events.find((e) => e.event === 'AgreementCreated') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'AgreementCreated', + ) as EventLog const { _agreementId, _did } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) diff --git a/test/keeper/templates/NFT721SalesTemplate.test.ts b/test/keeper/templates/NFT721SalesTemplate.test.ts index 565db0e7a..78c93faf8 100644 --- a/test/keeper/templates/NFT721SalesTemplate.test.ts +++ b/test/keeper/templates/NFT721SalesTemplate.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Account, ConditionState, Nevermined } from '../../../src' import { DIDRegistry, @@ -12,6 +11,7 @@ import { import { didZeroX, zeroX, generateId } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -45,7 +45,7 @@ describe('NFT721SalesTemplate', () => { timeOuts = [0, 0, 0] await conditionStoreManager.delegateCreateRole( - agreementStoreManager.getAddress(), + await agreementStoreManager.getAddress(), sender.getId(), ) }) @@ -91,8 +91,8 @@ describe('NFT721SalesTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(nft721SalesTemplate.getAddress()) - await templateStoreManager.approveTemplate(nft721SalesTemplate.getAddress()) + await templateStoreManager.proposeTemplate(await nft721SalesTemplate.getAddress()) + await templateStoreManager.approveTemplate(await nft721SalesTemplate.getAddress()) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( @@ -113,7 +113,7 @@ describe('NFT721SalesTemplate', () => { await didRegistry.registerAttribute(didSeed, checksum, [], url, sender.getId()) const did = await didRegistry.hashDID(didSeed, sender.getId()) - const contractReceipt: ContractReceipt = await nft721SalesTemplate.createAgreement( + const contractReceipt: ContractTransactionReceipt = await nft721SalesTemplate.createAgreement( agreementIdSeed, didZeroX(did), conditionIdSeeds, @@ -123,9 +123,11 @@ describe('NFT721SalesTemplate', () => { sender, ) assert.equal(contractReceipt.status, 1) - assert.isTrue(contractReceipt.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(contractReceipt.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) - const event: Event = contractReceipt.events.find((e) => e.event === 'AgreementCreated') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'AgreementCreated', + ) as EventLog const { _agreementId, _did } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) diff --git a/test/keeper/templates/NFTAccessTemplate.test.ts b/test/keeper/templates/NFTAccessTemplate.test.ts index 0072b46ae..977b9e80a 100644 --- a/test/keeper/templates/NFTAccessTemplate.test.ts +++ b/test/keeper/templates/NFTAccessTemplate.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Nevermined, Account, ConditionState } from '../../../src' import { DIDRegistry, @@ -12,6 +11,7 @@ import { import { didZeroX, zeroX, generateId } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -45,7 +45,7 @@ describe('NFTAccessTemplate', () => { timeOuts = [0, 0] await conditionStoreManager.delegateCreateRole( - agreementStoreManager.getAddress(), + await agreementStoreManager.getAddress(), sender.getId(), ) }) @@ -87,8 +87,8 @@ describe('NFTAccessTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(nftAccessTemplate.getAddress()) - await templateStoreManager.approveTemplate(nftAccessTemplate.getAddress()) + await templateStoreManager.proposeTemplate(await nftAccessTemplate.getAddress()) + await templateStoreManager.approveTemplate(await nftAccessTemplate.getAddress()) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( @@ -109,7 +109,7 @@ describe('NFTAccessTemplate', () => { await didRegistry.registerAttribute(didSeed, checksum, [], url, sender.getId()) const did = await didRegistry.hashDID(didSeed, sender.getId()) - const contractReceipt: ContractReceipt = await nftAccessTemplate.createAgreement( + const contractReceipt: ContractTransactionReceipt = await nftAccessTemplate.createAgreement( agreementIdSeed, didZeroX(did), conditionIdSeeds, @@ -119,9 +119,11 @@ describe('NFTAccessTemplate', () => { sender, ) assert.equal(contractReceipt.status, 1) - assert.isTrue(contractReceipt.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(contractReceipt.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) - const event: Event = contractReceipt.events.find((e) => e.event === 'AgreementCreated') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'AgreementCreated', + ) as EventLog const { _agreementId, _did } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) diff --git a/test/keeper/templates/NFTSalesTemplate.test.ts b/test/keeper/templates/NFTSalesTemplate.test.ts index c14756ebd..8b413bf29 100644 --- a/test/keeper/templates/NFTSalesTemplate.test.ts +++ b/test/keeper/templates/NFTSalesTemplate.test.ts @@ -1,6 +1,5 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' -import { ContractReceipt, Event } from 'ethers' import { Nevermined, Account, ConditionState } from '../../../src' import { DIDRegistry, @@ -12,6 +11,7 @@ import { import { didZeroX, zeroX, generateId } from '../../../src/utils' import config from '../../config' import TestContractHandler from '../TestContractHandler' +import { ContractTransactionReceipt, EventLog } from 'ethers' chai.use(chaiAsPromised) @@ -45,7 +45,7 @@ describe('NFTSalesTemplate', () => { timeOuts = [0, 0, 0] await conditionStoreManager.delegateCreateRole( - agreementStoreManager.getAddress(), + await agreementStoreManager.getAddress(), sender.getId(), ) }) @@ -91,8 +91,8 @@ describe('NFTSalesTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(nftSalesTemplate.getAddress()) - await templateStoreManager.approveTemplate(nftSalesTemplate.getAddress()) + await templateStoreManager.proposeTemplate(await nftSalesTemplate.getAddress()) + await templateStoreManager.approveTemplate(await nftSalesTemplate.getAddress()) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( @@ -113,7 +113,7 @@ describe('NFTSalesTemplate', () => { await didRegistry.registerAttribute(didSeed, checksum, [], url, sender.getId()) const did = await didRegistry.hashDID(didSeed, sender.getId()) - const contractReceipt: ContractReceipt = await nftSalesTemplate.createAgreement( + const contractReceipt: ContractTransactionReceipt = await nftSalesTemplate.createAgreement( agreementIdSeed, didZeroX(did), conditionIdSeeds, @@ -123,9 +123,11 @@ describe('NFTSalesTemplate', () => { sender, ) assert.equal(contractReceipt.status, 1) - assert.isTrue(contractReceipt.events.some((e) => e.event === 'AgreementCreated')) + assert.isTrue(contractReceipt.logs.some((e: EventLog) => e.eventName === 'AgreementCreated')) - const event: Event = contractReceipt.events.find((e) => e.event === 'AgreementCreated') + const event: EventLog = contractReceipt.logs.find( + (e: EventLog) => e.eventName === 'AgreementCreated', + ) as EventLog const { _agreementId, _did } = event.args assert.equal(_agreementId, zeroX(agreementId)) assert.equal(_did, didZeroX(did)) diff --git a/test/models/AssetRewards.test.ts b/test/models/AssetRewards.test.ts index b5d9af361..48b9f0471 100644 --- a/test/models/AssetRewards.test.ts +++ b/test/models/AssetRewards.test.ts @@ -1,17 +1,12 @@ import { assert } from 'chai' import { AssetPrice } from '../../src' -import { BigNumber } from '../../src/utils' describe('AssetPrice', () => { describe('Initialize asset rewards', () => { it('it initialize with an empty constructor', async () => { const assetPrice = new AssetPrice() - assert.equal( - 0, - assetPrice.getTotalPrice().toNumber(), - `Expected 0 got ${assetPrice.getTotalPrice()}`, - ) + assert.equal(0n, assetPrice.getTotalPrice(), `Expected 0 got ${assetPrice.getTotalPrice()}`) assert.equal( 0, assetPrice.getRewards().size, @@ -22,68 +17,48 @@ describe('AssetPrice', () => { }) it('it initialize with an address and amount', async () => { - const assetPrice = new AssetPrice('0x123', BigNumber.from(7)) + const assetPrice = new AssetPrice('0x123', 7n) - assert.equal( - 7, - assetPrice.getTotalPrice().toNumber(), - `Expected 7 got ${assetPrice.getTotalPrice()}`, - ) + assert.equal(7n, assetPrice.getTotalPrice(), `Expected 7 got ${assetPrice.getTotalPrice()}`) assert.equal( 1, assetPrice.getRewards().size, `Expected 1 size, got ${assetPrice.getRewards().size}`, ) - assert.equal( - 7, - assetPrice.getRewards().get('0x123').toNumber(), - `Expected 7 for address 0x123`, - ) + assert.equal(7n, assetPrice.getRewards().get('0x123'), `Expected 7 for address 0x123`) assert.equal('["7"]', assetPrice.getAmountsString()) assert.equal('["0x123"]', assetPrice.getReceiversString()) }) it('it initialize with a map', async () => { const rewardsMap = new Map([ - ['0x123', BigNumber.from(10)], - ['0x456', BigNumber.from(2)], + ['0x123', 10n], + ['0x456', 2n], ]) const assetPrice = new AssetPrice(rewardsMap) - assert.equal( - 12, - assetPrice.getTotalPrice().toNumber(), - `Expected 12 got ${assetPrice.getTotalPrice()}`, - ) + assert.equal(12n, assetPrice.getTotalPrice(), `Expected 12 got ${assetPrice.getTotalPrice()}`) assert.equal( 2, assetPrice.getRewards().size, `Expected 2 size, got ${assetPrice.getRewards().size}`, ) - assert.equal( - 10, - assetPrice.getRewards().get('0x123').toNumber(), - `Expected 10 for address 0x123`, - ) - assert.equal( - 2, - assetPrice.getRewards().get('0x456').toNumber(), - `Expected 2 for address 0x456`, - ) + assert.equal(10n, assetPrice.getRewards().get('0x123'), `Expected 10 for address 0x123`) + assert.equal(2n, assetPrice.getRewards().get('0x456'), `Expected 2 for address 0x456`) assert.equal('["10","2"]', assetPrice.getAmountsString()) assert.equal('["0x123","0x456"]', assetPrice.getReceiversString()) }) }) it('it uses a big number', async () => { - const rewardsMap = new Map([['0x123', BigNumber.from(1000000000000000)]]) + const rewardsMap = new Map([['0x123', 1000000000000000n]]) const assetPrice = new AssetPrice(rewardsMap) assert.equal( - 1000000000000000, - assetPrice.getTotalPrice().toNumber(), + 1000000000000000n, + assetPrice.getTotalPrice(), `Expected 1000000000000000 got ${assetPrice.getTotalPrice()}`, ) assert.equal( @@ -92,8 +67,8 @@ describe('AssetPrice', () => { `Expected 1 size, got ${assetPrice.getRewards().size}`, ) assert.equal( - 1000000000000000, - assetPrice.getRewards().get('0x123').toNumber(), + 1000000000000000n, + assetPrice.getRewards().get('0x123'), `Expected 1000000000000000 for address 0x123`, ) assert.equal('["1000000000000000"]', assetPrice.getAmountsString()) @@ -101,112 +76,77 @@ describe('AssetPrice', () => { }) it('it can add a receiver', async () => { - const rewardsMap = new Map([['0x123', BigNumber.from(500)]]) + const rewardsMap = new Map([['0x123', 500n]]) const assetPrice = new AssetPrice(rewardsMap) - assetPrice.setReceiver('0x456', BigNumber.from(100)) + assetPrice.setReceiver('0x456', 100n) - assert.equal( - 600, - assetPrice.getTotalPrice().toNumber(), - `Expected 600 got ${assetPrice.getTotalPrice()}`, - ) + assert.equal(600n, assetPrice.getTotalPrice(), `Expected 600 got ${assetPrice.getTotalPrice()}`) assert.equal( 2, assetPrice.getRewards().size, `Expected 2 size, got ${assetPrice.getRewards().size}`, ) - assert.equal( - 500, - assetPrice.getRewards().get('0x123').toNumber(), - `Expected 500 for address 0x123`, - ) - assert.equal( - 100, - assetPrice.getRewards().get('0x456').toNumber(), - `Expected 100 for address 0x456`, - ) + assert.equal(500n, assetPrice.getRewards().get('0x123'), `Expected 500 for address 0x123`) + assert.equal(100n, assetPrice.getRewards().get('0x456'), `Expected 100 for address 0x456`) assert.equal('["500","100"]', assetPrice.getAmountsString()) assert.equal('["0x123","0x456"]', assetPrice.getReceiversString()) }) it('it can add rewards to an existing receiver', async () => { const rewardsMap = new Map([ - ['0x123', BigNumber.from(500)], - ['0x789', BigNumber.from(500)], + ['0x123', 500n], + ['0x789', 500n], ]) const firstRewards = new AssetPrice(rewardsMap) - const assetPrice = firstRewards.setReceiver('0x123', BigNumber.from(100)) + const assetPrice = firstRewards.setReceiver('0x123', 100n) - assert.equal( - 600, - assetPrice.getTotalPrice().toNumber(), - `Expected 600 got ${assetPrice.getTotalPrice()}`, - ) + assert.equal(600n, assetPrice.getTotalPrice(), `Expected 600 got ${assetPrice.getTotalPrice()}`) assert.equal( 2, assetPrice.getRewards().size, `Expected 2 size, got ${assetPrice.getRewards().size}`, ) - assert.equal( - 100, - assetPrice.getRewards().get('0x123').toNumber(), - `Expected 600 for address 0x123`, - ) + assert.equal(100n, assetPrice.getRewards().get('0x123'), `Expected 600 for address 0x123`) assert.equal('["100","500"]', assetPrice.getAmountsString()) assert.equal('["0x123","0x789"]', assetPrice.getReceiversString()) }) it('it can add network fees', async () => { const rewardsMap = new Map([ - ['0x123', BigNumber.from(50)], - ['0x789', BigNumber.from(50)], + ['0x123', 50n], + ['0x789', 50n], ]) - const assetPrice = new AssetPrice(rewardsMap).addNetworkFees('0xfff', BigNumber.from(20000)) + const assetPrice = new AssetPrice(rewardsMap).addNetworkFees('0xfff', 20000n) - assert.equal( - 102, - assetPrice.getTotalPrice().toNumber(), - `Expected 102 got ${assetPrice.getTotalPrice()}`, - ) + assert.equal(102n, assetPrice.getTotalPrice(), `Expected 102 got ${assetPrice.getTotalPrice()}`) assert.equal( 3, assetPrice.getRewards().size, `Expected 3 size, got ${assetPrice.getRewards().size}`, ) - assert.equal(2, assetPrice.getRewards().get('0xfff').toNumber(), `Expected 2 for address 0xfff`) + assert.equal(2n, assetPrice.getRewards().get('0xfff'), `Expected 2 for address 0xfff`) assert.equal('["50","50","2"]', assetPrice.getAmountsString()) assert.equal('["0x123","0x789","0xfff"]', assetPrice.getReceiversString()) }) it('it includes fees', async () => { const rewardsMap = new Map([ - ['0x123', BigNumber.from(70)], - ['0x789', BigNumber.from(30)], + ['0x123', 70n], + ['0x789', 30n], ]) - const assetPrice = new AssetPrice(rewardsMap).adjustToIncludeNetworkFees( - '0xfff', - BigNumber.from(100000), - ) + const assetPrice = new AssetPrice(rewardsMap).adjustToIncludeNetworkFees('0xfff', 100000n) - assert.equal( - 100, - assetPrice.getTotalPrice().toNumber(), - `Expected 100 got ${assetPrice.getTotalPrice()}`, - ) + assert.equal(100n, assetPrice.getTotalPrice(), `Expected 100 got ${assetPrice.getTotalPrice()}`) assert.equal( 3, assetPrice.getRewards().size, `Expected 3 size, got ${assetPrice.getRewards().size}`, ) - assert.equal( - 10, - assetPrice.getRewards().get('0xfff').toNumber(), - `Expected 10 for address 0xfff`, - ) + assert.equal(10n, assetPrice.getRewards().get('0xfff'), `Expected 10 for address 0xfff`) assert.equal('["63","27","10"]', assetPrice.getAmountsString()) assert.equal('["0x123","0x789","0xfff"]', assetPrice.getReceiversString()) }) diff --git a/test/nevermined/Account.test.ts b/test/nevermined/Account.test.ts index 8552a7672..f16a2a59b 100644 --- a/test/nevermined/Account.test.ts +++ b/test/nevermined/Account.test.ts @@ -1,7 +1,6 @@ import { assert } from 'chai' -import { Account } from '../../src' +import { Account, parseUnits } from '../../src' import { Nevermined } from '../../src/nevermined' -import { BigNumber } from '../../src/utils' import config from '../config' import TestContractHandler from '../keeper/TestContractHandler' @@ -19,21 +18,21 @@ describe('Account', () => { it('should get initial nevermined balance', async () => { const balance = await accounts[8].getNeverminedBalance() - assert.equal(0, balance.toNumber(), `Expected 0 got ${balance}`) + assert.equal(0n, balance, `Expected 0 got ${balance}`) }) it('should get the correct balance', async () => { - const amount = BigNumber.from(100) + const amount = 100n const [account] = accounts const initialBalance = await account.getNeverminedBalance() await account.requestTokens(amount) const balance = await account.getNeverminedBalance() - const balancePlusAmount = BigNumber.from(BigNumber.parseUnits('100').toString()) + const balancePlusAmount = parseUnits('100') console.log(`Initial Balance : ${initialBalance.toString()}`) console.log(`Balance : ${balance.toString()}`) console.log(`Balance + Amount: ${balancePlusAmount.toString()}`) - assert.isTrue(balance.gte(initialBalance.add(balancePlusAmount))) + assert.isTrue(balance >= initialBalance + balancePlusAmount) }) }) @@ -43,12 +42,8 @@ describe('Account', () => { const account: Account = accounts[9] const balanceEth = await account.getEtherBalance() - console.log( - `Balance ${balanceEth} should be ${BigNumber.from( - BigNumber.parseUnits('1000').toString(), - )}`, - ) - assert.isTrue(balanceEth.eq(BigNumber.parseUnits('1000').toString())) + console.log(`Balance ${balanceEth} should be ${parseUnits('1000')}`) + assert.equal(balanceEth, parseUnits('1000')) }) }) @@ -58,8 +53,8 @@ describe('Account', () => { const account: Account = accounts[9] const balance = await account.getBalance() - assert.isTrue(balance.eth.eq(BigNumber.parseUnits('1000'))) - assert.isTrue(balance.nevermined.isZero()) + assert.equal(balance.eth, parseUnits('1000')) + assert.equal(balance.nevermined, 0n) }) }) diff --git a/test/nevermined/Accounts.test.ts b/test/nevermined/Accounts.test.ts index 494c75eed..7ffde001f 100644 --- a/test/nevermined/Accounts.test.ts +++ b/test/nevermined/Accounts.test.ts @@ -4,7 +4,6 @@ import spies from 'chai-spies' import config from '../config' import { Account } from '../../src/nevermined' import { Nevermined } from '../../src/nevermined' -import { BigNumber } from '../../src/utils' import { AccountsApi } from '../../src/nevermined' use(spies) @@ -33,14 +32,14 @@ describe('Accounts', () => { it('should return the balance of an account', async () => { const [account] = await accounts.list() spy.on(account, 'getBalance', () => ({ - eth: BigNumber.from(1), - nevermined: BigNumber.from(5), + eth: 1n, + nevermined: 5n, })) const balance = await accounts.balance(account) assert.deepEqual(balance, { - eth: BigNumber.from(1), - nevermined: BigNumber.from(5), + eth: 1n, + nevermined: 5n, }) }) }) diff --git a/test/nevermined/Nevermined.test.ts b/test/nevermined/Nevermined.test.ts index cc84f5ce8..9e1260163 100644 --- a/test/nevermined/Nevermined.test.ts +++ b/test/nevermined/Nevermined.test.ts @@ -36,7 +36,7 @@ describe('Nevermined', () => { const accs: Account[] = await nevermined.accounts.list() assert(accs.length === 10, `Expected 10 but the length is ${accs.length}`) - assert((await accs[5].getBalance()).nevermined.toNumber() === 0) + assert.equal((await accs[5].getBalance()).nevermined, 0n) assert(typeof accs[0].getId() === 'string') }) }) diff --git a/test/tsconfig.json b/test/tsconfig.json index 74a4048ba..8e3c947be 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,9 +1,10 @@ { "compilerOptions": { - "target": "ES5", + "moduleResolution": "NodeNext", + "target": "ES2020", "noEmit": true, "resolveJsonModule": true, - "lib": ["ES6", "ES7"], + "lib": ["ES2020"], "noUnusedLocals": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true From 26997e92808b298e8ac36c9115bdfe5c26b6a2c9 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 13 Jul 2023 11:02:27 +0200 Subject: [PATCH 011/151] fix: fixed account generation from mnemonic code --- integration/nevermined/SdkWithoutArtifacts.test.ts | 12 ++---------- integration/nevermined/Web3Providers.test.ts | 13 +++---------- src/utils/MakeAccounts.ts | 8 +++++--- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/integration/nevermined/SdkWithoutArtifacts.test.ts b/integration/nevermined/SdkWithoutArtifacts.test.ts index 65a66bf81..555ffab04 100644 --- a/integration/nevermined/SdkWithoutArtifacts.test.ts +++ b/integration/nevermined/SdkWithoutArtifacts.test.ts @@ -1,8 +1,7 @@ import { assert } from 'chai' import { decodeJwt } from 'jose' import { config } from '../config' -import { Nevermined, SearchQuery, Account } from '../../src' -import { HDNodeWallet, ethers } from 'ethers' +import { Nevermined, SearchQuery, Account, makeAccounts } from '../../src' describe('Sdk working without artifacts', () => { let nevermined: Nevermined @@ -20,14 +19,7 @@ describe('Sdk working without artifacts', () => { }) it('should login to metamask without artifacts', async () => { - const node = HDNodeWallet.fromPhrase(process.env.SEED_WORDS) - const accounts: ethers.Wallet[] = [] - for (let i = 0; i < 10; i++) { - const acc = node.derivePath("m/44'/60'/0'/0/" + i) - const wallet = new ethers.Wallet(acc.privateKey) - accounts.push(wallet) - } - configCopy.accounts = accounts + configCopy.accounts = makeAccounts(process.env.SEED_WORDS) nevermined = await Nevermined.getInstance(configCopy) // Accounts diff --git a/integration/nevermined/Web3Providers.test.ts b/integration/nevermined/Web3Providers.test.ts index c17d3c713..f2423cc54 100644 --- a/integration/nevermined/Web3Providers.test.ts +++ b/integration/nevermined/Web3Providers.test.ts @@ -3,24 +3,17 @@ import { decodeJwt } from 'jose' import { config } from '../config' import { getMetadata } from '../utils' -import { Nevermined, Account, AssetAttributes } from '../../src' +import { Nevermined, Account, AssetAttributes, makeAccounts } from '../../src' import * as keyFile from '../KeyFile.json' -import { HDNodeWallet, ethers } from 'ethers' +import { ethers } from 'ethers' describe('Web3Providers', () => { let nevermined: Nevermined let account: Account it('should register an asset (mnemonic)', async () => { - const node = HDNodeWallet.fromPhrase(process.env.SEED_WORDS) - const accounts: ethers.Wallet[] = [] - for (let i = 0; i < 10; i++) { - const acc = node.derivePath("m/44'/60'/0'/0/" + i) - const wallet = new ethers.Wallet(acc.privateKey) - accounts.push(wallet) - } - config.accounts = accounts + config.accounts = makeAccounts(process.env.SEED_WORDS) nevermined = await Nevermined.getInstance(config) // Accounts diff --git a/src/utils/MakeAccounts.ts b/src/utils/MakeAccounts.ts index 6704a259c..88f5c614a 100644 --- a/src/utils/MakeAccounts.ts +++ b/src/utils/MakeAccounts.ts @@ -1,10 +1,12 @@ -import { ethers } from 'ethers' +import { Mnemonic, ethers, getIndexedAccountPath } from 'ethers' export function makeAccounts(seedphrase: string): ethers.Wallet[] { - const node = ethers.HDNodeWallet.fromPhrase(seedphrase) + const mnemonic = Mnemonic.fromPhrase(seedphrase) + const node = ethers.HDNodeWallet.fromSeed(mnemonic.computeSeed()) const accounts: ethers.Wallet[] = [] + for (let i = 0; i < 10; i++) { - const acc = node.derivePath("m/44'/60'/0'/0/" + i) + const acc = node.derivePath(getIndexedAccountPath(i)) const wallet = new ethers.Wallet(acc.privateKey) accounts.push(wallet) } From afe27c3a649b30a9f9e2f75ec6ed566630ac87d0 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:32:28 +0200 Subject: [PATCH 012/151] ci: multiple services tests --- integration/compute/ComputeAsset.test.ts | 7 +- .../nevermined/AgreementStoreManager.test.ts | 2 +- .../AssetsWithMultipleServices.test.ts | 38 +++-- integration/nevermined/ConsumeAsset.test.ts | 9 +- .../nevermined/ConsumeAssetViaNode.test.ts | 5 +- .../nevermined/ConsumeBigAsset.test.ts | 10 +- .../ConsumeExternalDDOAsset.test.ts | 11 +- .../nevermined/NFT721Templates.test.ts | 1 + integration/nevermined/NFTTemplates.test.ts | 1 + .../nevermined/SecondaryMarket.test.ts | 1 + .../nevermined/SubscriptionDuration.test.ts | 1 + src/common/helpers.ts | 13 ++ src/ddo/DDO.ts | 31 +++- ...AccessTemplate.serviceAgreementTemplate.ts | 4 +- .../contracts/templates/AccessTemplate.ts | 2 +- .../templates/AgreementTemplate.abstract.ts | 13 +- .../templates/BaseTemplate.abstract.ts | 12 +- ...DSalesTemplate.serviceAgreementTemplate.ts | 4 +- .../contracts/templates/DIDSalesTemplate.ts | 2 +- ...cutionTemplate.serviceAgreementTemplate.ts | 39 ++--- .../EscrowComputeExecutionTemplate.ts | 2 +- .../contracts/templates/GenericAccess.ts | 3 +- ...AccessTemplate.serviceAgreementTemplate.ts | 4 +- .../templates/NFT721AccessTemplate.ts | 2 +- ...1SalesTemplate.serviceAgreementTemplate.ts | 4 +- .../templates/NFT721SalesTemplate.ts | 2 +- ...AccessTemplate.serviceAgreementTemplate.ts | 4 +- .../contracts/templates/NFTAccessTemplate.ts | 2 +- ...TSalesTemplate.serviceAgreementTemplate.ts | 4 +- .../contracts/templates/NFTSalesTemplate.ts | 2 +- src/nevermined/api/AssetsApi.ts | 28 +++- src/nevermined/api/RegistryBaseApi.ts | 152 ++++++------------ src/nevermined/api/nfts/NFT1155Api.ts | 5 +- src/nevermined/api/nfts/NFT721Api.ts | 5 +- src/nevermined/api/nfts/NFTsBaseApi.ts | 22 ++- src/services/metadata/MetadataService.ts | 6 +- src/utils/DDOHelpers.ts | 18 ++- tsconfig.json | 2 +- 38 files changed, 284 insertions(+), 189 deletions(-) diff --git a/integration/compute/ComputeAsset.test.ts b/integration/compute/ComputeAsset.test.ts index f48d99d8c..e2ddcf7d7 100644 --- a/integration/compute/ComputeAsset.test.ts +++ b/integration/compute/ComputeAsset.test.ts @@ -47,7 +47,12 @@ describe('Compute Asset', () => { const computeAttributes = AssetAttributes.getInstance({ metadata: workflowMetadatas.compute(userId), - price: assetPrice, + services: [ + { + serviceType: 'compute', + price: assetPrice, + }, + ], providers: [config.neverminedNodeAddress], }) computeDdo = await nevermined.compute.create(computeAttributes, publisher) diff --git a/integration/nevermined/AgreementStoreManager.test.ts b/integration/nevermined/AgreementStoreManager.test.ts index ac12e6093..5fab11cee 100644 --- a/integration/nevermined/AgreementStoreManager.test.ts +++ b/integration/nevermined/AgreementStoreManager.test.ts @@ -55,7 +55,7 @@ describe('Agreement Store Manager', () => { await account2.requestTokens( +ddo.getPriceByService() * 10 ** -(await nevermined.keeper.token.decimals()), ) - agreementId = await nevermined.assets.order(ddo.id, account2) + agreementId = await nevermined.assets.order(ddo.id, 'access', account2) // wait for the graph to pickup the event await sleep(3000) diff --git a/integration/nevermined/AssetsWithMultipleServices.test.ts b/integration/nevermined/AssetsWithMultipleServices.test.ts index a4e04b7eb..0d5c288b9 100644 --- a/integration/nevermined/AssetsWithMultipleServices.test.ts +++ b/integration/nevermined/AssetsWithMultipleServices.test.ts @@ -27,6 +27,9 @@ let ddo: DDO let token: Token let balanceBefore: BigNumber let balanceAfter: BigNumber +let service +let agreementId +let neverminedNodeAddress const totalAmount1 = '100' const totalAmount2 = '350' @@ -37,6 +40,8 @@ describe('Assets with multiple services', () => { // Accounts ;[publisher, consumer] = await nevermined.accounts.list() + neverminedNodeAddress = await nevermined.services.node.getProviderAddress() + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(publisher) await nevermined.services.marketplace.login(clientAssertion) @@ -45,18 +50,22 @@ describe('Assets with multiple services', () => { assetPrice1 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount1)) assetPrice2 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount2)) + try { + await consumer.requestTokens(BigNumber.from(totalAmount1).mul(10)) + } catch (error) { + console.error(error) + } + metadata = getMetadata() metadata.userId = payload.sub }) - describe('E2E flow for access services', () => { + describe('E2E flow for an asset with multiple access services', () => { it('Register with multiple access services', async () => { balanceBefore = await token.balanceOf(consumer.getId()) const nonce = Math.random() createdMetadata = getMetadata(nonce, `Immutable Multiple Services Test ${nonce}`) - - createdMetadata.main.ercType = 721 createdMetadata.additionalInformation.tags = ['test'] const assetAttributes = AssetAttributes.getInstance({ @@ -71,6 +80,7 @@ describe('Assets with multiple services', () => { price: assetPrice2, }, ], + providers: [neverminedNodeAddress], }) ddo = await nevermined.assets.create(assetAttributes, publisher) @@ -83,23 +93,24 @@ describe('Assets with multiple services', () => { assert.equal(accessServices[1].index, 3) assert.equal( - accessServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value, - [totalAmount1], + accessServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], + totalAmount2, ) assert.equal( - accessServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value, - [totalAmount2], + accessServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], + totalAmount1, ) const metadata = ddo.findServiceByType('metadata') - assert.equal(metadata.attributes.main.ercType, 721) assert.equal(metadata.attributes.additionalInformation.tags[0], 'test') }) - it('Order and download the first of multiple access services', async () => { + it('Order one between multiple access services', async () => { const accessServices = ddo.getServicesByType('access') - const agreementId = await nevermined.assets.order(ddo.id, accessServices[0].index, consumer) + service = accessServices[0] + const price = service.attributes.main.price + agreementId = await nevermined.assets.order(ddo.id, service.index, consumer) await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) @@ -110,16 +121,19 @@ describe('Assets with multiple services', () => { }) balanceAfter = await token.balanceOf(consumer.getId()) - console.log(`Asset Price = ${assetPrice1.getTotalPrice()}`) + console.log(`Asset Price = ${price}`) console.log(`Balance Before: ${balanceBefore.toString()}`) console.log(`Balance After : ${balanceAfter.toString()}`) - assert.equal(balanceBefore.sub(assetPrice1.getTotalPrice()), balanceAfter) + assert.isTrue(balanceBefore.sub(BigNumber.from(price)).eq(balanceAfter)) + }) + it('Download assets through the Node', async () => { const folder = '/tmp/nevermined/sdk-js/multiple-services/access' const path = (await nevermined.assets.access( agreementId, ddo.id, + service.index, consumer, folder, -1, diff --git a/integration/nevermined/ConsumeAsset.test.ts b/integration/nevermined/ConsumeAsset.test.ts index 78e02ec75..34d92b8b8 100644 --- a/integration/nevermined/ConsumeAsset.test.ts +++ b/integration/nevermined/ConsumeAsset.test.ts @@ -180,7 +180,13 @@ describe('Consume Asset', () => { it('should consume and store the assets', async () => { const folder = '/tmp/nevermined/sdk-js-1' - const path = (await nevermined.assets.access(agreementId, ddo.id, consumer, folder)) as string + const path = (await nevermined.assets.access( + agreementId, + ddo.id, + 'access', + consumer, + folder, + )) as string assert.include(path, folder, 'The storage path is not correct.') @@ -198,6 +204,7 @@ describe('Consume Asset', () => { const path = (await nevermined.assets.access( agreementId, ddo.id, + 'access', consumer, folder, 1, diff --git a/integration/nevermined/ConsumeAssetViaNode.test.ts b/integration/nevermined/ConsumeAssetViaNode.test.ts index c895674e2..56f7d936c 100644 --- a/integration/nevermined/ConsumeAssetViaNode.test.ts +++ b/integration/nevermined/ConsumeAssetViaNode.test.ts @@ -88,7 +88,9 @@ describe('Consume Asset (Nevermined Node)', () => { it('should order the asset', async () => { const steps = [] - agreementId = await nevermined.assets.order(ddo.id, consumer).next((step) => steps.push(step)) + agreementId = await nevermined.assets + .order(ddo.id, 'access', consumer) + .next((step) => steps.push(step)) assert.isDefined(agreementId) assert.deepEqual(steps, [2, 3, 4, 5]) @@ -124,6 +126,7 @@ describe('Consume Asset (Nevermined Node)', () => { const path = (await nevermined.assets.access( agreementId, ddo.id, + 'access', consumer, folder, -1, diff --git a/integration/nevermined/ConsumeBigAsset.test.ts b/integration/nevermined/ConsumeBigAsset.test.ts index e203fc575..b18a88c22 100644 --- a/integration/nevermined/ConsumeBigAsset.test.ts +++ b/integration/nevermined/ConsumeBigAsset.test.ts @@ -63,14 +63,20 @@ describe.skip('Consume Asset (Large size)', () => { Logger.error(error) } - agreementId = await nevermined.assets.order(ddo.id, consumer) + agreementId = await nevermined.assets.order(ddo.id, 'access', consumer) assert.isDefined(agreementId) }) it('should consume and store the assets', async () => { const folder = '/tmp/nevermined/sdk-js' - const path = (await nevermined.assets.access(agreementId, ddo.id, consumer, folder)) as string + const path = (await nevermined.assets.access( + agreementId, + ddo.id, + 'access', + consumer, + folder, + )) as string assert.include(path, folder, 'The storage path is not correct.') diff --git a/integration/nevermined/ConsumeExternalDDOAsset.test.ts b/integration/nevermined/ConsumeExternalDDOAsset.test.ts index c41c380d3..344805daf 100644 --- a/integration/nevermined/ConsumeExternalDDOAsset.test.ts +++ b/integration/nevermined/ConsumeExternalDDOAsset.test.ts @@ -41,7 +41,7 @@ describe('Consume Asset (Documentation example)', () => { await nevermined.services.marketplace.login(clientAssertion) const payload = decodeJwt(config.marketplaceAuthToken) - metadata = await getMetadata() + metadata = getMetadata() metadata.userId = payload.sub assetPrice = new AssetPrice(publisher.getId(), BigNumber.from('0')) }) @@ -170,7 +170,13 @@ describe('Consume Asset (Documentation example)', () => { it('should consume and store the assets', async () => { const folder = '/tmp/nevermined/sdk-js-1' - const path = (await nevermined.assets.access(agreementId, ddo.id, consumer, folder)) as string + const path = (await nevermined.assets.access( + agreementId, + ddo.id, + 'access', + consumer, + folder, + )) as string assert.include(path, folder, 'The storage path is not correct.') @@ -188,6 +194,7 @@ describe('Consume Asset (Documentation example)', () => { const path = (await nevermined.assets.access( agreementId, ddo.id, + 'access', consumer, folder, 0, diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index e1309f2a1..b6b1a17d7 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -675,6 +675,7 @@ describe('NFT721Templates E2E', () => { const result = await nft721SalesTemplate.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, + 'nft-sales', nft721SalesTemplate.params(collector1.getId()), collector1, collector1, diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index c0a386794..a2baa38f6 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -670,6 +670,7 @@ describe('NFTTemplates E2E', () => { const result = await nftSalesTemplate.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, + 'nft-sales', nftSalesTemplate.params(collector1.getId(), numberNFTs), collector1, collector1, diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index ef137697c..9f72613ce 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -363,6 +363,7 @@ describe('Secondary Markets', () => { nftSalesTemplateConditions, collector1.getId(), assetPrice2, + ddo.id, token.getAddress(), undefined, collector1.getId(), diff --git a/integration/nevermined/SubscriptionDuration.test.ts b/integration/nevermined/SubscriptionDuration.test.ts index 2394b1376..52195d067 100644 --- a/integration/nevermined/SubscriptionDuration.test.ts +++ b/integration/nevermined/SubscriptionDuration.test.ts @@ -62,6 +62,7 @@ describe('Subscription Durations', () => { }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, publisher) assert.isDefined(subscriptionDDO) + console.log(subscriptionDDO.id) }) it('The publisher creates a dataset to associate to the subscription', async () => { diff --git a/src/common/helpers.ts b/src/common/helpers.ts index ebc803e94..843d1d68b 100644 --- a/src/common/helpers.ts +++ b/src/common/helpers.ts @@ -14,3 +14,16 @@ export const buildQuery = (url: string, query: SearchQuery) => { return fullUrl } + +export const getCircularReplacer = () => { + const seen = new WeakSet() + return (key, value) => { + if (typeof value === 'object' && value !== null) { + if (seen.has(value)) { + return + } + seen.add(value) + } + return value + } +} diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index dcdccff70..a86ff36a5 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -20,7 +20,7 @@ import { ethers } from 'ethers' import { AssetPrice, NFTAttributes } from '../models' import { BigNumber } from '../utils' import { DDOPriceNotFoundError, DDOServiceNotFoundError } from '../errors' -import { DDOConditionNotFoundError } from '../errors/DDOError' +import { DDOConditionNotFoundError, DDOParamNotFoundError } from '../errors/DDOError' // DDO Services including a sales process export const SALES_SERVICES = ['access', 'compute', 'nft-sales'] @@ -162,6 +162,21 @@ export class DDO { throw new DDOServiceNotFoundError(serviceType, this.id) } + /** + * Finds a service of a DDO by index. + * @param index - index. + * @returns Service. + */ + public findServiceByReference( + serviceReference: ServiceType | number, + ): Service { + if (typeof serviceReference === 'number') { + return this.findServiceById(serviceReference) + } else { + return this.findServiceByType(serviceReference) as Service + } + } + /** * Gets all the services of a DDO with a specific type. * @param serviceType - Service type. @@ -335,7 +350,7 @@ export class DDO { service: Service, name: ConditionType, ): ServiceAgreementTemplateCondition { - const condition = service.attributes.serviceAgreementTemplate.conditions.find( + const condition = service.attributes?.serviceAgreementTemplate?.conditions?.find( (c) => c.name === name, ) if (!service) throw new DDOConditionNotFoundError(name) @@ -381,8 +396,12 @@ export class DDO { conditionType: ConditionType, paramName: string, ): string | number | string[] { - const nftTransferCondition = DDO.findServiceConditionByName(service, conditionType) - return nftTransferCondition.parameters.find((p) => p.name === paramName).value + try { + const nftTransferCondition = DDO.findServiceConditionByName(service, conditionType) + return nftTransferCondition.parameters?.find((p) => p.name === paramName).value + } catch (_e) { + throw new DDOParamNotFoundError(conditionType, paramName) + } } /** @@ -474,4 +493,8 @@ export class DDO { const holder = transferCondition.parameters.find((p) => p.name === '_nftHolder') holder.value = holderAddress } + + public static findAndReplaceDDOAttribute(ddo: DDO, paramName: string, value: string): DDO { + return DDO.deserialize(DDO.serialize(ddo).replaceAll(paramName, value)) + } } diff --git a/src/keeper/contracts/templates/AccessTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/AccessTemplate.serviceAgreementTemplate.ts index bd9ffa61f..a07d3ad83 100644 --- a/src/keeper/contracts/templates/AccessTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/AccessTemplate.serviceAgreementTemplate.ts @@ -1,7 +1,7 @@ import { ServiceAgreementTemplate } from '../../../ddo' import { accessTemplate, escrowTemplate, lockPaymentTemplate } from './ConditionTemplates' -export const accessTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { +export const accessTemplateServiceAgreementTemplate = (): ServiceAgreementTemplate => ({ contractName: 'AccessTemplate', events: [ { @@ -21,4 +21,4 @@ export const accessTemplateServiceAgreementTemplate: ServiceAgreementTemplate = escrowPayment: ['lockPayment', 'access'], }, conditions: [lockPaymentTemplate(), accessTemplate(), escrowTemplate()], -} +}) diff --git a/src/keeper/contracts/templates/AccessTemplate.ts b/src/keeper/contracts/templates/AccessTemplate.ts index ac3e43fc8..40469d680 100644 --- a/src/keeper/contracts/templates/AccessTemplate.ts +++ b/src/keeper/contracts/templates/AccessTemplate.ts @@ -37,7 +37,7 @@ export class AccessTemplate extends BaseTemplate extends ContractBase { public standardContext(ddo: DDO, creator: string): ConditionContext { const service = ddo.findServiceByType(this.service()) - const rewards = DDO.getAssetPriceFromService(service) + let rewards + try { + rewards = DDO.getAssetPriceFromService(service) + } catch (_e) { + rewards = undefined + } + // const rewards = DDO.getAssetPriceFromService(service) return { ddo, service, price: rewards, creator } } @@ -245,6 +251,7 @@ export abstract class AgreementTemplate extends ContractBase { public async createAgreementWithPaymentFromDDO( agreementIdSeed: string, ddo: DDO, + serviceReference: ServiceType | number, parameters: Params, consumer: Account, from: Account, @@ -262,7 +269,7 @@ export abstract class AgreementTemplate extends ContractBase { parameters, ) - const service = ddo.findServiceByType(this.service()) + const service = ddo.findServiceByReference(serviceReference) const assetPrice = DDO.getAssetPriceFromService(service) const payment = DDO.findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') @@ -271,6 +278,8 @@ export abstract class AgreementTemplate extends ContractBase { const amounts = assetPrice.getAmounts() const receivers = assetPrice.getReceivers() + console.log(`Creating Agreement with AssetPrice: ${assetPrice.toString()}`) + const timeouts: number[] = [] const timelocks: number[] = [] service.attributes.serviceAgreementTemplate.conditions.map((condition) => { diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 5793e6e81..c8d139f38 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -11,6 +11,8 @@ import { import { Account, Condition, MetaData, AssetPrice, NFTAttributes } from '../../../sdk' import { TxParameters } from '../ContractBase' import { ConditionInstance, ConditionState } from '../conditions' +import { BigNumber } from 'ethers' +import { isAddress } from 'ethers/lib/utils' export abstract class BaseTemplate extends AgreementTemplate @@ -37,16 +39,22 @@ export abstract class BaseTemplate assetPrice?: AssetPrice, priceData?: PricedMetadataInformation, ): S { + let tokenAddress + if (assetPrice === undefined || !isAddress(assetPrice.getTokenAddress())) + tokenAddress = this.nevermined.utils.token.getAddress() + else tokenAddress = assetPrice.getTokenAddress() + const serviceAgreementTemplate = this.getServiceAgreementTemplate() const _conds = getConditionsByParams( this.service(), serviceAgreementTemplate.conditions, publisher.getId(), assetPrice, - assetPrice?.getTokenAddress() || this.nevermined.utils.token.getAddress(), + undefined, // we don't know the DID yet + tokenAddress, nftAttributes?.nftContractAddress, publisher.getId(), - assetPrice.getTotalPrice(), + assetPrice ? assetPrice.getTotalPrice() : BigNumber.from('0'), nftAttributes?.nftTransfer, nftAttributes?.duration, nftAttributes?.fulfillAccessTimeout, diff --git a/src/keeper/contracts/templates/DIDSalesTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/DIDSalesTemplate.serviceAgreementTemplate.ts index 6f79ea970..24a640fa8 100644 --- a/src/keeper/contracts/templates/DIDSalesTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/DIDSalesTemplate.serviceAgreementTemplate.ts @@ -1,7 +1,7 @@ import { ServiceAgreementTemplate } from '../../../ddo' import { didTransferTemplate, escrowTemplate, lockPaymentTemplate } from './ConditionTemplates' -export const didSalesTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { +export const didSalesTemplateServiceAgreementTemplate = (): ServiceAgreementTemplate => ({ contractName: 'DIDSalesTemplate', events: [ { @@ -21,4 +21,4 @@ export const didSalesTemplateServiceAgreementTemplate: ServiceAgreementTemplate escrowPayment: ['lockPayment', 'transferNFT'], }, conditions: [lockPaymentTemplate(), didTransferTemplate(), escrowTemplate()], -} +}) diff --git a/src/keeper/contracts/templates/DIDSalesTemplate.ts b/src/keeper/contracts/templates/DIDSalesTemplate.ts index 00d8596c5..7e094ca98 100644 --- a/src/keeper/contracts/templates/DIDSalesTemplate.ts +++ b/src/keeper/contracts/templates/DIDSalesTemplate.ts @@ -88,6 +88,6 @@ export class DIDSalesTemplate extends BaseTemplate } public getServiceAgreementTemplate(): ServiceAgreementTemplate { - return didSalesTemplateServiceAgreementTemplate + return { ...didSalesTemplateServiceAgreementTemplate() } } } diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts index 448cf5713..54ea2b179 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts @@ -1,24 +1,25 @@ import { ServiceAgreementTemplate } from '../../../ddo' import { escrowTemplate, lockPaymentTemplate, serviceExecutionTemplate } from './ConditionTemplates' -export const escrowComputeExecutionTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { - contractName: 'EscrowComputeExecutionTemplate', - events: [ - { - name: 'AgreementCreated', - actorType: 'consumer', - handler: { - moduleName: 'serviceExecutionTemplate', - functionName: 'fulfillLockPaymentCondition', - version: '0.1', +export const escrowComputeExecutionTemplateServiceAgreementTemplate = + (): ServiceAgreementTemplate => ({ + contractName: 'EscrowComputeExecutionTemplate', + events: [ + { + name: 'AgreementCreated', + actorType: 'consumer', + handler: { + moduleName: 'serviceExecutionTemplate', + functionName: 'fulfillLockPaymentCondition', + version: '0.1', + }, }, + ], + fulfillmentOrder: ['lockPayment.fulfill', 'serviceExecution.fulfill', 'escrowPayment.fulfill'], + conditionDependency: { + lockPayment: [], + serviceExecution: [], + escrowPaymentCondition: ['lockPayment', 'serviceExecution'], }, - ], - fulfillmentOrder: ['lockPayment.fulfill', 'serviceExecution.fulfill', 'escrowPayment.fulfill'], - conditionDependency: { - lockPayment: [], - serviceExecution: [], - escrowPaymentCondition: ['lockPayment', 'serviceExecution'], - }, - conditions: [lockPaymentTemplate(), serviceExecutionTemplate(), escrowTemplate()], -} + conditions: [lockPaymentTemplate(), serviceExecutionTemplate(), escrowTemplate()], + }) diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts index b7ede3aa1..f889e69f1 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -88,7 +88,7 @@ export class EscrowComputeExecutionTemplate extends BaseTemplate< } public getServiceAgreementTemplate() { - return escrowComputeExecutionTemplateServiceAgreementTemplate + return { ...escrowComputeExecutionTemplateServiceAgreementTemplate() } } public service(): ServiceType { diff --git a/src/keeper/contracts/templates/GenericAccess.ts b/src/keeper/contracts/templates/GenericAccess.ts index b3ed1d1dc..a6096caeb 100644 --- a/src/keeper/contracts/templates/GenericAccess.ts +++ b/src/keeper/contracts/templates/GenericAccess.ts @@ -1,4 +1,4 @@ -import { DDO } from '../../../ddo' +import { DDO, ServiceType } from '../../../ddo' import { Account, OrderProgressStep } from '../../../nevermined' import { TxParameters } from '../ContractBase' @@ -6,6 +6,7 @@ export interface GenericAccess { createAgreementWithPaymentFromDDO( agreementIdSeed: string, ddo: DDO, + serviceReference: ServiceType | number, parameters: any, consumer: Account, from: Account, diff --git a/src/keeper/contracts/templates/NFT721AccessTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/NFT721AccessTemplate.serviceAgreementTemplate.ts index bd3e8d03f..81c7cd0d7 100644 --- a/src/keeper/contracts/templates/NFT721AccessTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/NFT721AccessTemplate.serviceAgreementTemplate.ts @@ -1,7 +1,7 @@ import { ServiceAgreementTemplate } from '../../../ddo' import { nft721HolderTemplate, nftAccessCondition } from './ConditionTemplates' -export const nft721AccessTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { +export const nft721AccessTemplateServiceAgreementTemplate = (): ServiceAgreementTemplate => ({ contractName: 'NFT721AccessTemplate', events: [ { @@ -20,4 +20,4 @@ export const nft721AccessTemplateServiceAgreementTemplate: ServiceAgreementTempl nftAccess: [], }, conditions: [nft721HolderTemplate(), nftAccessCondition()], -} +}) diff --git a/src/keeper/contracts/templates/NFT721AccessTemplate.ts b/src/keeper/contracts/templates/NFT721AccessTemplate.ts index 5c4eaabf4..e4b53281d 100644 --- a/src/keeper/contracts/templates/NFT721AccessTemplate.ts +++ b/src/keeper/contracts/templates/NFT721AccessTemplate.ts @@ -76,7 +76,7 @@ export class NFT721AccessTemplate extends BaseTemplate< } public getServiceAgreementTemplate(): ServiceAgreementTemplate { - return nft721AccessTemplateServiceAgreementTemplate + return { ...nft721AccessTemplateServiceAgreementTemplate() } } public async accept(params: ValidationParams): Promise { diff --git a/src/keeper/contracts/templates/NFT721SalesTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/NFT721SalesTemplate.serviceAgreementTemplate.ts index 4f8a34b27..eb5ac542a 100644 --- a/src/keeper/contracts/templates/NFT721SalesTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/NFT721SalesTemplate.serviceAgreementTemplate.ts @@ -1,7 +1,7 @@ import { ServiceAgreementTemplate } from '../../../ddo' import { escrowTemplate, lockPaymentTemplate, transferNFT721Template } from './ConditionTemplates' -export const nft721SalesTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { +export const nft721SalesTemplateServiceAgreementTemplate = (): ServiceAgreementTemplate => ({ contractName: 'NFT721SalesTemplate', events: [ { @@ -21,4 +21,4 @@ export const nft721SalesTemplateServiceAgreementTemplate: ServiceAgreementTempla escrowPayment: ['lockPayment', 'transferNFT'], }, conditions: [lockPaymentTemplate(), transferNFT721Template(), escrowTemplate()], -} +}) diff --git a/src/keeper/contracts/templates/NFT721SalesTemplate.ts b/src/keeper/contracts/templates/NFT721SalesTemplate.ts index 7c4e21b85..542673c6f 100644 --- a/src/keeper/contracts/templates/NFT721SalesTemplate.ts +++ b/src/keeper/contracts/templates/NFT721SalesTemplate.ts @@ -102,6 +102,6 @@ export class NFT721SalesTemplate extends BaseTemplate ({ contractName: 'NFTAccessTemplate', events: [ { @@ -20,4 +20,4 @@ export const nftAccessTemplateServiceAgreementTemplate: ServiceAgreementTemplate nftAccess: [], }, conditions: [nftHolderTemplate(), nftAccessCondition()], -} +}) diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index de524ad54..2255d2980 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -70,7 +70,7 @@ export class NFTAccessTemplate extends BaseTemplate { diff --git a/src/keeper/contracts/templates/NFTSalesTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/NFTSalesTemplate.serviceAgreementTemplate.ts index 77b6e1234..7f16f393e 100644 --- a/src/keeper/contracts/templates/NFTSalesTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/NFTSalesTemplate.serviceAgreementTemplate.ts @@ -1,7 +1,7 @@ import { ServiceAgreementTemplate } from '../../../ddo' import { escrowTemplate, lockPaymentTemplate, transferNftTemplate } from './ConditionTemplates' -export const nftSalesTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { +export const nftSalesTemplateServiceAgreementTemplate = (): ServiceAgreementTemplate => ({ contractName: 'NFTSalesTemplate', events: [ { @@ -21,4 +21,4 @@ export const nftSalesTemplateServiceAgreementTemplate: ServiceAgreementTemplate escrowPayment: ['lockPayment', 'transferNFT'], }, conditions: [lockPaymentTemplate(), transferNftTemplate(), escrowTemplate()], -} +}) diff --git a/src/keeper/contracts/templates/NFTSalesTemplate.ts b/src/keeper/contracts/templates/NFTSalesTemplate.ts index a228e6860..cd470bb41 100644 --- a/src/keeper/contracts/templates/NFTSalesTemplate.ts +++ b/src/keeper/contracts/templates/NFTSalesTemplate.ts @@ -102,6 +102,6 @@ export class NFTSalesTemplate extends BaseTemplate { const ddo = await this.resolve(did) const { attributes } = ddo.findServiceByType('metadata') - const { serviceEndpoint, index } = ddo.findServiceByType('access') + let service + if (typeof serviceReference === 'number') { + service = ddo.findServiceById(serviceReference) + } else { + service = ddo.findServiceByType(serviceReference) + } const { files } = attributes.main - if (!serviceEndpoint) { - throw new AssetError( - 'Consume asset failed, service definition is missing the `serviceEndpoint`.', - ) - } + const serviceEndpoint = this.nevermined.services.node.getAccessEndpoint() + // let serviceEndpoint + // if (service.serviceEndpoint) { + // serviceEndpoint = service.serviceEndpoint + // } else { + // serviceEndpoint = this.nevermined.services.node.getAccessEndpoint() + // //"http://node.nevermined.localnet/api/v1/node/services/access + // // throw new AssetError( + // // 'Consume asset failed, service definition is missing the `serviceEndpoint`.', + // // ) + // } this.logger.log('Consuming files') - resultPath = resultPath ? `${resultPath}/datafile.${ddo.shortId()}.${index}/` : undefined + resultPath = resultPath + ? `${resultPath}/datafile.${ddo.shortId()}.${service.index}/` + : undefined await this.nevermined.services.node.consumeService( did, diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 31181f6e3..d71deea44 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -61,7 +61,7 @@ export abstract class RegistryBaseApi extends Instantiable { const { didRegistry } = this.nevermined.keeper // create ddo itself - const ddo = DDO.getInstance( + let ddo = DDO.getInstance( assetAttributes.metadata.userId, publisher.getId(), assetAttributes.appId, @@ -97,12 +97,9 @@ export abstract class RegistryBaseApi extends Instantiable { const plugin = this.servicePlugin[serviceAttributes.serviceType] if (plugin) { - console.log( - `Generating service ${ - serviceAttributes.serviceType - } with price: ${serviceAttributes.price.toString()}}`, - ) - const pricedData = await this.getPriced(serviceAttributes.price) + const pricedData = serviceAttributes.price + ? await this.getPriced(serviceAttributes.price) + : undefined const serviceCreated = plugin.createService( publisher, @@ -114,29 +111,29 @@ export abstract class RegistryBaseApi extends Instantiable { ddo.addService(serviceCreated) - console.log( - `> Added service ${JSON.stringify( - ddo.service[ddo.service.length - 1].attributes.serviceAgreementTemplate.conditions[0], - )}`, - ) - console.log(ddo.service.length) + // console.log( + // `> Added service ${JSON.stringify( + // ddo.service[ddo.service.length - 1].attributes.serviceAgreementTemplate.conditions[0], + // )}`, + // ) + // console.log(ddo.service.length) } } - console.log(`----- DDO Services: `) - console.log(JSON.stringify(ddo.service)) - console.log(`----- Step 1: `) - ddo.service - .filter((service) => service.type === 'access') - .forEach((service) => { - console.log(`1# Service ${service.type}`) - const cond = service.attributes.serviceAgreementTemplate.conditions[0] - cond.parameters - .filter((p) => p.name === '_amounts') - .map((c) => { - console.log(`Param ${c.name} with price: ${JSON.stringify(c.value)}`) - }) - }) + // console.log(`----- DDO Services: `) + // console.log(JSON.stringify(ddo.service)) + // console.log(`----- Step 1: `) + // ddo.service + // .filter((service) => service.type === 'access') + // .forEach((service) => { + // console.log(`1# Service ${service.type}`) + // const cond = service.attributes.serviceAgreementTemplate.conditions[0] + // cond.parameters + // .filter((p) => p.name === '_amounts') + // .map((c) => { + // console.log(`Param ${c.name} with price: ${JSON.stringify(c.value)}`) + // }) + // }) ddo.reorderServices() @@ -150,6 +147,7 @@ export abstract class RegistryBaseApi extends Instantiable { const didSeed = await ddo.generateDidSeed(ddo.proof.checksum) await ddo.assignDid(didSeed, didRegistry, publisher) + ddo = DDO.findAndReplaceDDOAttribute(ddo, '{DID}', ddo.shortId()) // TODO: Evaluate if we need to add the signature to the DDO // Removing it would save a wallet interaction during asset creation @@ -158,69 +156,6 @@ export abstract class RegistryBaseApi extends Instantiable { this.logger.log('Proof generated') observer.next(CreateProgressStep.ProofGenerated) - // ddo.service.map((service) => { - - // }) - - // ddo.service.map((service) => { - // const { - // nftContractAddress, - // nftTransfer, - // duration, - // fulfillAccessTimeout, - // fulfillAccessTimelock, - // } = nftAttributes || {} - // const sat: ServiceAgreementTemplate = service.attributes.serviceAgreementTemplate - - // sat.conditions = ddo.fillConditionsWithDDO( - // service.type, - // sat.conditions, - // serviceAttributes.price, - // serviceAttributes.price?.getTokenAddress() || this.nevermined.utils.token.getAddress(), - // nftContractAddress, - // publisher.getId(), - // serviceAttributes.price.getTotalPrice(), - // nftTransfer, - // duration, - // fulfillAccessTimeout, - // fulfillAccessTimelock, - // ) - // console.log(`SAT ${JSON.stringify(sat.conditions)}`) - // }) - // for (const serviceAttributes of assetAttributes.services) { - // let service - // if (serviceAttributes.serviceIndex) - // service = ddo.findServiceById(serviceAttributes.serviceIndex) - // else service = ddo.findServiceByType(serviceAttributes.serviceType) - - // console.log(`Service ${serviceAttributes.serviceType} with price: ${serviceAttributes.price.toString()}}`) - - // // const { - // // nftContractAddress, - // // nftTransfer, - // // duration, - // // fulfillAccessTimeout, - // // fulfillAccessTimelock, - // // } = nftAttributes || {} - // // const sat: ServiceAgreementTemplate = service.attributes.serviceAgreementTemplate - - // // sat.conditions = ddo.fillConditionsWithDDO( - // // serviceAttributes.serviceType, - // // sat.conditions, - // // serviceAttributes.price, - // // serviceAttributes.price?.getTokenAddress() || this.nevermined.utils.token.getAddress(), - // // nftContractAddress, - // // publisher.getId(), - // // serviceAttributes.price.getTotalPrice(), - // // nftTransfer, - // // duration, - // // fulfillAccessTimeout, - // // fulfillAccessTimelock, - // // ) - // // console.log(`SAT ${JSON.stringify(sat.conditions)}`) - - // } - this.logger.log('Conditions filled') observer.next(CreateProgressStep.ConditionsFilled) @@ -636,14 +571,18 @@ export abstract class RegistryBaseApi extends Instantiable { const { keeper } = this.nevermined - let service - if (typeof serviceReference === 'number') { - service = ddo.findServiceById(serviceReference) - } else { - service = ddo.findServiceByType(serviceReference) - } + // let service + // if (typeof serviceReference === 'number') { + // service = ddo.findServiceById(serviceReference) + // } else { + // service = ddo.findServiceByType(serviceReference) + // } + const service = ddo.findServiceByReference(serviceReference) const templateName = service.attributes.serviceAgreementTemplate.contractName + console.log( + `Ordering Asset with reference ${serviceReference}, template ${templateName} and price ${service.attributes.main.price}`, + ) const template = keeper.getAccessTemplateByName(templateName) @@ -651,6 +590,7 @@ export abstract class RegistryBaseApi extends Instantiable { const agreementId = await template.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, + serviceReference, template.params(consumer), consumer, consumer, @@ -696,11 +636,23 @@ export abstract class RegistryBaseApi extends Instantiable { } } - private async getPriced(assetPrice: AssetPrice): Promise { - let decimals: number - const erc20TokenAddress = - assetPrice.getTokenAddress() || this.nevermined.utils.token.getAddress() + private async getPriced(assetPrice: AssetPrice | undefined): Promise { + if (assetPrice === undefined) { + return { + attributes: { + main: { + price: '0', + }, + additionalInformation: { + priceHighestDenomination: 0, + }, + }, + } + } + const erc20TokenAddress = + assetPrice?.getTokenAddress() || this.nevermined.utils.token.getAddress() + let decimals: number if (erc20TokenAddress === ZeroAddress) { decimals = 18 } else { diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index dbd73532e..a5b8d3408 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -4,7 +4,7 @@ import { generateId, SubscribablePromise, zeroX } from '../../../utils' import { PublishMetadata } from '../AssetsApi' import { Account } from '../../Account' import { TxParameters, Nft1155Contract } from '../../../keeper' -import { DDO } from '../../../ddo' +import { DDO, ServiceType } from '../../../ddo' import { NFTError } from '../../../errors' import { BigNumber } from '../../../utils' import { NFTsBaseApi } from './NFTsBaseApi' @@ -197,6 +197,7 @@ export class NFT1155Api extends NFTsBaseApi { * @param did - The Decentralized Identifier of the NFT asset. * @param numberEditions - The amount of NFTs to buy. * @param consumer - The account of the NFT buyer. + * @param serviceReference - The reference to identify wich service within the DDO to order * @param txParams - Optional transaction parameters. * * @returns The agreement ID. @@ -205,6 +206,7 @@ export class NFT1155Api extends NFTsBaseApi { did: string, numberEditions: BigNumber, consumer: Account, + serviceReference: ServiceType | number = 'nft-sales', txParams?: TxParameters, ): SubscribablePromise { return new SubscribablePromise(async (observer) => { @@ -217,6 +219,7 @@ export class NFT1155Api extends NFTsBaseApi { const agreementId = await nftSalesTemplate.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, + serviceReference, nftSalesTemplate.params(consumer.getId(), numberEditions), consumer, consumer, diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index 121a4bd87..4c5b2b782 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -1,5 +1,5 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' -import { DDO } from '../../../ddo' +import { DDO, ServiceType } from '../../../ddo' import { NFTAttributes, AssetAttributes } from '../../../models' import { generateId, SubscribablePromise, zeroX } from '../../../utils' import { Account } from '../../Account' @@ -121,6 +121,7 @@ export class NFT721Api extends NFTsBaseApi { * * @param did - The Decentralized Identifier of the NFT asset. * @param consumer - The account of the NFT buyer. + * @param serviceReference - The reference to identify wich service within the DDO to order * @param txParams - Optional transaction parameters. * * @returns The agreement ID. @@ -128,6 +129,7 @@ export class NFT721Api extends NFTsBaseApi { public order( did: string, consumer: Account, + serviceReference: ServiceType | number = 'nft-sales', txParams?: TxParameters, ): SubscribablePromise { return new SubscribablePromise(async (observer) => { @@ -140,6 +142,7 @@ export class NFT721Api extends NFTsBaseApi { const agreementId = await nft721SalesTemplate.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, + serviceReference, nft721SalesTemplate.params(consumer.getId()), consumer, consumer, diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 07ceffc5b..28e7cc494 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -237,13 +237,13 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { const { nftSalesTemplate } = this.nevermined.keeper.templates const agreementIdSeed = zeroX(generateId()) const nftSalesServiceAgreementTemplate = nftSalesTemplate.getServiceAgreementTemplate() - const nftSalesTemplateConditions = nftSalesTemplate.getServiceAgreementTemplateConditions() nftSalesServiceAgreementTemplate.conditions = getConditionsByParams( serviceType, - nftSalesTemplateConditions, + nftSalesServiceAgreementTemplate.conditions, owner.getId(), assetPrice, + ddo.id, token.getAddress(), undefined, provider || owner.getId(), @@ -260,7 +260,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { attributes: { main: { name: 'nftSalesAgreement', - creator: owner, + creator: owner.getId(), datePublished: new Date().toISOString().replace(/\.[0-9]{3}/, ''), timeout: 86400, }, @@ -313,9 +313,21 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { ): Promise { const { nftSalesTemplate } = this.nevermined.keeper.templates const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) - const assetPrice = DDO.getAssetPriceFromService(service) + + let assetPrice + try { + assetPrice = DDO.getAssetPriceFromService(service) + } catch (_e) { + assetPrice = undefined + } // has no privkeys, so we can't sign - const currentNftHolder = new Account(DDO.getNftHolderFromService(service)) + let currentNftHolder + try { + currentNftHolder = new Account(DDO.getNftHolderFromService(service)) + } catch (_e) { + currentNftHolder = undefined + } + const did = DDO.getDIDFromService(service) const ddo = await this.nevermined.assets.resolve(did) ddo.updateService(service) diff --git a/src/services/metadata/MetadataService.ts b/src/services/metadata/MetadataService.ts index ddfd76415..f8023bdcf 100644 --- a/src/services/metadata/MetadataService.ts +++ b/src/services/metadata/MetadataService.ts @@ -3,7 +3,6 @@ import { DID } from '../../nevermined' import { MarketplaceApi } from './MarketplaceAPI' import { ApiError, HttpError } from '../../errors' import { SearchQuery } from '../../common/interfaces' - export const apiPath = '/api/v1/metadata/assets/ddo' export const servicePath = '/api/v1/metadata/assets/service' @@ -328,8 +327,10 @@ export class MetadataService extends MarketplaceApi { ): Promise { const fullUrl = `${this.url}${servicePath}` agreement['agreementId'] = agreementId + const agreementStore = JSON.stringify(agreement) + const result: ServiceSecondary = await this.nevermined.utils.fetch - .post(fullUrl, JSON.stringify(agreement), { + .post(fullUrl, agreementStore, { Authorization: `Bearer ${this.config.marketplaceAuthToken}`, }) .then((response: any) => { @@ -348,6 +349,7 @@ export class MetadataService extends MarketplaceApi { .catch((error) => { throw new ApiError(error) }) + return result } diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index c7d7dc414..47dc21a04 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -33,6 +33,7 @@ export function getConditionsByParams( conditions: Readonly, owner: string, assetPrice: AssetPrice = new AssetPrice(), + did?: string, erc20TokenContract?: string, nftTokenContract?: string, nftHolder?: string, @@ -60,6 +61,7 @@ export function getConditionsByParams( parameter, owner, assetPrice, + did, erc20TokenContract, nftTokenContract, nftHolder, @@ -75,6 +77,7 @@ function getParameter( parameter: ServiceAgreementTemplateParameter, owner: string, assetPrice: AssetPrice = new AssetPrice(), + did?: string, erc20TokenContract?: string, nftTokenContract?: string, nftHolder?: string, @@ -84,21 +87,26 @@ function getParameter( ): ServiceAgreementTemplateParameter { const getValue = (name) => { switch (name) { - case 'amounts' || '_amounts': + case 'amounts': return Array.from(assetPrice.getAmounts(), (v) => v.toString()) case 'receivers': return assetPrice.getReceivers() - case 'amount' || 'price': + case 'amount': + case 'price': return String(assetPrice.getTotalPrice()) - case 'assetId' || 'documentId' || 'documentKeyId' || 'did': - return '{DID}' + case 'did': + case 'assetId': + case 'documentId': + case 'documentKeyId': + return did || '{DID}' case 'rewardAddress': return owner case 'numberNfts': return String(nftAmount) case 'tokenAddress': return erc20TokenContract - case 'contract' || 'contractAddress': + case 'contract': + case 'contractAddress': return nftTokenContract ? nftTokenContract : '' case 'nftHolder': return nftHolder ? nftHolder : '' diff --git a/tsconfig.json b/tsconfig.json index a1fe37ed0..4828e1e2e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "esModuleInterop": true, "skipLibCheck": true, "allowSyntheticDefaultImports": true, - "lib": ["es2019", "ES2020", "ES2017", "ES6", "ES7", "DOM"], + "lib": ["es2019", "ES2020", "ES2021.String", "ES2017", "ES6", "ES7", "DOM"], "declaration": true, "module": "CommonJS", "target": "ES6", From ac92f199604e76b0d3f18f1d741ac77999ff115a Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 13 Jul 2023 18:19:20 +0200 Subject: [PATCH 013/151] fix: finding the correct contract method --- src/keeper/contracts/ContractBase.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 18a12d2e5..09aa6d119 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -2,7 +2,12 @@ import { Account } from '../../nevermined' import { ContractEvent, EventHandler, SubgraphEvent } from '../../events' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { KeeperError } from '../../errors' -import { ContractTransactionReceipt, ContractTransactionResponse, ethers } from 'ethers' +import { + ContractTransactionReceipt, + ContractTransactionResponse, + FunctionFragment, + ethers, +} from 'ethers' import { parseUnits } from '../../sdk' export interface TxParameters { value?: string @@ -253,9 +258,10 @@ export abstract class ContractBase extends Instantiable { } private searchMethod(methodName: string, args: any[] = []) { - // const methods = this.contract.interface.fragments.filter((f) => f.name === methodName) - // const foundMethod = methods.find((f) => f.inputs.length === args.length) || methods[0] - const foundMethod = this.contract.interface.getFunction(methodName, args) + const methods = this.contract.interface.fragments.filter( + (f: FunctionFragment) => f.name === methodName, + ) + const foundMethod = methods.find((f) => f.inputs.length === args.length) || methods[0] if (!foundMethod) { throw new KeeperError(`Method "${methodName}" is not part of contract "${this.contractName}"`) } From b8f6bd4e0894f1cd49599d043a0e6c2bfdc93b27 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 13 Jul 2023 18:43:02 +0200 Subject: [PATCH 014/151] fix: issue with getting condition by address --- src/keeper/Keeper.ts | 2 +- src/keeper/contracts/managers/ConditionStoreManager.ts | 10 +++++----- .../contracts/templates/AgreementTemplate.abstract.ts | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index 41969a380..b30093d34 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -351,7 +351,7 @@ export class Keeper extends Instantiable { * @returns Condition instance. */ public getConditionByAddress(address: string): ConditionSmall { - return this.conditionsList.find(async (condition) => (await condition.getAddress()) === address) + return this.conditionsList.find((condition) => condition.address === address) } /** diff --git a/src/keeper/contracts/managers/ConditionStoreManager.ts b/src/keeper/contracts/managers/ConditionStoreManager.ts index 501e5c6e5..03289706a 100644 --- a/src/keeper/contracts/managers/ConditionStoreManager.ts +++ b/src/keeper/contracts/managers/ConditionStoreManager.ts @@ -56,12 +56,12 @@ export class ConditionStoreManager extends ContractBase { const a: any = await this.call('getCondition', [zeroX(conditionId)]) return { typeRef: a.typeRef, - state: +a.state, - timeLock: +a.timeLock, - timeOut: +a.timeOut, - blockNumber: +a.blockNumber, + state: Number(a.state), + timeLock: Number(a.timeLock), + timeOut: Number(a.timeOut), + blockNumber: Number(a.blockNumber), lastUpdatedBy: a.lastUpdatedBy, - blockNumberUpdated: +a.blockNumberUpdated, + blockNumberUpdated: Number(a.blockNumberUpdated), } as ConditionData } } diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index b24997e18..c54b65183 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -358,15 +358,15 @@ export abstract class AgreementTemplate extends ContractBase { {}, ) - const statesPromises = Object.keys(dependencies).map(async (ref) => { + const states: { ref: string; contractName: string; state: ConditionState }[] = [] + for (const ref in dependencies) { const { contractName } = await this.getServiceAgreementTemplateConditionByRef(ref) - return { + states.push({ ref, contractName, state: (await conditionStore.getCondition(conditionIdByCondition[contractName])).state, - } - }) - const states = await Promise.all(statesPromises) + }) + } return states.reduce((acc, { contractName, ref, state }) => { const blockers = dependencies[ref] From ac14d4641e96a8d875ceaecc9a02236877529785 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Tue, 18 Jul 2023 10:47:35 +0200 Subject: [PATCH 015/151] feat: remove getAddress method from ContractBase --- .../nevermined/AaveCredit.test.ts | 19 +-- integration/external/Datasets.e2e.test.ts | 6 +- integration/external/Services.e2e.test.ts | 6 +- .../nevermined/AssetsPriceQuery.test.ts | 6 +- integration/nevermined/CustomToken.test.ts | 2 +- integration/nevermined/NFT1155.test.ts | 2 +- integration/nevermined/NFT1155Api.e2e.test.ts | 28 ++-- integration/nevermined/NFT721Api.e2e.test.ts | 8 +- .../nevermined/NFT721Templates.test.ts | 88 ++++++------- integration/nevermined/NFTTemplates.test.ts | 124 +++++++----------- .../nevermined/NFTTemplatesWithEther.test.ts | 16 +-- integration/nevermined/Poap.test.ts | 2 +- .../nevermined/RegisterAccessTemplate.test.ts | 36 +++-- ...sterEscrowComputeExecutionTemplate.test.ts | 32 ++--- .../nevermined/SecondaryMarket.test.ts | 44 +++---- .../nevermined/SubscriptionDuration.test.ts | 6 +- .../nevermined/Subscriptions.e2e.test.ts | 8 +- src/keeper/Keeper.ts | 4 +- src/keeper/contracts/ContractBase.ts | 8 -- .../conditions/EscrowPaymentCondition.ts | 2 +- .../conditions/LockPaymentCondition.ts | 2 +- .../templates/AgreementTemplate.abstract.ts | 7 +- .../templates/BaseTemplate.abstract.ts | 2 +- src/nevermined/Token.ts | 4 +- src/nevermined/api/ConditionsApi.ts | 10 +- src/nevermined/api/RegistryBaseApi.ts | 2 +- src/nevermined/api/nfts/NFTsBaseApi.ts | 4 +- .../conditions/EscrowPaymentCondition.test.ts | 13 +- .../conditions/LockPaymentCondition.test.ts | 54 +++----- .../conditions/NFT721LockCondition.test.ts | 2 +- .../conditions/NFTAccessCondition.test.ts | 11 +- .../conditions/NFTHolderCondition.test.ts | 12 +- .../TransferDIDOwnershipCondition.test.ts | 9 +- .../conditions/TransferNFTCondition.test.ts | 24 ++-- .../keeper/templates/DIDSalesTemplate.test.ts | 9 +- .../templates/EscrowAccessTemplate.test.ts | 2 +- .../templates/NFT721AccessTemplate.test.ts | 9 +- .../templates/NFT721SalesTemplate.test.ts | 9 +- .../templates/NFTAccessTemplate.test.ts | 9 +- .../keeper/templates/NFTSalesTemplate.test.ts | 9 +- 40 files changed, 246 insertions(+), 404 deletions(-) diff --git a/aave_integration/nevermined/AaveCredit.test.ts b/aave_integration/nevermined/AaveCredit.test.ts index 896d6d88a..6533722e7 100644 --- a/aave_integration/nevermined/AaveCredit.test.ts +++ b/aave_integration/nevermined/AaveCredit.test.ts @@ -20,7 +20,7 @@ import config from '../config' import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' import { decodeJwt } from 'jose' -import { Contract } from 'ethers' +import { ethers } from 'ethers' import { NFTAttributes } from '../../src/models/NFTAttributes' chai.use(chaiAsPromised) @@ -38,7 +38,7 @@ describe('AaveCredit', () => { let conditionIds: string[] let vaultAddress: string let nftContractAddress: string - let nftContract: Contract + let nftContract: ethers.BaseContract let nft721Wrapper: Nft721Contract let ddo: DDO let did: string @@ -87,14 +87,7 @@ describe('AaveCredit', () => { ;[deployer, lender, borrower, otherAccount] = await nevermined.accounts.list() timeLocks = [0, 0, 0, 0, 0, 0] timeOuts = [0, 0, 0, 0, 0, 0] - // await nevermined.keeper.conditionStoreManager.delegateCreateRole( - // nevermined.keeper.agreementStoreManager.getAddress(), - // deployer.getId() - // ) - - // agreementId = '0xf2f7338941f5469cb8bbf8b2e600ecb8d53e6755ec5d45658cf1a764e0d40f0e' - // did = 'did:nv:1af704df5b61eea09af8f327a0453480d5a218f4c4f8a7c6d4145c7b7b52d7b8' - // const nftAddress: string = '0xb17527F1D07cD919a3290e8faC330319aB92abdC' + const nftAddress = '' // nft721Wrapper is instance of Nft721Contract -> ContractBase if (nftAddress.toString() !== '') { @@ -148,7 +141,7 @@ describe('AaveCredit', () => { dai = await CustomToken.getInstanceByAddress(_config, delegatedAsset) weth = await CustomToken.getInstanceByAddress(_config, collateralAsset) isTemplateApproved = await nevermined.keeper.templateStoreManager.isApproved( - aaveCreditTemplate.getAddress(), + aaveCreditTemplate.address, ) }) @@ -157,7 +150,7 @@ describe('AaveCredit', () => { it('should propose the AaveCreditTemplate', async () => { if (!isTemplateApproved) { await nevermined.keeper.templateStoreManager.proposeTemplate( - aaveCreditTemplate.getAddress(), + aaveCreditTemplate.address, otherAccount, true, ) @@ -167,7 +160,7 @@ describe('AaveCredit', () => { it('should approve the AaveCreditTemplate', async () => { if (!isTemplateApproved) { await nevermined.keeper.templateStoreManager.approveTemplate( - aaveCreditTemplate.getAddress(), + aaveCreditTemplate.address, deployer, true, ) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index 828850bdc..b262cd89c 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -138,9 +138,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { editor: await token.balanceOf(publisher.getId()), subscriber: await token.balanceOf(subscriber.getId()), reseller: await token.balanceOf(reseller.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } console.log(`USING CONFIG:`) @@ -159,7 +157,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, publisher, [ publisher.getId(), - nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'Subscription Service NFT', '', '', diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index e051999b1..ada34b94a 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -180,9 +180,7 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { editor: await token.balanceOf(publisher.getId()), subscriber: await token.balanceOf(subscriber.getId()), reseller: await token.balanceOf(reseller.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } console.log(`USING CONFIG:`) @@ -218,7 +216,7 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, publisher, [ publisher.getId(), - nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'Subscription Service NFT', '', '', diff --git a/integration/nevermined/AssetsPriceQuery.test.ts b/integration/nevermined/AssetsPriceQuery.test.ts index f1f62b883..c7dc1c481 100644 --- a/integration/nevermined/AssetsPriceQuery.test.ts +++ b/integration/nevermined/AssetsPriceQuery.test.ts @@ -23,7 +23,7 @@ describe('Assets Query by Price', () => { before(async () => { nevermined = await Nevermined.getInstance(config) - token = await nevermined.contracts.loadErc20(await nevermined.utils.token.getAddress()) + token = await nevermined.contracts.loadErc20(nevermined.utils.token.getAddress()) price1 = parseUnits('2', await token.decimals()) price2 = parseUnits('17.86', await token.decimals()) @@ -39,9 +39,7 @@ describe('Assets Query by Price', () => { // publish asset with priced service `access` let metadata = getMetadata() metadata.userId = payload.sub - let assetPrice = new AssetPrice(account.getId(), price1).setTokenAddress( - await token.getAddress(), - ) + let assetPrice = new AssetPrice(account.getId(), price1).setTokenAddress(await token.address) const _attributes = AssetAttributes.getInstance({ metadata, diff --git a/integration/nevermined/CustomToken.test.ts b/integration/nevermined/CustomToken.test.ts index 151f5a0d0..6deefcc79 100644 --- a/integration/nevermined/CustomToken.test.ts +++ b/integration/nevermined/CustomToken.test.ts @@ -12,7 +12,7 @@ describe('CustomToken', () => { before(async () => { nevermined = await Nevermined.getInstance(config) ;[account] = await nevermined.accounts.list() - erc20TokenAddress = process.env.TOKEN_ADDRESS || (await nevermined.utils.token.getAddress()) + erc20TokenAddress = process.env.TOKEN_ADDRESS || nevermined.utils.token.getAddress() }) it('should get a custom token instance', async () => { diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index b8786ba69..4b086d693 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -77,7 +77,7 @@ describe('NFT1155 End-to-End', () => { nftContract = await nevermined.utils.contractHandler.deployAbi(erc1155ABI, deployer, [ deployer.getId(), - await nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'NFT1155', 'NVM', '', diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 66311b7e2..b7bbf930a 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -80,7 +80,9 @@ function makeTest(isCustom) { console.debug(`NETWORK FEE = ${fee}`) console.debug( - `Fee receiver: ${feeReceiver}, contract: ${escrowPaymentCondition.getAddress()}, artist: ${artist.getId()}, gallery: ${gallery.getId()}`, + `Fee receiver: ${feeReceiver}, contract: ${ + escrowPaymentCondition.address + }, artist: ${artist.getId()}, gallery: ${gallery.getId()}`, ) if (isCustom) { @@ -133,16 +135,14 @@ function makeTest(isCustom) { await collector1.requestTokens(nftPrice / scale) console.debug( - `Contract balance (initial) ${await token.balanceOf( - await escrowPaymentCondition.getAddress(), - )}`, + `Contract balance (initial) ${await token.balanceOf(escrowPaymentCondition.address)}`, ) initialBalances = { artist: await token.balanceOf(artist.getId()), collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), + escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.address), } }) @@ -205,7 +205,7 @@ function makeTest(isCustom) { assert.isTrue(collector1BalanceBefore >= nftPrice) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) agreementId = await nevermined.nfts1155.order(ddo.id, numberEditions, collector1) @@ -214,7 +214,7 @@ function makeTest(isCustom) { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) console.debug( @@ -233,9 +233,7 @@ function makeTest(isCustom) { const nftBalanceArtistBefore = await nevermined.nfts1155.balance(ddo.id, artist) const nftBalanceCollectorBefore = await nevermined.nfts1155.balance(ddo.id, collector1) - console.debug( - `Contract balance ${await token.balanceOf(await escrowPaymentCondition.getAddress())}`, - ) + console.debug(`Contract balance ${await token.balanceOf(escrowPaymentCondition.address)}`) const receipt = await nevermined.nfts1155.transfer( agreementId, @@ -247,9 +245,7 @@ function makeTest(isCustom) { await sleep(DELAY) console.debug( - `Contract balance (after) ${await token.balanceOf( - await escrowPaymentCondition.getAddress(), - )}`, + `Contract balance (after) ${await token.balanceOf(escrowPaymentCondition.address)}`, ) const nftBalanceArtistAfter = await nevermined.nfts1155.balance(ddo.id, artist) const nftBalanceCollectorAfter = await nevermined.nfts1155.balance(ddo.id, collector1) @@ -265,9 +261,7 @@ function makeTest(isCustom) { it('the artist asks and receives the payment', async () => { await sleep(DELAY) - const escrowPaymentConditionBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBefore = await token.balanceOf(escrowPaymentCondition.address) await sleep(DELAY) const receipt = await nevermined.nfts1155.releaseRewards( agreementId, @@ -279,7 +273,7 @@ function makeTest(isCustom) { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index 660aab91d..856894ddd 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -102,9 +102,7 @@ describe('NFTs721 Api End-to-End', () => { artist: await token.balanceOf(artist.getId()), collector1: await token.balanceOf(collector1.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } }) @@ -166,7 +164,7 @@ describe('NFTs721 Api End-to-End', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.nfts721.releaseRewards(agreementId, ddo.id, artist) @@ -174,7 +172,7 @@ describe('NFTs721 Api End-to-End', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 56beeae44..ec90b432f 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -165,9 +165,7 @@ describe('NFT721Templates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -217,7 +215,7 @@ describe('NFT721Templates E2E', () => { await lockPaymentCondition.hashValues( ddo.shortId(), escrowPaymentCondition.address, - token.getAddress(), + token.address, amounts, receivers, ), @@ -239,8 +237,8 @@ describe('NFT721Templates E2E', () => { amounts, receivers, collector1.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment[1], conditionIdTransferNFT[1], ), @@ -250,10 +248,10 @@ describe('NFT721Templates E2E', () => { const collector1BalanceBefore = await token.balanceOf(collector1.getId()) assert.equal(initialBalances.collector1 + nftPrice, collector1BalanceBefore) - await token.approve(await lockPaymentCondition.getAddress(), nftPrice, collector1) - await token.approve(await escrowPaymentCondition.getAddress(), nftPrice, collector1) + await token.approve(lockPaymentCondition.address, nftPrice, collector1) + await token.approve(escrowPaymentCondition.address, nftPrice, collector1) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const result = await nft721SalesTemplate.createAgreementAndPay( @@ -264,8 +262,8 @@ describe('NFT721Templates E2E', () => { [0, 0, 0], collector1.getId(), 0, - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts, receivers, collector1, @@ -286,7 +284,7 @@ describe('NFT721Templates E2E', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) assert.equal(collector1BalanceAfter, initialBalances.collector1) assert.equal( @@ -318,7 +316,7 @@ describe('NFT721Templates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) await escrowPaymentCondition.fulfill( agreementId, @@ -326,8 +324,8 @@ describe('NFT721Templates E2E', () => { amounts, receivers, collector1.getId(), - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment[1], conditionIdTransferNFT[1], artist, @@ -337,7 +335,7 @@ describe('NFT721Templates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) @@ -429,8 +427,8 @@ describe('NFT721Templates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: await token.balanceOf(await lockPaymentCondition.getAddress()), - escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), + lockPaymentCondition: await token.balanceOf(lockPaymentCondition.address), + escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.address), } }) it('As collector2 I setup an agreement for buying an NFT from collector1', async () => { @@ -439,7 +437,7 @@ describe('NFT721Templates E2E', () => { await lockPaymentCondition.hashValues( ddo.shortId(), escrowPaymentCondition.address, - token.getAddress(), + token.address, amounts2, receivers2, ), @@ -461,8 +459,8 @@ describe('NFT721Templates E2E', () => { amounts2, receivers2, collector2.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment2[1], conditionIdTransferNFT2[1], ), @@ -499,12 +497,12 @@ describe('NFT721Templates E2E', () => { const collector2BalanceBefore = await token.balanceOf(collector2.getId()) assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) - await token.approve(await lockPaymentCondition.getAddress(), nftPrice2, collector2) + await token.approve(lockPaymentCondition.address, nftPrice2, collector2) await lockPaymentCondition.fulfill( agreementId2, ddo.shortId(), - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts2, receivers2, collector2, @@ -514,9 +512,7 @@ describe('NFT721Templates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const collector2BalanceAfter = await token.balanceOf(collector2.getId()) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) assert.equal(collector2BalanceAfter, initialBalances.collector2) assert.equal( escrowPaymentConditionBalance - initialBalances.escrowPaymentCondition, @@ -556,8 +552,8 @@ describe('NFT721Templates E2E', () => { amounts2, receivers2, collector2.getId(), - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment2[1], conditionIdTransferNFT2[1], collector1, @@ -566,9 +562,7 @@ describe('NFT721Templates E2E', () => { const { state } = await conditionStoreManager.getCondition(conditionIdEscrow2[1]) assert.equal(state, ConditionState.Fulfilled) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) const collectorBalance = await token.balanceOf(collector2.getId()) @@ -589,9 +583,7 @@ describe('NFT721Templates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(token.balanceOf(escrowPaymentCondition.address)), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -657,7 +649,7 @@ describe('NFT721Templates E2E', () => { it('I am setting an agreement for buying a NFT and paying it in the same transaction', async () => { const collector1BalanceBefore = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) const result = await nft721SalesTemplate.createAgreementWithPaymentFromDDO( @@ -676,7 +668,7 @@ describe('NFT721Templates E2E', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) assert.equal(collector1BalanceAfter, initialBalances.collector1) assert.equal( @@ -702,7 +694,7 @@ describe('NFT721Templates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.releaseNft721Reward( agreementId, @@ -712,7 +704,7 @@ describe('NFT721Templates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) @@ -778,12 +770,8 @@ describe('NFT721Templates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: Number( - await token.balanceOf(await lockPaymentCondition.getAddress()), - ), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + lockPaymentCondition: Number(await token.balanceOf(lockPaymentCondition.address)), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) }) @@ -810,7 +798,7 @@ describe('NFT721Templates E2E', () => { assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.lockPayment( @@ -818,14 +806,14 @@ describe('NFT721Templates E2E', () => { ddo.shortId(), assetPrice2.getAmounts(), assetPrice2.getReceivers(), - await token.getAddress(), + token.address, collector2, ) assert.isTrue(receipt) const collector2BalanceAfter = await token.balanceOf(collector2.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) assert.equal(collector2BalanceAfter, initialBalances.collector2) assert.equal( @@ -851,7 +839,7 @@ describe('NFT721Templates E2E', () => { it('Collector1 and Artist get the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.releaseNft721Reward( agreementId2, @@ -861,7 +849,7 @@ describe('NFT721Templates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index 41cf2cf61..3b7d70629 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -120,14 +120,14 @@ describe('NFTTemplates E2E', () => { [receivers[0], amounts[0]], [receivers[1], amounts[1]], ]), - ).setTokenAddress(await token.getAddress()) + ).setTokenAddress(token.address) assetPrice2 = new AssetPrice( new Map([ [receivers2[0], amounts2[0]], [receivers2[1], amounts2[1]], ]), - ).setTokenAddress(await token.getAddress()) + ).setTokenAddress(token.address) }) describe('Full flow', () => { @@ -138,9 +138,7 @@ describe('NFTTemplates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } agreementIdSeed = generateId() @@ -187,11 +185,7 @@ describe('NFTTemplates E2E', () => { describe('As an artist I want to register a new artwork', () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll( - await transferNftCondition.getAddress(), - true, - artist, - ) + await nftUpgradeable.setApprovalForAll(transferNftCondition.address, true, artist) const balance = await nftUpgradeable.balance(artist.getId(), ddo.id) assert.deepEqual(balance, 5n) @@ -205,7 +199,7 @@ describe('NFTTemplates E2E', () => { await lockPaymentCondition.hashValues( ddo.id, escrowPaymentCondition.address, - token.getAddress(), + token.address, amounts, receivers, ), @@ -227,8 +221,8 @@ describe('NFTTemplates E2E', () => { amounts, receivers, collector1.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment[1], conditionIdTransferNFT[1], ), @@ -266,13 +260,13 @@ describe('NFTTemplates E2E', () => { const collector1BalanceBefore = await token.balanceOf(collector1.getId()) assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) - await token.approve(await lockPaymentCondition.getAddress(), nftPrice, collector1) - await token.approve(await escrowPaymentCondition.getAddress(), nftPrice, collector1) + await token.approve(lockPaymentCondition.address, nftPrice, collector1) + await token.approve(escrowPaymentCondition.address, nftPrice, collector1) await lockPaymentCondition.fulfill( agreementId, ddo.id, - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts, receivers, collector1, @@ -282,9 +276,7 @@ describe('NFTTemplates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) assert.equal(collector1BalanceAfter, initialBalances.collector1) assert.equal(escrowPaymentConditionBefore + nftPrice, escrowPaymentConditionBalance) @@ -323,7 +315,7 @@ describe('NFTTemplates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) await escrowPaymentCondition.fulfill( @@ -332,8 +324,8 @@ describe('NFTTemplates E2E', () => { amounts, receivers, collector1.getId(), - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment[1], conditionIdTransferNFT[1], artist, @@ -343,7 +335,7 @@ describe('NFTTemplates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) @@ -430,12 +422,8 @@ describe('NFTTemplates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: Number( - await token.balanceOf(await lockPaymentCondition.getAddress()), - ), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + lockPaymentCondition: Number(await token.balanceOf(lockPaymentCondition.address)), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } }) @@ -445,7 +433,7 @@ describe('NFTTemplates E2E', () => { await lockPaymentCondition.hashValues( ddo.id, escrowPaymentCondition.address, - token.getAddress(), + token.address, amounts2, receivers2, ), @@ -467,8 +455,8 @@ describe('NFTTemplates E2E', () => { amounts2, receivers2, collector2.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment2[1], conditionIdTransferNFT2[1], ), @@ -506,12 +494,12 @@ describe('NFTTemplates E2E', () => { const collector2BalanceBefore = await token.balanceOf(collector2.getId()) assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) - await token.approve(await lockPaymentCondition.getAddress(), nftPrice2, collector2) + await token.approve(lockPaymentCondition.address, nftPrice2, collector2) await lockPaymentCondition.fulfill( agreementId2, ddo.id, - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts2, receivers2, collector2, @@ -521,9 +509,7 @@ describe('NFTTemplates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const collector2BalanceAfter = await token.balanceOf(collector2.getId()) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) assert.equal(collector2BalanceAfter, initialBalances.collector2) assert.equal(escrowPaymentConditionBefore + nftPrice2, escrowPaymentConditionBalance) @@ -561,9 +547,7 @@ describe('NFTTemplates E2E', () => { }) it('Collector1 and Artist get the payment', async () => { - const escrowPaymentConditionBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBefore = await token.balanceOf(escrowPaymentCondition.address) await escrowPaymentCondition.fulfill( agreementId2, @@ -571,8 +555,8 @@ describe('NFTTemplates E2E', () => { amounts2, receivers2, collector2.getId(), - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLockPayment2[1], conditionIdTransferNFT2[1], collector1, @@ -582,7 +566,7 @@ describe('NFTTemplates E2E', () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) @@ -607,9 +591,7 @@ describe('NFTTemplates E2E', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -651,11 +633,7 @@ describe('NFTTemplates E2E', () => { describe('As an artist I want to register a new artwork', () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll( - await transferNftCondition.getAddress(), - true, - artist, - ) + await nftUpgradeable.setApprovalForAll(transferNftCondition.address, true, artist) const balance = await nftUpgradeable.balance(artist.getId(), ddo.id) assert.deepEqual(balance, 5n) @@ -683,9 +661,7 @@ describe('NFTTemplates E2E', () => { assert.equal(status && status.escrowPayment.state, ConditionState.Unfulfilled) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) assert.equal(collector1BalanceAfter, initialBalances.collector1) assert.equal(escrowPaymentConditionBalance - nftPrice, escrowPaymentConditionBefore) }) @@ -717,7 +693,7 @@ describe('NFTTemplates E2E', () => { it('the artist asks and receives the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId, @@ -728,7 +704,7 @@ describe('NFTTemplates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) @@ -794,12 +770,8 @@ describe('NFTTemplates E2E', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: Number( - await token.balanceOf(await lockPaymentCondition.getAddress()), - ), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + lockPaymentCondition: Number(await token.balanceOf(lockPaymentCondition.address)), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) }) @@ -827,21 +799,21 @@ describe('NFTTemplates E2E', () => { assert.equal(collector2BalanceBefore, initialBalances.collector2 + nftPrice2) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.lockPayment( agreementId2, ddo.id, assetPrice2.getAmounts(), assetPrice2.getReceivers(), - await token.getAddress(), + token.address, collector2, ) assert.isTrue(receipt) const collector2BalanceAfter = await token.balanceOf(collector2.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) assert.equal(collector2BalanceAfter, initialBalances.collector2) @@ -879,7 +851,7 @@ describe('NFTTemplates E2E', () => { it('Collector1 and Artist get the payment', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId2, @@ -890,7 +862,7 @@ describe('NFTTemplates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) @@ -914,9 +886,7 @@ describe('NFTTemplates E2E', () => { artist: await token.balanceOf(artist.getId()), collector1: await token.balanceOf(collector1.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } agreementIdSeed = generateId() agreementAccessIdSeed = generateId() @@ -985,7 +955,7 @@ describe('NFTTemplates E2E', () => { const collector1BalanceBefore = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) assert.equal(collector1BalanceBefore, initialBalances.collector1 + nftPrice) @@ -994,14 +964,14 @@ describe('NFTTemplates E2E', () => { ddo.id, assetPrice1.getAmounts(), assetPrice1.getReceivers(), - await token.getAddress(), + token.address, collector1, ) assert.isTrue(receipt) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) assert.equal(collector1BalanceAfter, initialBalances.collector1) @@ -1038,7 +1008,7 @@ describe('NFTTemplates E2E', () => { it('The Market releases the rewards to the artist', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId, @@ -1050,7 +1020,7 @@ describe('NFTTemplates E2E', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index 1ca3ed44a..7615c5546 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -134,7 +134,7 @@ describe('NFTTemplates With Ether E2E', async () => { gallery: await gallery.getEtherBalance(), governor: await governor.getEtherBalance(), escrowPaymentCondition: await nevermined.accounts - .getAccount(await escrowPaymentCondition.getAddress()) + .getAccount(escrowPaymentCondition.address) .getEtherBalance(), } @@ -176,11 +176,7 @@ describe('NFTTemplates With Ether E2E', async () => { describe('As an artist I want to register a new artwork', async () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll( - await transferNftCondition.getAddress(), - true, - artist, - ) + await nftUpgradeable.setApprovalForAll(transferNftCondition.address, true, artist) const balance = await nftUpgradeable.balance(artist.getId(), ddo.shortId()) assert.deepEqual(balance, 5n) @@ -218,7 +214,7 @@ describe('NFTTemplates With Ether E2E', async () => { assetPrice.getAmounts(), assetPrice.getReceivers(), collector1.getId(), - escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, conditionIdLockPayment[1], conditionIdTransferNFT[1], @@ -256,7 +252,7 @@ describe('NFTTemplates With Ether E2E', async () => { await lockPaymentCondition.fulfill( agreementId, ddo.shortId(), - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), @@ -306,7 +302,7 @@ describe('NFTTemplates With Ether E2E', async () => { assetPrice.getAmounts(), assetPrice.getReceivers(), collector1.getId(), - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, conditionIdLockPayment[1], conditionIdTransferNFT[1], @@ -317,7 +313,7 @@ describe('NFTTemplates With Ether E2E', async () => { assert.equal(state, ConditionState.Fulfilled) const escrowPaymentConditionBalance = await nevermined.accounts - .getAccount(await escrowPaymentCondition.getAddress()) + .getAccount(escrowPaymentCondition.address) .getEtherBalance() const receiver0Balance = await nevermined.accounts .getAccount(receivers[0]) diff --git a/integration/nevermined/Poap.test.ts b/integration/nevermined/Poap.test.ts index 39949d444..2215d72f6 100644 --- a/integration/nevermined/Poap.test.ts +++ b/integration/nevermined/Poap.test.ts @@ -66,7 +66,7 @@ describe('POAPs with Assets', () => { it('editor should be able to register poap', async () => { const nftAttributes = NFTAttributes.getPOAPInstance({ metadata, - price: new AssetPrice(editor.getId(), 0n, await nevermined.utils.token.getAddress()), + price: new AssetPrice(editor.getId(), 0n, nevermined.utils.token.getAddress()), serviceTypes: ['nft-sales', 'nft-access'], providers: [gatewayAddress], nftContractAddress: await poapContract.getAddress(), diff --git a/integration/nevermined/RegisterAccessTemplate.test.ts b/integration/nevermined/RegisterAccessTemplate.test.ts index 9d50446f6..026e95488 100644 --- a/integration/nevermined/RegisterAccessTemplate.test.ts +++ b/integration/nevermined/RegisterAccessTemplate.test.ts @@ -55,18 +55,14 @@ describe('Register Escrow Access Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { - await keeper.templateStoreManager.proposeTemplate( - await accessTemplate.getAddress(), - consumer, - true, - ) + await keeper.templateStoreManager.proposeTemplate(accessTemplate.address, consumer, true) // TODO: Use a event to detect template mined await sleep(2000) }) it('should approve the template', async () => { await keeper.templateStoreManager.approveTemplate( - await accessTemplate.getAddress(), + accessTemplate.address, templateManagerOwner, true, ) @@ -108,8 +104,8 @@ describe('Register Escrow Access Template', () => { agreementId, await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts, receivers, ), @@ -121,8 +117,8 @@ describe('Register Escrow Access Template', () => { amounts, receivers, consumer.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLock[1], conditionIdAccess[1], ), @@ -136,9 +132,9 @@ describe('Register Escrow Access Template', () => { assert.deepEqual( [...conditionTypes].sort(), [ - await accessCondition.getAddress(), - await escrowPaymentCondition.getAddress(), - await lockPaymentCondition.getAddress(), + accessCondition.address, + escrowPaymentCondition.address, + lockPaymentCondition.address, ].sort(), "The conditions doesn't match", ) @@ -184,13 +180,13 @@ describe('Register Escrow Access Template', () => { Logger.error(error) } - await keeper.token.approve(await lockPaymentCondition.getAddress(), totalAmount, consumer) + await keeper.token.approve(lockPaymentCondition.address, totalAmount, consumer) const contractReceipt = await lockPaymentCondition.fulfill( agreementId, did, - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts, receivers, consumer, @@ -223,8 +219,8 @@ describe('Register Escrow Access Template', () => { amounts, receivers, consumer.getId(), - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLock[1], conditionIdAccess[1], consumer, @@ -298,7 +294,7 @@ describe('Register Escrow Access Template', () => { ddo.shortId(), amounts, receivers, - await token.getAddress(), + token.address, consumer, ) }) @@ -316,7 +312,7 @@ describe('Register Escrow Access Template', () => { receivers, consumer.getId(), ddo.shortId(), - await token.getAddress(), + token.address, publisher, ) }) diff --git a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts index 6cd004478..dbaab1f8f 100644 --- a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts @@ -63,7 +63,7 @@ describe('Register Escrow Compute Execution Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { await keeper.templateStoreManager.proposeTemplate( - await escrowComputeExecutionTemplate.getAddress(), + escrowComputeExecutionTemplate.address, consumer, true, ) @@ -73,7 +73,7 @@ describe('Register Escrow Compute Execution Template', () => { it('should approve the template', async () => { await keeper.templateStoreManager.approveTemplate( - await escrowComputeExecutionTemplate.getAddress(), + escrowComputeExecutionTemplate.address, templateManagerOwner, true, ) @@ -115,8 +115,8 @@ describe('Register Escrow Compute Execution Template', () => { agreementId, await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts, receivers, ), @@ -128,8 +128,8 @@ describe('Register Escrow Compute Execution Template', () => { amounts, receivers, consumer.getId(), - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLock[1], conditionIdCompute[1], ), @@ -143,9 +143,9 @@ describe('Register Escrow Compute Execution Template', () => { assert.deepEqual( [...conditionTypes].sort(), [ - await computeExecutionCondition.getAddress(), - await escrowPaymentCondition.getAddress(), - await lockPaymentCondition.getAddress(), + computeExecutionCondition.address, + escrowPaymentCondition.address, + lockPaymentCondition.address, ].sort(), "The conditions doesn't match", ) @@ -199,13 +199,13 @@ describe('Register Escrow Compute Execution Template', () => { Logger.error(error) } - await keeper.token.approve(await lockPaymentCondition.getAddress(), totalAmount, consumer) + await keeper.token.approve(lockPaymentCondition.address, totalAmount, consumer) const contractReceipt = await lockPaymentCondition.fulfill( agreementId, did, - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts, receivers, consumer, @@ -238,8 +238,8 @@ describe('Register Escrow Compute Execution Template', () => { amounts, receivers, consumer.getId(), - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, conditionIdLock[1], conditionIdCompute[1], consumer, @@ -321,7 +321,7 @@ describe('Register Escrow Compute Execution Template', () => { ddo.shortId(), amounts, receivers, - await token.getAddress(), + token.address, consumer, ) }) @@ -340,7 +340,7 @@ describe('Register Escrow Compute Execution Template', () => { receivers, consumer.getId(), ddo.shortId(), - await token.getAddress(), + token.address, publisher, ) }) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index a9e9b74f0..70e76e789 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -121,21 +121,21 @@ describe('Secondary Markets', () => { [receivers[0], amounts[0]], [receivers[1], amounts[1]], ]), - ).setTokenAddress(await token.getAddress()) + ).setTokenAddress(token.address) assetPrice2 = new AssetPrice( new Map([ [receivers2[0], amounts2[0]], [receivers2[1], amounts2[1]], ]), - ).setTokenAddress(await token.getAddress()) + ).setTokenAddress(token.address) assetPrice3 = new AssetPrice( new Map([ [receivers3[0], amounts2[0]], [receivers3[1], amounts2[1]], ]), - ).setTokenAddress(await token.getAddress()) + ).setTokenAddress(token.address) }) describe('Collector1 initiates the sales agreement', () => { @@ -146,7 +146,7 @@ describe('Secondary Markets', () => { collector1: await token.balanceOf(collector1.getId()), collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), - escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), + escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.address), } agreementIdSeed = generateId() agreementId2Seed = generateId() @@ -197,11 +197,7 @@ describe('Secondary Markets', () => { describe('As an artist I want to register a new artwork', () => { it('I want to register a new artwork and tokenize (via NFT). I want to get 10% royalties', async () => { - await nftUpgradeable.setApprovalForAll( - await transferNftCondition.getAddress(), - true, - artist, - ) + await nftUpgradeable.setApprovalForAll(transferNftCondition.address, true, artist) const balance = await nftUpgradeable.balance(artist.getId(), ddo.id) assert.equal(balance, 5n) @@ -236,15 +232,13 @@ describe('Secondary Markets', () => { ddo.id, assetPrice1.getAmounts(), assetPrice1.getReceivers(), - await token.getAddress(), + token.address, collector1, ) assert.isTrue(receipt) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) assert.equal(collector1BalanceAfter, initialBalances.collector1) assert.equal( escrowPaymentConditionBalance - initialBalances.escrowPaymentCondition, @@ -280,9 +274,7 @@ describe('Secondary Markets', () => { ) assert.isTrue(receipt) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) const receiver0Balance = await token.balanceOf(receivers[0]) const receiver1Balance = await token.balanceOf(receivers[1]) const collectorBalance = await token.balanceOf(collector1.getId()) @@ -344,8 +336,8 @@ describe('Secondary Markets', () => { collector2: await token.balanceOf(collector2.getId()), gallery: await token.balanceOf(gallery.getId()), owner: await token.balanceOf(owner.getId()), - lockPaymentCondition: await token.balanceOf(await lockPaymentCondition.getAddress()), - escrowPaymentCondition: await token.balanceOf(await escrowPaymentCondition.getAddress()), + lockPaymentCondition: await token.balanceOf(lockPaymentCondition.address), + escrowPaymentCondition: await token.balanceOf(escrowPaymentCondition.address), } setNFTRewardsFromDDOByService(ddo, 'nft-sales', assetPrice2, collector1.getId()) }) @@ -361,7 +353,7 @@ describe('Secondary Markets', () => { nftSalesTemplateConditions, ddo, assetPrice2, - await token.getAddress(), + token.address, undefined, collector1.getId(), numberNFTs2, @@ -371,7 +363,7 @@ describe('Secondary Markets', () => { type: 'nft-sales', index: 6, serviceEndpoint: nevermined.services.node.getNftEndpoint(), - templateId: await nftSalesTemplate.getAddress(), + templateId: nftSalesTemplate.address, attributes: { main: { name: 'nftSalesAgreement', @@ -428,9 +420,7 @@ describe('Secondary Markets', () => { assert.isTrue(receipt) const collector2BalanceAfter = await token.balanceOf(collector2.getId()) - const escrowPaymentConditionBalance = await token.balanceOf( - await escrowPaymentCondition.getAddress(), - ) + const escrowPaymentConditionBalance = await token.balanceOf(escrowPaymentCondition.address) assert.equal(collector2BalanceAfter, initialBalances.collector2) assert.equal( @@ -470,7 +460,7 @@ describe('Secondary Markets', () => { const assetPriceFromServiceAgreement = getAssetPriceFromService(nftSalesServiceAgreement) const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receipt = await nevermined.agreements.conditions.releaseNftReward( @@ -482,7 +472,7 @@ describe('Secondary Markets', () => { assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers2[0]) const receiver1Balance = await token.balanceOf(receivers2[1]) @@ -586,7 +576,7 @@ describe('Secondary Markets', () => { it('As collector2 I see the bid locked and trigger the reward release', async () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const result = await nevermined.nfts1155.releaseSecondaryMarketRewards( @@ -603,7 +593,7 @@ describe('Secondary Markets', () => { assert.equal(nftBalanceCollector2After, nftBalanceCollector2Before - numberNFTs2) const escrowPaymentConditionBalanceAfter = await token.balanceOf( - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ) const receiver0Balance = await token.balanceOf(receivers3[0]) const receiver1Balance = await token.balanceOf(receivers3[1]) diff --git a/integration/nevermined/SubscriptionDuration.test.ts b/integration/nevermined/SubscriptionDuration.test.ts index b3e1a012a..9f26da18f 100644 --- a/integration/nevermined/SubscriptionDuration.test.ts +++ b/integration/nevermined/SubscriptionDuration.test.ts @@ -31,7 +31,7 @@ describe('Subscription Durations', () => { ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, publisher, [ publisher.getId(), - nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'Subscription Service NFT', '', '', @@ -116,7 +116,7 @@ describe('Subscription Durations', () => { ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, publisher, [ publisher.getId(), - nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'Subscription Service NFT', '', '', @@ -201,7 +201,7 @@ describe('Subscription Durations', () => { ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, publisher, [ publisher.getId(), - nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'Subscription Service NFT', '', '', diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index 8606e7e80..c39804369 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -101,9 +101,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { editor: await token.balanceOf(editor.getId()), subscriber: await token.balanceOf(subscriber.getId()), reseller: await token.balanceOf(reseller.getId()), - escrowPaymentCondition: Number( - await token.balanceOf(await escrowPaymentCondition.getAddress()), - ), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), } }) @@ -118,7 +116,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, editor, [ editor.getId(), - nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'Subscription NFT', '', '', @@ -293,7 +291,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, editor, [ editor.getId(), - nevermined.keeper.didRegistry.getAddress(), + nevermined.keeper.didRegistry.address, 'Subscription NFT', '', '', diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index b30093d34..9b50a9576 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -378,9 +378,7 @@ export class Keeper extends Instantiable { * @returns Agreement template instance. */ public getTemplateByAddress(address: string) { - return Object.values(this.templates).find( - async (template) => (await template.getAddress()) === address, - ) + return Object.values(this.templates).find((template) => template.address === address) } /** diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 09aa6d119..af5e2d104 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -33,14 +33,6 @@ export abstract class ContractBase extends Instantiable { this.contractName = contractName } - public getContract(): ethers.BaseContract { - return this.contract - } - - public async getAddress(): Promise { - return this.contract.getAddress() - } - public getSignatureOfMethod(methodName: string, args: any[] = []): string { const foundMethod = this.searchMethod(methodName, args) return foundMethod.format() diff --git a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts index 0f72de22e..2575ca3b2 100644 --- a/src/keeper/contracts/conditions/EscrowPaymentCondition.ts +++ b/src/keeper/contracts/conditions/EscrowPaymentCondition.ts @@ -49,7 +49,7 @@ export class EscrowPaymentCondition extends ProviderCondition p.name === '_tokenAddress').value as string, lock.id, access.id, diff --git a/src/keeper/contracts/conditions/LockPaymentCondition.ts b/src/keeper/contracts/conditions/LockPaymentCondition.ts index 114c90f1b..a4060df93 100644 --- a/src/keeper/contracts/conditions/LockPaymentCondition.ts +++ b/src/keeper/contracts/conditions/LockPaymentCondition.ts @@ -31,7 +31,7 @@ export class LockPaymentCondition extends ConsumerCondition { const payment = findServiceConditionByName(service, 'lockPayment') return this.params( ddo.shortId(), - await this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), + this.nevermined.keeper.conditions.escrowPaymentCondition.address, payment.parameters.find((p) => p.name === '_tokenAddress').value as string, rewards.getAmounts(), rewards.getReceivers(), diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index c54b65183..a75cf7885 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -86,7 +86,7 @@ export abstract class AgreementTemplate extends ContractBase { const payment = findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') return { - rewardAddress: await this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress(), + rewardAddress: this.nevermined.keeper.conditions.escrowPaymentCondition.address, tokenAddress: payment.parameters.find((p) => p.name === '_tokenAddress').value as string, amounts: assetPrice.getAmounts(), receivers: assetPrice.getReceivers(), @@ -270,8 +270,7 @@ export abstract class AgreementTemplate extends ContractBase { const assetPrice = getAssetPriceFromService(service) const payment = findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') - const rewardAddress = - await this.nevermined.keeper.conditions.escrowPaymentCondition.getAddress() + const rewardAddress = this.nevermined.keeper.conditions.escrowPaymentCondition.address const tokenAddress = payment.parameters.find((p) => p.name === '_tokenAddress').value as string const amounts = assetPrice.getAmounts() const receivers = assetPrice.getReceivers() @@ -413,7 +412,7 @@ export abstract class AgreementTemplate extends ContractBase { if (token) { this.logger.debug('Approving tokens', totalAmount) - await token.approve(await lockPaymentCondition.getAddress(), totalAmount, from, txParams) + await token.approve(lockPaymentCondition.address, totalAmount, from, txParams) } } diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index e755f6590..e21a48543 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -72,7 +72,7 @@ export abstract class BaseTemplate type: this.service(), index: serviceIndex[this.service()], serviceEndpoint: this.nevermined.services.node.getServiceEndpoint(this.serviceEndpoint()), - templateId: await this.getAddress(), + templateId: this.address, attributes: { main: { creator: publisher.getId(), diff --git a/src/nevermined/Token.ts b/src/nevermined/Token.ts index 9b8131af8..62f742fce 100644 --- a/src/nevermined/Token.ts +++ b/src/nevermined/Token.ts @@ -27,8 +27,8 @@ export class TokenUtils extends Instantiable { return await this.nevermined.keeper.token.symbol() } - public async getAddress(): Promise { - return this.nevermined.keeper.token.getAddress() + public getAddress(): string { + return this.nevermined.keeper.token.address } /** diff --git a/src/nevermined/api/ConditionsApi.ts b/src/nevermined/api/ConditionsApi.ts index b1122468e..b0dcc4c27 100644 --- a/src/nevermined/api/ConditionsApi.ts +++ b/src/nevermined/api/ConditionsApi.ts @@ -66,14 +66,14 @@ export class ConditionsApi extends Instantiable { if (token) { this.logger.debug('Approving tokens', totalAmount) - await token.approve(await lockPaymentCondition.getAddress(), totalAmount, from, txParams) + await token.approve(lockPaymentCondition.address, totalAmount, from, txParams) } const contractReceipt: ContractTransactionReceipt = await lockPaymentCondition.fulfill( agreementId, did, - await escrowPaymentCondition.getAddress(), - token ? await token.getAddress() : erc20TokenAddress, + escrowPaymentCondition.address, + token ? token.address : erc20TokenAddress, amounts, receivers, from, @@ -205,8 +205,8 @@ export class ConditionsApi extends Instantiable { amounts, receivers, returnAddress, - await escrowPaymentCondition.getAddress(), - token ? await token.getAddress() : erc20TokenAddress, + escrowPaymentCondition.address, + token ? token.address : erc20TokenAddress, storedAgreement.conditionIds[1], storedAgreement.conditionIds[0], from, diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 40d77e62f..fe3a38b2f 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -66,7 +66,7 @@ export abstract class RegistryBaseApi extends Instantiable { const { neverminedNodeUri } = this.config const { didRegistry } = this.nevermined.keeper const tokenAddress = - assetAttributes.price.getTokenAddress() || (await this.nevermined.utils.token.getAddress()) + assetAttributes.price.getTokenAddress() || this.nevermined.utils.token.getAddress() // create ddo itself const ddo = DDO.getInstance( diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 6251119e0..89c70d7e7 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -252,7 +252,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { nftSalesTemplateConditions, ddo, assetPrice, - await token.getAddress(), + token.address, undefined, provider || owner, nftAmount, @@ -263,7 +263,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { type: serviceType, index: 6, serviceEndpoint: this.nevermined.services.node.getNftEndpoint(), - templateId: await nftSalesTemplate.getAddress(), + templateId: nftSalesTemplate.address, did: ddo.id, attributes: { main: { diff --git a/test/keeper/conditions/EscrowPaymentCondition.test.ts b/test/keeper/conditions/EscrowPaymentCondition.test.ts index c860c4ca6..804ceeb53 100644 --- a/test/keeper/conditions/EscrowPaymentCondition.test.ts +++ b/test/keeper/conditions/EscrowPaymentCondition.test.ts @@ -26,14 +26,7 @@ describe('EscrowPaymentCondition', () => { ;({ token } = keeper) lockCondition = await keeper.conditions.lockPaymentCondition - .generateIdHash( - agreementId, - did, - condition.getAddress(), - token.getAddress(), - amounts, - receivers, - ) + .generateIdHash(agreementId, did, condition.address, token.address, amounts, receivers) .catch((e) => { console.log(e) throw e @@ -56,7 +49,7 @@ describe('EscrowPaymentCondition', () => { receivers, consumer, publisher, - token.getAddress(), + token.address, lockCondition, releaseCondition, ) @@ -73,7 +66,7 @@ describe('EscrowPaymentCondition', () => { receivers, consumer, publisher, - token.getAddress(), + token.address, lockCondition, releaseCondition, ) diff --git a/test/keeper/conditions/LockPaymentCondition.test.ts b/test/keeper/conditions/LockPaymentCondition.test.ts index 8be7124b7..8b4eb8fdc 100644 --- a/test/keeper/conditions/LockPaymentCondition.test.ts +++ b/test/keeper/conditions/LockPaymentCondition.test.ts @@ -48,7 +48,7 @@ describe('LockPaymentCondition', () => { const hash = await lockPaymentCondition.hashValues( did, seller.getId(), - token.getAddress(), + token.address, assetPrice.getAmounts(), assetPrice.getReceivers(), ) @@ -62,7 +62,7 @@ describe('LockPaymentCondition', () => { const hash = await lockPaymentCondition.hashValues( did, seller.getId(), - token.getAddress(), + token.address, assetPrice.getAmounts(), assetPrice.getReceivers(), ) @@ -76,32 +76,24 @@ describe('LockPaymentCondition', () => { it('should fulfill with token', async () => { const hash = await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, assetPrice.getAmounts(), assetPrice.getReceivers(), ) const conditionId = await lockPaymentCondition.generateId(agreementId, hash) - await conditionStoreManager.createCondition( - conditionId, - await lockPaymentCondition.getAddress(), - owner, - ) + await conditionStoreManager.createCondition(conditionId, lockPaymentCondition.address, owner) await buyer.requestTokens(assetPrice.getTotalPrice()) - await token.approve( - await lockPaymentCondition.getAddress(), - assetPrice.getTotalPrice(), - buyer, - ) + await token.approve(lockPaymentCondition.address, assetPrice.getTotalPrice(), buyer) await lockPaymentCondition.fulfill( agreementId, did, - await escrowPaymentCondition.getAddress(), - await token.getAddress(), + escrowPaymentCondition.address, + token.address, assetPrice.getAmounts(), assetPrice.getReceivers(), buyer, @@ -113,23 +105,19 @@ describe('LockPaymentCondition', () => { it('should fulfill with ether', async () => { const hash = await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), ) const conditionId = await lockPaymentCondition.generateId(agreementId, hash) - await conditionStoreManager.createCondition( - conditionId, - await lockPaymentCondition.getAddress(), - owner, - ) + await conditionStoreManager.createCondition(conditionId, lockPaymentCondition.address, owner) await lockPaymentCondition.fulfill( agreementId, did, - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), @@ -143,24 +131,20 @@ describe('LockPaymentCondition', () => { it('should fail to fulfill without ether', async () => { const hash = await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), ) const conditionId = await lockPaymentCondition.generateId(agreementId, hash) - await conditionStoreManager.createCondition( - conditionId, - await lockPaymentCondition.getAddress(), - owner, - ) + await conditionStoreManager.createCondition(conditionId, lockPaymentCondition.address, owner) await assert.isRejected( lockPaymentCondition.fulfill( agreementId, did, - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), @@ -173,24 +157,20 @@ describe('LockPaymentCondition', () => { it('should fail to fulfill with too few ether', async () => { const hash = await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), ) const conditionId = await lockPaymentCondition.generateId(agreementId, hash) - await conditionStoreManager.createCondition( - conditionId, - await lockPaymentCondition.getAddress(), - owner, - ) + await conditionStoreManager.createCondition(conditionId, lockPaymentCondition.address, owner) await assert.isRejected( lockPaymentCondition.fulfill( agreementId, did, - await escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, assetPrice.getAmounts(), assetPrice.getReceivers(), diff --git a/test/keeper/conditions/NFT721LockCondition.test.ts b/test/keeper/conditions/NFT721LockCondition.test.ts index 6d354a2ca..642084f92 100644 --- a/test/keeper/conditions/NFT721LockCondition.test.ts +++ b/test/keeper/conditions/NFT721LockCondition.test.ts @@ -62,7 +62,7 @@ describe('NFT721LockCondition', () => { did = await didRegistry.hashDID(didSeed, owner.getId()) await nft721Wrapper.mint(didZeroX(did), owner) - await nft721Wrapper.setApprovalForAll(await nft721LockCondition.getAddress(), true, owner) + await nft721Wrapper.setApprovalForAll(nft721LockCondition.address, true, owner) }) describe('#hashValues()', () => { diff --git a/test/keeper/conditions/NFTAccessCondition.test.ts b/test/keeper/conditions/NFTAccessCondition.test.ts index 7a68af9a1..5fe4c7d18 100644 --- a/test/keeper/conditions/NFTAccessCondition.test.ts +++ b/test/keeper/conditions/NFTAccessCondition.test.ts @@ -43,10 +43,7 @@ describe('NFTAccessCondition', () => { nevermined.keeper) ;[owner, grantee, templateId, other] = await nevermined.accounts.list() - await conditionStoreManager.delegateCreateRole( - await agreementStoreManager.getAddress(), - owner.getId(), - ) + await conditionStoreManager.delegateCreateRole(agreementStoreManager.address, owner.getId()) await templateStoreManager.proposeTemplate(templateId.getId()) await templateStoreManager.approveTemplate(templateId.getId()) @@ -101,7 +98,7 @@ describe('NFTAccessCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [await nftAccessCondition.getAddress()], + [nftAccessCondition.address], [hashValues], [0], [2], @@ -140,7 +137,7 @@ describe('NFTAccessCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [await nftAccessCondition.getAddress()], + [nftAccessCondition.address], [hashValues], [0], [2], @@ -163,7 +160,7 @@ describe('NFTAccessCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [await nftAccessCondition.getAddress()], + [nftAccessCondition.address], [hashValues], [0], [2], diff --git a/test/keeper/conditions/NFTHolderCondition.test.ts b/test/keeper/conditions/NFTHolderCondition.test.ts index f2cef6c2b..52479d1a1 100644 --- a/test/keeper/conditions/NFTHolderCondition.test.ts +++ b/test/keeper/conditions/NFTHolderCondition.test.ts @@ -76,11 +76,7 @@ describe('NFTHolderCondition', () => { const hashValues = await nftHolderCondition.hashValues(did, holder.getId(), amount) const conditionId = await nftHolderCondition.generateId(agreementId, hashValues) - await conditionStoreManager.createCondition( - conditionId, - await nftHolderCondition.getAddress(), - owner, - ) + await conditionStoreManager.createCondition(conditionId, nftHolderCondition.address, owner) const nftAttributes = NFTAttributes.getInstance({ metadata: undefined, @@ -170,11 +166,7 @@ describe('NFTHolderCondition', () => { const hashValues = await nftHolderCondition.hashValues(did, holder.getId(), amount) const conditionId = await nftHolderCondition.generateId(agreementId, hashValues) - await conditionStoreManager.createCondition( - conditionId, - await nftHolderCondition.getAddress(), - owner, - ) + await conditionStoreManager.createCondition(conditionId, nftHolderCondition.address, owner) const nftAttributes = NFTAttributes.getInstance({ metadata: undefined, diff --git a/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts b/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts index 29d68be1d..3961b6bd3 100644 --- a/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts +++ b/test/keeper/conditions/TransferDIDOwnershipCondition.test.ts @@ -39,10 +39,7 @@ describe('TransferDIDOwnershipCondition', () => { nevermined.keeper) ;[owner, receiver, templateId] = await nevermined.accounts.list() - await conditionStoreManager.delegateCreateRole( - await agreementStoreManager.getAddress(), - owner.getId(), - ) + await conditionStoreManager.delegateCreateRole(agreementStoreManager.address, owner.getId()) try { await templateStoreManager.proposeTemplate(templateId.getId()) @@ -54,7 +51,7 @@ describe('TransferDIDOwnershipCondition', () => { } await didRegistry.grantRegistryOperatorRole( - await transferDidOwnershipCondition.getAddress(), + transferDidOwnershipCondition.address, owner.getId(), ) }) @@ -105,7 +102,7 @@ describe('TransferDIDOwnershipCondition', () => { await agreementStoreManager.createAgreement( agreementId, did, - [await transferDidOwnershipCondition.getAddress()], + [transferDidOwnershipCondition.address], [hashValues], [0], [2], diff --git a/test/keeper/conditions/TransferNFTCondition.test.ts b/test/keeper/conditions/TransferNFTCondition.test.ts index 36e6f1d95..bb4708bc3 100644 --- a/test/keeper/conditions/TransferNFTCondition.test.ts +++ b/test/keeper/conditions/TransferNFTCondition.test.ts @@ -103,8 +103,8 @@ describe('TransferNFTCondition', () => { const did = await didRegistry.hashDID(didSeed, owner.getId()) const hashValuesPayment = await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), - token.getAddress(), + escrowPaymentCondition.address, + token.address, amounts, receivers, ) @@ -144,17 +144,13 @@ describe('TransferNFTCondition', () => { await nevermined.nfts1155.mint(did, nftAmount, owner.getId(), owner) await nftReceiver.requestTokens(10) - await nevermined.keeper.token.approve( - await lockPaymentCondition.getAddress(), - 10n, - nftReceiver, - ) + await nevermined.keeper.token.approve(lockPaymentCondition.address, 10n, nftReceiver) await lockPaymentCondition.fulfill( agreementId, did, escrowPaymentCondition.address, - await token.getAddress(), + token.address, amounts, receivers, nftReceiver, @@ -203,7 +199,7 @@ describe('TransferNFTCondition', () => { const did = await didRegistry.hashDID(didSeed, owner.getId()) const hashValuesPayment = await lockPaymentCondition.hashValues( did, - escrowPaymentCondition.getAddress(), + escrowPaymentCondition.address, ZeroAddress, amounts, receivers, @@ -298,7 +294,7 @@ describe('TransferNFTCondition', () => { const hashValuesPayment = await lockPaymentCondition.hashValues( did, lockPaymentCondition.address, - token.getAddress(), + token.address, amounts, receivers, ) @@ -337,17 +333,13 @@ describe('TransferNFTCondition', () => { await nevermined.nfts1155.mint(did, nftAmount, owner.getId(), owner) await nftReceiver.requestTokens(10) - await nevermined.keeper.token.approve( - await lockPaymentCondition.getAddress(), - 10n, - nftReceiver, - ) + await nevermined.keeper.token.approve(lockPaymentCondition.address, 10n, nftReceiver) await lockPaymentCondition.fulfill( agreementId, did, lockPaymentCondition.address, - await token.getAddress(), + token.address, amounts, receivers, nftReceiver, diff --git a/test/keeper/templates/DIDSalesTemplate.test.ts b/test/keeper/templates/DIDSalesTemplate.test.ts index 62f5de0e7..819c6de15 100644 --- a/test/keeper/templates/DIDSalesTemplate.test.ts +++ b/test/keeper/templates/DIDSalesTemplate.test.ts @@ -44,10 +44,7 @@ describe('DIDSalesTemplate', () => { timeLocks = [0, 0, 0] timeOuts = [0, 0, 0] - await conditionStoreManager.delegateCreateRole( - await agreementStoreManager.getAddress(), - sender.getId(), - ) + await conditionStoreManager.delegateCreateRole(agreementStoreManager.address, sender.getId()) }) beforeEach(async () => { @@ -91,8 +88,8 @@ describe('DIDSalesTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(await didSalesTemplate.getAddress()) - await templateStoreManager.approveTemplate(await didSalesTemplate.getAddress()) + await templateStoreManager.proposeTemplate(didSalesTemplate.address) + await templateStoreManager.approveTemplate(didSalesTemplate.address) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( diff --git a/test/keeper/templates/EscrowAccessTemplate.test.ts b/test/keeper/templates/EscrowAccessTemplate.test.ts index b3ce49953..92fc27ee6 100644 --- a/test/keeper/templates/EscrowAccessTemplate.test.ts +++ b/test/keeper/templates/EscrowAccessTemplate.test.ts @@ -23,7 +23,7 @@ describe('AccessTemplate', () => { it('should hash the values', async () => { const address = `0x${'a'.repeat(40)}` const did = `0x${'a'.repeat(64)}` - const hash = await condition.hashValues(did, address, token.getAddress(), [15], [address]) + const hash = await condition.hashValues(did, address, token.address, [15], [address]) assert.match(hash, /^0x[a-f0-9]{64}$/i) }) diff --git a/test/keeper/templates/NFT721AccessTemplate.test.ts b/test/keeper/templates/NFT721AccessTemplate.test.ts index 9c9575140..4f188dbf7 100644 --- a/test/keeper/templates/NFT721AccessTemplate.test.ts +++ b/test/keeper/templates/NFT721AccessTemplate.test.ts @@ -44,10 +44,7 @@ describe('NFT721AccessTemplate', () => { timeLocks = [0, 0] timeOuts = [0, 0] - await conditionStoreManager.delegateCreateRole( - await agreementStoreManager.getAddress(), - sender.getId(), - ) + await conditionStoreManager.delegateCreateRole(agreementStoreManager.address, sender.getId()) }) beforeEach(async () => { @@ -87,8 +84,8 @@ describe('NFT721AccessTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(await nft721AccessTemplate.getAddress()) - await templateStoreManager.approveTemplate(await nft721AccessTemplate.getAddress()) + await templateStoreManager.proposeTemplate(nft721AccessTemplate.address) + await templateStoreManager.approveTemplate(nft721AccessTemplate.address) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( diff --git a/test/keeper/templates/NFT721SalesTemplate.test.ts b/test/keeper/templates/NFT721SalesTemplate.test.ts index 78c93faf8..51fb3c32c 100644 --- a/test/keeper/templates/NFT721SalesTemplate.test.ts +++ b/test/keeper/templates/NFT721SalesTemplate.test.ts @@ -44,10 +44,7 @@ describe('NFT721SalesTemplate', () => { timeLocks = [0, 0, 0] timeOuts = [0, 0, 0] - await conditionStoreManager.delegateCreateRole( - await agreementStoreManager.getAddress(), - sender.getId(), - ) + await conditionStoreManager.delegateCreateRole(agreementStoreManager.address, sender.getId()) }) beforeEach(async () => { @@ -91,8 +88,8 @@ describe('NFT721SalesTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(await nft721SalesTemplate.getAddress()) - await templateStoreManager.approveTemplate(await nft721SalesTemplate.getAddress()) + await templateStoreManager.proposeTemplate(nft721SalesTemplate.address) + await templateStoreManager.approveTemplate(nft721SalesTemplate.address) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( diff --git a/test/keeper/templates/NFTAccessTemplate.test.ts b/test/keeper/templates/NFTAccessTemplate.test.ts index 977b9e80a..4aa0e6227 100644 --- a/test/keeper/templates/NFTAccessTemplate.test.ts +++ b/test/keeper/templates/NFTAccessTemplate.test.ts @@ -44,10 +44,7 @@ describe('NFTAccessTemplate', () => { timeLocks = [0, 0] timeOuts = [0, 0] - await conditionStoreManager.delegateCreateRole( - await agreementStoreManager.getAddress(), - sender.getId(), - ) + await conditionStoreManager.delegateCreateRole(agreementStoreManager.address, sender.getId()) }) beforeEach(async () => { @@ -87,8 +84,8 @@ describe('NFTAccessTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(await nftAccessTemplate.getAddress()) - await templateStoreManager.approveTemplate(await nftAccessTemplate.getAddress()) + await templateStoreManager.proposeTemplate(nftAccessTemplate.address) + await templateStoreManager.approveTemplate(nftAccessTemplate.address) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( diff --git a/test/keeper/templates/NFTSalesTemplate.test.ts b/test/keeper/templates/NFTSalesTemplate.test.ts index 8b413bf29..40b452331 100644 --- a/test/keeper/templates/NFTSalesTemplate.test.ts +++ b/test/keeper/templates/NFTSalesTemplate.test.ts @@ -44,10 +44,7 @@ describe('NFTSalesTemplate', () => { timeLocks = [0, 0, 0] timeOuts = [0, 0, 0] - await conditionStoreManager.delegateCreateRole( - await agreementStoreManager.getAddress(), - sender.getId(), - ) + await conditionStoreManager.delegateCreateRole(agreementStoreManager.address, sender.getId()) }) beforeEach(async () => { @@ -91,8 +88,8 @@ describe('NFTSalesTemplate', () => { it('should fail if DID is not registered', async () => { // propose and approve template - await templateStoreManager.proposeTemplate(await nftSalesTemplate.getAddress()) - await templateStoreManager.approveTemplate(await nftSalesTemplate.getAddress()) + await templateStoreManager.proposeTemplate(nftSalesTemplate.address) + await templateStoreManager.approveTemplate(nftSalesTemplate.address) const did = await didRegistry.hashDID(didSeed, sender.getId()) await assert.isRejected( From 5a6c7a7a96077c6b4bf39177b5052c78f15aefde Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Tue, 18 Jul 2023 15:38:24 +0200 Subject: [PATCH 016/151] feat: use SEED_WORDS in unit tests --- .github/workflows/testing.yml | 7 +- .../nevermined/AgreementStoreManager.test.ts | 2 +- package.json | 4 +- src/events/ContractEvent.ts | 2 +- src/keeper/ContractHandler.ts | 15 ++- test/config.ts | 10 +- test/keeper/TestContractHandler.ts | 93 +++++++++++-------- .../conditions/AaveBorrowCondition.test.ts | 2 +- 8 files changed, 82 insertions(+), 53 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index edc0361fe..1bb390ca3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -71,14 +71,15 @@ jobs: - name: Install dependencies run: | yarn - - name: Run linters - run: yarn lint - name: Start ganache - run: yarn ganache --port 18545 --chain.chainId 8998 & + env: + SEED_WORDS: ${{ secrets.seedWords }} + run: yarn ganache --port 18545 --chain.chainId 8998 -- mnemonic $SEED_WORDS & - name: Run unit tests env: ETH_PORT: 18545 + SEED_WORDS: ${{ secrets.seedWords }} run: | yarn run test:cover diff --git a/integration/nevermined/AgreementStoreManager.test.ts b/integration/nevermined/AgreementStoreManager.test.ts index d33c4ba6d..b48b60730 100644 --- a/integration/nevermined/AgreementStoreManager.test.ts +++ b/integration/nevermined/AgreementStoreManager.test.ts @@ -53,7 +53,7 @@ describe('Agreement Store Manager', () => { const num = agreements.length await account2.requestTokens( - ddo.getPriceByService() * 10n ** -BigInt(await nevermined.keeper.token.decimals()), + ddo.getPriceByService() * 10n ** BigInt(await nevermined.keeper.token.decimals()), ) agreementId = await nevermined.assets.order(ddo.id, account2) diff --git a/package.json b/package.json index d72cf0c73..9232a1d21 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "test": "mocha", "test:watch": "mocha -w --watch-extensions js,ts,json", "test:cover": "nyc --report-dir coverage/unit mocha --opts test/mocha.opts ./test/**/*.test.ts", - "integration": "mocha --opts integration/mocha.opts ./integration/**/*.test.ts", + "integration": "mocha --opts integration/mocha.opts ./integration/nevermined/*.test.ts", "integration:subgraph": "mocha --opts integration/mocha.opts ./integration/**/*.test.subgraph.ts", "integration:production": "export NETWORK_NAME=production; yarn integration", "integration:staging": "export NETWORK_NAME=staging; yarn integration", @@ -110,7 +110,7 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-tsdoc": "^0.2.16", "express": "^4.18.2", - "ganache": "^7.0.2", + "ganache": "^7.9.0", "http-proxy": "^1.18.1", "husky": "^8.0.3", "lcov-result-merger": "^3.1.0", diff --git a/src/events/ContractEvent.ts b/src/events/ContractEvent.ts index d745118d7..9ea4acaa0 100644 --- a/src/events/ContractEvent.ts +++ b/src/events/ContractEvent.ts @@ -38,7 +38,7 @@ export class ContractEvent extends NeverminedEvent { options.toBlock = 'latest' // Temporary workaround to work with mumbai - // Infura as a 1000 blokcs limit on their api + // Infura as a 1000 blocks limit on their api if (chainId === 80001 || chainId === 42) { const latestBlock = await this.web3.getBlockNumber() options.fromBlock = latestBlock - 99 diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index c1971dc07..d31ca1932 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -3,7 +3,12 @@ import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { KeeperError } from '../errors/KeeperError' import { ApiError } from '../errors/ApiError' import { Account } from '../nevermined' -import { ContractTransactionReceipt, ContractTransactionResponse, ethers } from 'ethers' +import { + ContractTransactionReceipt, + ContractTransactionResponse, + FunctionFragment, + ethers, +} from 'ethers' let fetch if (typeof window !== 'undefined') { @@ -221,7 +226,13 @@ export class ContractHandler extends Instantiable { methodName: string, args: any[], ): string { - const foundMethod = baseContract.interface.getFunction(methodName, args) + const methods = baseContract.interface.fragments.filter( + (f: FunctionFragment) => f.name === methodName, + ) + const foundMethod = methods.find((f) => f.inputs.length === args.length) || methods[0] + if (!foundMethod) { + throw new Error(`Method "${methodName}" not found in contract`) + } return foundMethod.format() } diff --git a/test/config.ts b/test/config.ts index ce1a67b79..e1074ae9b 100644 --- a/test/config.ts +++ b/test/config.ts @@ -1,9 +1,9 @@ -import { NeverminedOptions, LogLevel } from '../src' +import { NeverminedOptions, LogLevel, makeAccounts } from '../src' import { LoggerInstance } from '../src/utils' LoggerInstance.setLevel(LogLevel.Error) -export default { +const config = { marketplaceUri: 'http://localhost:3100', neverminedNodeUri: 'http://localhost:8030', neverminedNodeAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0', @@ -19,3 +19,9 @@ export default { agreementFee: 15, }, } as NeverminedOptions + +if (process.env.SEED_WORDS) { + config.accounts = makeAccounts(process.env.SEED_WORDS) +} + +export default config diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index a6498d8cc..d7386ed24 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -4,20 +4,23 @@ import * as KeeperUtils from '../../src/keeper/utils' import Logger from '../../src/utils/Logger' import config from '../config' import { ZeroAddress } from '../../src/utils' -import { ContractTransactionReceipt, ContractTransactionResponse, ethers } from 'ethers' +import { + ContractTransactionReceipt, + ContractTransactionResponse, + JsonRpcSigner, + ethers, +} from 'ethers' import fs from 'fs' import { NeverminedOptions } from '../../src' -interface ContractTest extends ethers.BaseContract { - testContract?: boolean - $initialized?: boolean -} - export default abstract class TestContractHandler extends ContractHandler { public static async prepareContracts(): Promise { TestContractHandler.setConfig(config) - const [deployerAddress] = await TestContractHandler.addresses(TestContractHandler.config) + const [deployerAddress] = await TestContractHandler.addresses( + TestContractHandler.config, + TestContractHandler.web3, + ) TestContractHandler.networkId = Number((await TestContractHandler.web3.getNetwork()).chainId) TestContractHandler.minter = ethers.encodeBytes32String('minter') @@ -63,22 +66,19 @@ export default abstract class TestContractHandler extends ContractHandler { ) // Add dispenser as Token minter - if (!token.$initialized) { - const signer = await TestContractHandler.findSignerStatic( - TestContractHandler.config, - TestContractHandler.web3, - deployerAddress, - ) - const contract = token.connect(signer) - const args = [TestContractHandler.minter, await dispenser.getAddress()] - const methodSignature = ContractHandler.getSignatureOfMethod(contract, 'grantRole', args) - const transactionResponse: ContractTransactionResponse = await contract[methodSignature]( - ...args, - ) - const contractReceipt: ContractTransactionReceipt = await transactionResponse.wait() - if (contractReceipt.status !== 1) { - throw new Error('Error calling "grantRole" on "token"') - } + + const signer = await TestContractHandler.findSignerStatic( + TestContractHandler.config, + TestContractHandler.web3, + deployerAddress, + ) + const contract = token.connect(signer) + const args = [TestContractHandler.minter, await dispenser.getAddress()] + const methodSignature = ContractHandler.getSignatureOfMethod(contract, 'grantRole', args) + let transactionResponse: ContractTransactionResponse = await contract[methodSignature](...args) + let contractReceipt: ContractTransactionReceipt = await transactionResponse.wait() + if (contractReceipt.status !== 1) { + throw new Error('Error calling "grantRole" on "token"') } const didRegistry = await TestContractHandler.deployContract('DIDRegistry', deployerAddress, [ @@ -104,10 +104,10 @@ export default abstract class TestContractHandler extends ContractHandler { 0, ]) - let transactionResponse: ContractTransactionResponse = await didRegistry.getFunction( - 'setNFT1155', - )(await erc1155.getAddress()) - let contractReceipt: ContractTransactionReceipt = await transactionResponse.wait() + transactionResponse = await didRegistry.connect(signer).getFunction('setNFT1155')( + await erc1155.getAddress(), + ) + contractReceipt = await transactionResponse.wait() if (contractReceipt.status !== 1) { throw new Error('Error calling "setNFT1155" on "didRegistry"') } @@ -168,7 +168,7 @@ export default abstract class TestContractHandler extends ContractHandler { deployerAddress, [deployerAddress, await conditionStoreManager.getAddress(), await erc1155.getAddress()], ) - transactionResponse = await erc1155.getFunction('grantOperatorRole')( + transactionResponse = await erc1155.connect(signer).getFunction('grantOperatorRole')( await nftLockCondition.getAddress(), ) contractReceipt = await transactionResponse.wait() @@ -205,7 +205,7 @@ export default abstract class TestContractHandler extends ContractHandler { ZeroAddress, ], ) - transactionResponse = await erc1155.getFunction('grantOperatorRole')( + transactionResponse = await erc1155.connect(signer).getFunction('grantOperatorRole')( await transferNftCondition.getAddress(), ) contractReceipt = await transactionResponse.wait() @@ -213,7 +213,7 @@ export default abstract class TestContractHandler extends ContractHandler { throw new Error('Error calling "grantOperatorRole" on "erc721"') } - transactionResponse = await erc1155.getFunction('grantOperatorRole')( + transactionResponse = await erc1155.connect(signer).getFunction('grantOperatorRole')( await didRegistry.getAddress(), ) contractReceipt = await transactionResponse.wait() @@ -351,8 +351,20 @@ export default abstract class TestContractHandler extends ContractHandler { return web3.getSigner(from) } - public static async addresses(config: NeverminedOptions): Promise { - return await Promise.all((config.accounts || []).map((a) => a.getAddress())) + public static async addresses( + config: NeverminedOptions, + web3: ethers.JsonRpcProvider | ethers.BrowserProvider, + ): Promise { + let ethAccounts: JsonRpcSigner[] = [] + try { + ethAccounts = await web3.listAccounts() + } catch (e) { + // ignore + } + const addresses = await Promise.all((config.accounts || []).map((a) => a.getAddress())) + return addresses.concat( + await Promise.all(ethAccounts.map(async (signer) => await signer.getAddress())), + ) } private static async deployContract( @@ -361,18 +373,15 @@ export default abstract class TestContractHandler extends ContractHandler { args: any[] = [], tokens: { [name: string]: string } = {}, init = true, - ): Promise { + ): Promise { const where = TestContractHandler.networkId - // dont redeploy if there is already something loaded + // do not redeploy if there is already something loaded if (TestContractHandler.hasContract(name, where)) { - const contract: ContractTest = ContractHandler.getContract(name, where) - if (contract.testContract) { - return { ...contract, $initialized: true } as any - } + return ContractHandler.getContract(name, where) } - let contractInstance: ContractTest + let contractInstance: ethers.BaseContract try { const networkName = ( await KeeperUtils.getNetworkName(TestContractHandler.networkId) @@ -388,7 +397,6 @@ export default abstract class TestContractHandler extends ContractHandler { tokens, init, ) - contractInstance.testContract = true ContractHandler.setContract(name, where, contractInstance) } catch (err) { Logger.error( @@ -413,7 +421,10 @@ export default abstract class TestContractHandler extends ContractHandler { ): Promise { if (!from) { // eslint-disable-next-line @typescript-eslint/no-extra-semi - ;[from] = await TestContractHandler.addresses(TestContractHandler.config) + ;[from] = await TestContractHandler.addresses( + TestContractHandler.config, + TestContractHandler.web3, + ) } const sendConfig = { diff --git a/test/keeper/conditions/AaveBorrowCondition.test.ts b/test/keeper/conditions/AaveBorrowCondition.test.ts index d4ed24964..5075c94c2 100644 --- a/test/keeper/conditions/AaveBorrowCondition.test.ts +++ b/test/keeper/conditions/AaveBorrowCondition.test.ts @@ -11,7 +11,7 @@ import { DIDRegistry } from '../../../src/keeper' let condition: AaveBorrowCondition describe('AaveBorrowCondition', () => { - let did: string // = `did:nv:${'a'.repeat(64)}` + let did: string let agreementId: string const vaultAddress = `0x${'a'.repeat(40)}` const assetToBorrow = `0x${'a'.repeat(40)}` From 07418cd700a8feb71f586210d9bef1f4fbf73e20 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Tue, 18 Jul 2023 16:40:47 +0200 Subject: [PATCH 017/151] fix: getting event data with ethers --- integration/config.ts | 2 +- integration/nevermined/Artifacts.test.ts | 3 ++- package.json | 1 + src/events/ContractEvent.ts | 10 ++++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/integration/config.ts b/integration/config.ts index 5afc4ca70..84d211f07 100644 --- a/integration/config.ts +++ b/integration/config.ts @@ -4,7 +4,7 @@ import { LoggerInstance, LogLevel, makeAccounts } from '../src/utils' LoggerInstance.setLevel(LogLevel.Error) const logLevel = Number(process.env['LOG_LEVEL']) || 1 // warn by default -const infuraToken = process.env['INFURA_TOKEN'] +export const infuraToken = process.env['INFURA_TOKEN'] const ipfsGateway = process.env['IPFS_GATEWAY'] || 'https://ipfs.io' const ipfsProjectId = process.env['IPFS_PROJECT_ID'] diff --git a/integration/nevermined/Artifacts.test.ts b/integration/nevermined/Artifacts.test.ts index 936a0fbf1..45cca7815 100644 --- a/integration/nevermined/Artifacts.test.ts +++ b/integration/nevermined/Artifacts.test.ts @@ -3,12 +3,13 @@ import { mkdtempSync, writeFileSync } from 'fs' import { NeverminedOptions, Nevermined } from '../../src' import fetch from 'node-fetch' import { x } from 'tar' +import { infuraToken } from '../config' describe('Artifacts', () => { const artifactsRepo = 'https://artifacts.nevermined.network/' const tests = [ { - web3ProviderUri: 'https://matic-mumbai.chainstacklabs.com', + web3ProviderUri: `https://polygon-mumbai.infura.io/v3/${infuraToken}`, networkName: ['mumbai'], networkId: [80001], versions: ['v3.2.1'], diff --git a/package.json b/package.json index 9232a1d21..b8f2e659e 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "@types/mocha": "^5.2.7", "@types/node": "^20.1.0", "@types/node-fetch": "^2.5.7", + "@types/tar": "^6.1.5", "@types/temp": "^0.9.1", "@typescript-eslint/eslint-plugin": "^5.30.5", "@typescript-eslint/parser": "^5.30.5", diff --git a/src/events/ContractEvent.ts b/src/events/ContractEvent.ts index 9ea4acaa0..eea0b2e15 100644 --- a/src/events/ContractEvent.ts +++ b/src/events/ContractEvent.ts @@ -1,4 +1,4 @@ -import { EventEmitter, EventOptions, EventResult, NeverminedEvent } from './NeverminedEvent' +import { EventEmitter, EventOptions, EventResult, Filter, NeverminedEvent } from './NeverminedEvent' import { ContractBase } from '../keeper' import { KeeperError } from '../errors' import { Nevermined } from '../nevermined' @@ -26,7 +26,8 @@ export class ContractEvent extends NeverminedEvent { `Event "${options.eventName}" not found on contract "${this.contract.contractName}"`, ) } - const eventFilter: ethers.ContractEventName = options.eventName + const args = this.filterToArgs(options.eventName, options.filterJsonRpc) + const eventFilter = this.contract.contract.filters[options.eventName](...args) return this.contract.contract.queryFilter(eventFilter, options.fromBlock, options.toBlock) } @@ -56,4 +57,9 @@ export class ContractEvent extends NeverminedEvent { private eventExists(eventName: string): boolean { return !!this.contract.contract.interface.getEvent(eventName) } + + private filterToArgs(eventName: string, filter: Filter): Array { + const event = this.contract.contract.interface.getEvent(eventName) + return event.inputs.filter((i) => i.indexed).map((i) => filter[i.name]) + } } From 00a564f0921bbc7a8f09d26f8448c913072fdd45 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 19 Jul 2023 10:44:54 +0200 Subject: [PATCH 018/151] fix: issue with ethers using duplicated nonces - issue was solved by disabling the cache when instantiating the JsonRpcProvider - other small test fixes --- integration/nevermined/ClaimPaymentAbortedAgreement.test.ts | 1 - integration/nevermined/Provenance.test.ts | 4 ++-- integration/utils/utils.ts | 2 +- package.json | 2 +- src/keeper/Web3Provider.ts | 2 +- src/keeper/contracts/Nft721Contract.ts | 2 ++ 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts index 89fc21bdd..544262246 100644 --- a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts +++ b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts @@ -70,7 +70,6 @@ describe('Claim aborted agreements End-to-End', () => { (nevermined.keeper as any).instanceConfig, await nft.getAddress(), ) - await nevermined.contracts.loadNft721(nftContract.address) const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(publisher) diff --git a/integration/nevermined/Provenance.test.ts b/integration/nevermined/Provenance.test.ts index 13ece66c8..f2f90159e 100644 --- a/integration/nevermined/Provenance.test.ts +++ b/integration/nevermined/Provenance.test.ts @@ -68,7 +68,7 @@ describe('Provenance', () => { intermediary.getId(), publisher.getId(), activitiesIds.intermediary, - ethers.zeroPadValue('0x0', 32), + ethers.zeroPadValue('0x', 32), 'FirstIntermediaryStuff', publisher, ) @@ -104,7 +104,7 @@ describe('Provenance', () => { ddo.shortId(), intermediary.getId(), activitiesIds.intermediary, - ethers.zeroPadValue('0x0', 32), + ethers.zeroPadValue('0x', 32), 'FirstIntermediaryStuff', intermediary, ) diff --git a/integration/utils/utils.ts b/integration/utils/utils.ts index 3da5cc433..6c0b86776 100644 --- a/integration/utils/utils.ts +++ b/integration/utils/utils.ts @@ -47,7 +47,7 @@ export async function mineBlocks(nevermined: Nevermined, account: Account, block generateId(), account.getId(), account.getId(), - ethers.zeroPadValue('0x0', 32), + ethers.zeroPadValue('0x', 32), 'mining', account, ) diff --git a/package.json b/package.json index b8f2e659e..d59686865 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "codegen-graph-ts": "npm:@nevermined-io/codegen-graph-ts@0.1.4", "crypto-browserify": "^3.12.0", "deprecated-decorator": "^0.1.6", - "ethers": "^6.6.2", + "ethers": "^6.6.4", "https-browserify": "^1.0.0", "jose": "^4.5.1", "js-file-download": "^0.4.12", diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index cedce4ec3..8a0db3a70 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -14,6 +14,6 @@ export class Web3Provider { return new ethers.BrowserProvider(config.web3Provider) } - return new ethers.JsonRpcProvider(config.web3ProviderUri) + return new ethers.JsonRpcProvider(config.web3ProviderUri, undefined, { cacheTimeout: -1 }) } } diff --git a/src/keeper/contracts/Nft721Contract.ts b/src/keeper/contracts/Nft721Contract.ts index 2804c036e..8d7410bf7 100644 --- a/src/keeper/contracts/Nft721Contract.ts +++ b/src/keeper/contracts/Nft721Contract.ts @@ -26,6 +26,7 @@ export class Nft721Contract extends NFTContractsBase { await new ContractHandler(config).checkExists(address) nft.contract = new ethers.Contract(address, solidityABI.abi, nft.web3) + nft.address = await nft.contract.getAddress() return nft } @@ -45,6 +46,7 @@ export class Nft721Contract extends NFTContractsBase { await new ContractHandler(config).checkExists(address) nft.contract = new ethers.Contract(address, solidityABI.abi, nft.web3) + nft.address = await nft.contract.getAddress() return nft } From e0837788382cf77ca191086b34ac8215a27eb5d1 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:50:03 +0200 Subject: [PATCH 019/151] feat: draft nfts support --- .../NFTsWithMultipleServices.test.ts | 170 ++++++++++++++++++ src/ddo/types.ts | 6 +- .../conditions/Condition.abstract.ts | 1 + .../NFTs/TransferNFT721Condition.ts | 24 +++ .../templates/AgreementTemplate.abstract.ts | 7 +- .../templates/BaseTemplate.abstract.ts | 9 +- .../templates/NFT721SalesTemplate.ts | 3 +- .../contracts/templates/NFTSalesTemplate.ts | 3 +- src/models/AssetAttributes.ts | 12 -- src/models/NFTAttributes.ts | 94 ++++++---- src/nevermined/AccessService.ts | 19 +- src/nevermined/api/ConditionsApi.ts | 2 + src/nevermined/api/RegistryBaseApi.ts | 29 +-- src/nevermined/api/nfts/NFT1155Api.ts | 4 + .../conditions/NFTLockCondition.test.ts | 32 +++- .../conditions/TransferNFTCondition.test.ts | 24 ++- 16 files changed, 339 insertions(+), 100 deletions(-) create mode 100644 integration/nevermined/NFTsWithMultipleServices.test.ts diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts new file mode 100644 index 000000000..7f39b7f80 --- /dev/null +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -0,0 +1,170 @@ +import { assert } from 'chai' +import { decodeJwt, JWTPayload } from 'jose' +import { config } from '../config' +import { getMetadata } from '../utils' +import { + Nevermined, + Account, + MetaData, + DDO, + AssetPrice, + Token, + ContractHandler, + Nft721Contract, + NFTAttributes, +} from '../../src' +import { BigNumber } from '../../src/utils' +import { ethers } from 'ethers' + +let nevermined: Nevermined +let publisher: Account +let collector1: Account +let metadata: MetaData +let assetPrice1: AssetPrice +let assetPrice2: AssetPrice +let payload: JWTPayload +let ddo: DDO +let token: Token +let service +let agreementId +let neverminedNodeAddress +let nft: ethers.Contract +let nftContract: Nft721Contract +let nftContractOwner: Account +const totalAmount1 = '100' +const totalAmount2 = '150' + +describe('NFTs with multiple services', () => { + before(async () => { + nevermined = await Nevermined.getInstance(config) + ;({ token } = nevermined.keeper) + // Accounts + ;[publisher, collector1] = await nevermined.accounts.list() + + neverminedNodeAddress = await nevermined.services.node.getProviderAddress() + + const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const erc721ABI = await ContractHandler.getABI( + 'NFT721Upgradeable', + config.artifactsFolder, + networkName, + ) + + nft = await nevermined.utils.contractHandler.deployAbi(erc721ABI, publisher, [ + publisher.getId(), + nevermined.keeper.didRegistry.address, + 'NFT721', + 'NVM', + '', + '0', + ]) + + nftContract = await Nft721Contract.getInstance( + (nevermined.keeper as any).instanceConfig, + nft.address, + ) + + await nevermined.contracts.loadNft721(nftContract.address) + + nftContractOwner = new Account((await nftContract.owner()) as string) + + await nftContract.grantOperatorRole( + nevermined.keeper.conditions.transferNft721Condition.address, + nftContractOwner) + + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(publisher) + + await nevermined.services.marketplace.login(clientAssertion) + + payload = decodeJwt(config.marketplaceAuthToken) + assetPrice1 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount1)) + assetPrice2 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount2)) + + try { + await collector1.requestTokens(BigNumber.from(totalAmount1).mul(10)) + } catch (error) { + console.error(error) + } + + metadata = getMetadata() + metadata.userId = payload.sub + }) + + describe('E2E flow for an asset with multiple nft-sales services', () => { + it('Register with multiple access services', async () => { + + const nftAttributes = NFTAttributes.getNFT721Instance({ + metadata, + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + nft: { nftTransfer: true } + }, + { + serviceType: 'nft-sales', + price: assetPrice2, + nft: { nftTransfer: false } + }, + { + serviceType: 'nft-access', + }, + ], + nftContractAddress: nftContract.address, + providers: [neverminedNodeAddress], + }) + + ddo = await nevermined.nfts721.create(nftAttributes, publisher) + + assert.isDefined(ddo) + console.log(ddo.id) + + const salesServices = ddo.getServicesByType('nft-sales') + assert.equal(salesServices.length, 2) + + const accessServices = ddo.getServicesByType('nft-access') + assert.equal(accessServices.length, 1) + + assert.equal( + salesServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], + totalAmount2, + ) + assert.equal( + salesServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], + totalAmount1, + ) + + assert.isDefined(ddo.findServiceByType('metadata')) + }) + + it('I am ordering the NFT between multiple nft-sales services', async () => { + + const collector1BalanceBefore = await token.balanceOf(collector1.getId()) + + const salesServices = ddo.getServicesByType('nft-sales') + service = salesServices[0] + + agreementId = await nevermined.nfts721.order(ddo.id, collector1, service.index) + + assert.isDefined(agreementId) + console.log(`Agreement Id: ${agreementId}`) + + const collector1BalanceAfter = await token.balanceOf(collector1.getId()) + + const price = DDO.getAssetPriceFromService(service) + assert.isTrue( + collector1BalanceBefore.sub(price.getTotalPrice()) + .eq(collector1BalanceAfter)) + }) + + it('The publisher can check the payment and transfer the NFT to the collector', async () => { + assert.equal(await nevermined.nfts721.ownerOfAsset(ddo.id), publisher.getId()) + + const receipt = await nevermined.nfts721.transfer(agreementId, ddo.id, collector1) + assert.isTrue(receipt) + + assert.equal(await nevermined.nfts721.ownerOfAsset(ddo.id), collector1.getId()) + }) + + }) +}) diff --git a/src/ddo/types.ts b/src/ddo/types.ts index bed8fa082..af4dcf1a6 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -1,7 +1,7 @@ import { AaveConditionType, ServiceAaveCredit, TxParameters } from '../keeper' import { Account } from '../sdk' import { BigNumber } from 'ethers' -import { ERCType, NeverminedNFTType, AssetPrice, Babysig, NFTAttributes } from '../models' +import { ERCType, NeverminedNFTType, AssetPrice, Babysig, NFTAttributes, NFTServiceAttributes } from '../models' export interface Authentication { type: string @@ -599,6 +599,7 @@ export interface ServiceAttributes { serviceType: ServiceType serviceIndex?: number price?: AssetPrice + nft?: NFTServiceAttributes } export interface ServiceAuthorization extends ServiceCommon { @@ -727,8 +728,9 @@ export interface ServicePlugin { createService( publisher: Account, metadata: MetaData, + serviceAttributes: ServiceAttributes, nftAttributes: NFTAttributes, - assetPrice?: AssetPrice, + // assetPrice?: AssetPrice, pricedData?: PricedMetadataInformation, ): T // Process agreement for provider diff --git a/src/keeper/contracts/conditions/Condition.abstract.ts b/src/keeper/contracts/conditions/Condition.abstract.ts index 029e0c77c..e67a52de2 100644 --- a/src/keeper/contracts/conditions/Condition.abstract.ts +++ b/src/keeper/contracts/conditions/Condition.abstract.ts @@ -20,6 +20,7 @@ export interface ConditionContext { service: Service price: AssetPrice creator: string + serviceReference?: number } export interface ConditionParameters { diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts index 5ce8e31ec..de92205ae 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts @@ -80,6 +80,30 @@ export class TransferNFT721Condition extends ProviderCondition p.name === '_contractAddress') + .value as string + const nftHolder = transfer.parameters.find((p) => p.name === '_nftHolder').value as string + + const nftTransferString = transfer.parameters.find((p) => p.name === '_nftTransfer') + .value as string + return this.params( + ddo.shortId(), + nftHolder, + consumerId, + lockCondition.id, + nftAddress, + nftTransferString.toLowerCase() === 'true', + expiration, + ) + } + + public async paramsFromService( { ddo, service, consumerId, expiration }: TransferNFT721ConditionContext, lockCondition, ) { diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index 4779d3d6f..99ba4f7ca 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -197,8 +197,9 @@ export abstract class AgreementTemplate extends ContractBase { public abstract service(): ServiceType - public standardContext(ddo: DDO, creator: string): ConditionContext { - const service = ddo.findServiceByType(this.service()) + public standardContext(ddo: DDO, creator: string, serviceReference?: number): ConditionContext { + + const service = serviceReference ? ddo.findServiceById(serviceReference) : ddo.findServiceByType(this.service()) let rewards try { rewards = DDO.getAssetPriceFromService(service) @@ -206,7 +207,7 @@ export abstract class AgreementTemplate extends ContractBase { rewards = undefined } // const rewards = DDO.getAssetPriceFromService(service) - return { ddo, service, price: rewards, creator } + return { ddo, service, price: rewards, creator, serviceReference } } public async agreementId(agreementIdSeed: string, creator: string): Promise { diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index c8d139f38..c7f4b60e3 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -3,6 +3,7 @@ import { getConditionsByParams, zeroX } from '../../../utils' import { PricedMetadataInformation, Service, + ServiceAttributes, serviceIndex, ServicePlugin, ServiceType, @@ -35,10 +36,12 @@ export abstract class BaseTemplate public createService( publisher: Account, metadata: MetaData, + serviceAttributes: ServiceAttributes, nftAttributes?: NFTAttributes, - assetPrice?: AssetPrice, + // assetPrice?: AssetPrice, priceData?: PricedMetadataInformation, ): S { + const assetPrice = serviceAttributes.price let tokenAddress if (assetPrice === undefined || !isAddress(assetPrice.getTokenAddress())) tokenAddress = this.nevermined.utils.token.getAddress() @@ -55,8 +58,8 @@ export abstract class BaseTemplate nftAttributes?.nftContractAddress, publisher.getId(), assetPrice ? assetPrice.getTotalPrice() : BigNumber.from('0'), - nftAttributes?.nftTransfer, - nftAttributes?.duration, + serviceAttributes?.nft?.nftTransfer, + serviceAttributes?.nft?.duration, nftAttributes?.fulfillAccessTimeout, nftAttributes?.fulfillAccessTimelock, ) diff --git a/src/keeper/contracts/templates/NFT721SalesTemplate.ts b/src/keeper/contracts/templates/NFT721SalesTemplate.ts index 542673c6f..2b9474bb4 100644 --- a/src/keeper/contracts/templates/NFT721SalesTemplate.ts +++ b/src/keeper/contracts/templates/NFT721SalesTemplate.ts @@ -64,13 +64,14 @@ export class NFT721SalesTemplate extends BaseTemplate> { const { transferNft721Condition, lockPaymentCondition, escrowPaymentCondition } = this.nevermined.keeper.conditions const agreementId = await this.agreementId(agreementIdSeed, creator) const ctx = { - ...this.standardContext(ddo, creator), + ...this.standardContext(ddo, creator, serviceReference), ...parameters, } diff --git a/src/keeper/contracts/templates/NFTSalesTemplate.ts b/src/keeper/contracts/templates/NFTSalesTemplate.ts index cd470bb41..98657d607 100644 --- a/src/keeper/contracts/templates/NFTSalesTemplate.ts +++ b/src/keeper/contracts/templates/NFTSalesTemplate.ts @@ -64,13 +64,14 @@ export class NFTSalesTemplate extends BaseTemplate> { const { transferNftCondition, lockPaymentCondition, escrowPaymentCondition } = this.nevermined.keeper.conditions const agreementId = await this.agreementId(agreementIdSeed, creator) const ctx = { - ...this.standardContext(ddo, creator), + ...this.standardContext(ddo, creator, serviceReference), ...parameters, } diff --git a/src/models/AssetAttributes.ts b/src/models/AssetAttributes.ts index 728ebf0af..898db7a06 100644 --- a/src/models/AssetAttributes.ts +++ b/src/models/AssetAttributes.ts @@ -12,12 +12,6 @@ export class AssetAttributes { */ metadata: MetaData - // /** - // * It allows to specify the price of an asset - // * @see {@link AssetPrice} - // */ - // price?: AssetPrice - /** * When an asset is published in a Nevermined network, some internal Metadata attributes are encrypted so they can't be accessed. * This method allows to specify the encryption method to be used. @@ -25,12 +19,6 @@ export class AssetAttributes { */ encryptionMethod?: EncryptionMethod - // /** - // * List of services offered by an asset. - // * @see {@link ServiceType} - // */ - // serviceTypes?: ServiceType[] - /** * List of services and their attributes offered by an asset. * @see {@link ServiceAttributes} diff --git a/src/models/NFTAttributes.ts b/src/models/NFTAttributes.ts index 6ff53ec68..cf6e70b15 100644 --- a/src/models/NFTAttributes.ts +++ b/src/models/NFTAttributes.ts @@ -2,6 +2,46 @@ import { RoyaltyAttributes } from '../nevermined' import BigNumber from '../utils/BigNumber' import { AssetAttributes } from './AssetAttributes' import { ERCType, NeverminedNFTType, NeverminedNFT1155Type, NeverminedNFT721Type } from './' +import { ServiceType } from '../ddo/types' + + +export class NFTServiceAttributes { + + /** + * The asset is transferred (true) or minted (false) with Nevermined contracts + */ + nftTransfer?: boolean + + /** + * If true means the NFT works as a subscription + */ + isSubscription?: boolean + + /** + * If is a subscription this means the number of blocks the subscription last. If 0 means unlimited + */ + duration?: number + + /** + * Number of editions + */ + amount?: BigNumber + + static defaultValues = { + serviceType: 'nft-access' as ServiceType, + nftTransfer: true, // The NFT will use transfers + isSubscription: false, // By default the asset doesn't represent a subscription + duration: 0, // Because it's not a subscription it doesn't have a duration + amount: BigNumber.from(1), // By default just one edition + } + + public static getDefaultNFTServiceAttributes(): NFTServiceAttributes { + return { + ...NFTServiceAttributes.defaultValues, + } + } + +} export class NFTAttributes extends AssetAttributes { /** @@ -24,9 +64,9 @@ export class NFTAttributes extends AssetAttributes { nftContractAddress: string /** - * Max number of nfts that can be minted, 0 means uncapped + * Attributes describing the royalties attached to the NFT in the secondary market */ - cap?: BigNumber + royaltyAttributes?: RoyaltyAttributes /** * If the asset is pre-minted @@ -39,40 +79,18 @@ export class NFTAttributes extends AssetAttributes { nftMetadataUrl?: string /** - * The asset is transferred (true) or minted (false) with Nevermined contracts - */ - nftTransfer?: boolean - - /** - * If true means the NFT works as a subscription - */ - isSubscription?: boolean - - /** - * If is a subscription this means the number of blocks the subscription last. If 0 means unlimited - */ - duration?: number - - /** - * Number of editions + * Max number of nfts that can be minted, 0 means uncapped */ - amount?: BigNumber + cap?: BigNumber - /** - * Attributes describing the royalties attached to the NFT in the secondary market - */ - royaltyAttributes?: RoyaltyAttributes static defaultValues = { ...AssetAttributes.defaultValues, - cap: BigNumber.from(0), // Cap equals to 0 means the NFT is uncapped + royaltyAttributes: undefined, preMint: true, // It means the NFT will mint all the editions defined in the `amount` attributed during the registration nftMetadataUrl: '', // Url to the metadata describing the NFT OpenSea style - nftTransfer: true, // The NFT will use transfers - isSubscription: false, // By default the asset doesn't represent a subscription - duration: 0, // Because it's not a subscription it doesn't have a duration - amount: BigNumber.from(1), // By default just one edition - royaltyAttributes: undefined, // No royalty attributes by default what means no royalties + cap: BigNumber.from(0), // Cap equals to 0 means the NFT is uncapped + // services: [NFTServiceAttributes.getDefaultNFTServiceAttributes()] } static getInstance(nftAttributes: NFTAttributes): Required { @@ -105,38 +123,44 @@ export class NFTAttributes extends AssetAttributes { } static getSubscriptionInstance(nftAttributes: Partial): Required { - return { + const _instance = { ercType: 721, nftType: NeverminedNFT721Type.nft721Subscription, - isSubscription: true, + // isSubscription: true, nftContractAddress: nftAttributes.nftContractAddress, metadata: nftAttributes.metadata, ...NFTAttributes.defaultValues, ...nftAttributes, } + _instance.services.forEach((service) => { service.nft.isSubscription = true}) + return _instance } static getPOAPInstance(nftAttributes: Partial): Required { - return { + const _instance = { ercType: 721, nftType: NeverminedNFT721Type.nft721POAP, - isSubscription: false, + // isSubscription: false, nftContractAddress: nftAttributes.nftContractAddress, metadata: nftAttributes.metadata, ...NFTAttributes.defaultValues, ...nftAttributes, } + _instance.services.forEach((service) => { service.nft.isSubscription = false }) + return _instance } static getSoulBoundInstance(nftAttributes: Partial): Required { - return { + const _instance = { ercType: 721, nftType: NeverminedNFT721Type.nft721SoulBound, - isSubscription: false, + // isSubscription: false, nftContractAddress: nftAttributes.nftContractAddress, metadata: nftAttributes.metadata, ...NFTAttributes.defaultValues, ...nftAttributes, } + _instance.services.forEach((service) => { service.nft.isSubscription = false }) + return _instance } } diff --git a/src/nevermined/AccessService.ts b/src/nevermined/AccessService.ts index 17d24f467..8581f8b8c 100644 --- a/src/nevermined/AccessService.ts +++ b/src/nevermined/AccessService.ts @@ -7,6 +7,7 @@ import { MetaData, MetaDataMain, PricedMetadataInformation, + ServiceAttributes, } from '../ddo' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { @@ -38,11 +39,11 @@ export class AccessService extends Instantiable implements ServicePlugin Added service ${JSON.stringify( - // ddo.service[ddo.service.length - 1].attributes.serviceAgreementTemplate.conditions[0], - // )}`, - // ) - // console.log(ddo.service.length) } } - // console.log(`----- DDO Services: `) - // console.log(JSON.stringify(ddo.service)) - // console.log(`----- Step 1: `) - // ddo.service - // .filter((service) => service.type === 'access') - // .forEach((service) => { - // console.log(`1# Service ${service.type}`) - // const cond = service.attributes.serviceAgreementTemplate.conditions[0] - // cond.parameters - // .filter((p) => p.name === '_amounts') - // .map((c) => { - // console.log(`Param ${c.name} with price: ${JSON.stringify(c.value)}`) - // }) - // }) - ddo.reorderServices() this.logger.log('Services Added') @@ -185,7 +163,6 @@ export abstract class RegistryBaseApi extends Instantiable { let serviceEndpoint = this.nevermined.services.metadata.getServiceEndpoint(DID.parse(ddo.id)) - // console.log(`--- DDO Before Update Service: \n${JSON.stringify(ddo)}`) ddo.updateService({ type: 'metadata', @@ -278,7 +255,7 @@ export abstract class RegistryBaseApi extends Instantiable { txParams, ) } - + if (nftAttributes.royaltyAttributes != undefined) { this.logger.log(`Setting up royalties`) diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index a5b8d3408..005e8b2ff 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -357,6 +357,7 @@ export class NFT1155Api extends NFTsBaseApi { public async releaseRewards( agreementId: string, did: string, + serviceReference: number | undefined, nftAmount: BigNumber, publisher: Account, txParams?: TxParameters, @@ -368,6 +369,7 @@ export class NFT1155Api extends NFTsBaseApi { const result = await agreements.conditions.releaseNftReward( agreementId, ddo, + serviceReference, nftAmount, publisher, undefined, @@ -492,6 +494,7 @@ export class NFT1155Api extends NFTsBaseApi { owner: Account, consumer: Account, agreementIdSeed: string, + serviceReference: number | undefined, txParams?: TxParameters, ): Promise { const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) @@ -517,6 +520,7 @@ export class NFT1155Api extends NFTsBaseApi { receipt = await this.nevermined.agreements.conditions.releaseNftReward( agreementId, ddo, + serviceReference, nftAmount, owner, undefined, diff --git a/test/keeper/conditions/NFTLockCondition.test.ts b/test/keeper/conditions/NFTLockCondition.test.ts index b288fce81..9b75e3839 100644 --- a/test/keeper/conditions/NFTLockCondition.test.ts +++ b/test/keeper/conditions/NFTLockCondition.test.ts @@ -79,7 +79,13 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - amount, + services: [{ + serviceType: 'nft-sales', + nft: { amount } + }, { + serviceType: 'nft-access', + nft: { amount } + }], preMint: true, }) @@ -132,7 +138,13 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - amount, + services: [{ + serviceType: 'nft-sales', + nft: { amount } + }, { + serviceType: 'nft-access', + nft: { amount } + }], preMint: true, }) @@ -164,7 +176,13 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - amount, + services: [{ + serviceType: 'nft-sales', + nft: { amount } + }, { + serviceType: 'nft-access', + nft: { amount } + }], preMint: false, }) @@ -201,7 +219,13 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - amount, + services: [{ + serviceType: 'nft-sales', + nft: { amount } + }, { + serviceType: 'nft-access', + nft: { amount } + }], preMint: true, }) diff --git a/test/keeper/conditions/TransferNFTCondition.test.ts b/test/keeper/conditions/TransferNFTCondition.test.ts index c47c58fc4..d33b73db7 100644 --- a/test/keeper/conditions/TransferNFTCondition.test.ts +++ b/test/keeper/conditions/TransferNFTCondition.test.ts @@ -126,7 +126,13 @@ describe('TransferNFTCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - amount: nftAmount, + services: [{ + serviceType: 'nft-sales', + nft: { amount: nftAmount } + }, { + serviceType: 'nft-access', + nft: { amount: nftAmount } + }], preMint: false, }) @@ -223,7 +229,13 @@ describe('TransferNFTCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(0), - amount: nftAmount, + services: [{ + serviceType: 'nft-sales', + nft: { amount: nftAmount } + }, { + serviceType: 'nft-access', + nft: { amount: nftAmount } + }], preMint: false, }) @@ -315,7 +327,13 @@ describe('TransferNFTCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(0), - amount: nftAmount, + services: [{ + serviceType: 'nft-sales', + nft: { amount: nftAmount } + }, { + serviceType: 'nft-access', + nft: { amount: nftAmount } + }], preMint: false, }) From 481000157fc946c52933011831f4f0f3f021dbae Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 19 Jul 2023 15:51:28 +0200 Subject: [PATCH 020/151] fix: multiple fixes --- integration/nevermined/NFT1155.test.ts | 2 +- src/keeper/Web3Provider.ts | 2 ++ src/keeper/contracts/CustomToken.ts | 1 + src/keeper/contracts/DIDRegistry.ts | 4 ++-- src/keeper/contracts/Nft1155Contract.ts | 1 + src/keeper/contracts/managers/TemplateStoreManager.ts | 4 ++-- src/keeper/contracts/templates/AgreementTemplate.abstract.ts | 3 +-- src/nevermined/api/RegistryBaseApi.ts | 2 +- src/utils/SubscribablePromise.ts | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 4b086d693..4109dd2b4 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -63,7 +63,7 @@ describe('NFT1155 End-to-End', () => { [receivers[0], amounts[0]], [receivers[1], amounts[1]], ]), - ).setTokenAddress(token.getAddress()) + ).setTokenAddress(token.address) }) describe('As user I can deploy Nevermined ERC-1155 NFT contract instances', () => { diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index 8a0db3a70..940a161bd 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -14,6 +14,8 @@ export class Web3Provider { return new ethers.BrowserProvider(config.web3Provider) } + // disabling the cache since this will lead to duplicated nonces on test networks + // See https://docs.ethers.org/v6/api/providers/abstract-provider/#AbstractProviderOptions return new ethers.JsonRpcProvider(config.web3ProviderUri, undefined, { cacheTimeout: -1 }) } } diff --git a/src/keeper/contracts/CustomToken.ts b/src/keeper/contracts/CustomToken.ts index 5a96c94e1..449ed7081 100644 --- a/src/keeper/contracts/CustomToken.ts +++ b/src/keeper/contracts/CustomToken.ts @@ -14,6 +14,7 @@ export class CustomToken extends Token { await new ContractHandler(config).checkExists(address) token.contract = new ethers.Contract(address, Token.ERC20_ABI, token.web3) + token.address = await token.contract.getAddress() return token } diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index 32d10cf11..aea62fd5a 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -396,9 +396,9 @@ export class DIDRegistry extends ContractBase { .map((event) => { if (event.args === undefined) return eventToObject(event) as ProvenanceAttributeRegisteredEvent - else return eventToObject(event.args) as ProvenanceAttributeRegisteredEvent + else return eventToObject(event.args.toObject()) as ProvenanceAttributeRegisteredEvent }) - .map((event) => ({ ...event, method: +event.method })) + .map((event) => ({ ...event, method: Number(event.method) })) .sort( ( firstEvent: ProvenanceAttributeRegisteredEvent, diff --git a/src/keeper/contracts/Nft1155Contract.ts b/src/keeper/contracts/Nft1155Contract.ts index 7660a5019..e4c24440d 100644 --- a/src/keeper/contracts/Nft1155Contract.ts +++ b/src/keeper/contracts/Nft1155Contract.ts @@ -25,6 +25,7 @@ export class Nft1155Contract extends NFTContractsBase { const solidityABI = await ContractHandler.getABI(contractName, artifactsFolder, networkName) await new ContractHandler(config).checkExists(address) nft.contract = new ethers.Contract(address, solidityABI.abi, nft.web3) + nft.address = await nft.contract.getAddress() } return nft diff --git a/src/keeper/contracts/managers/TemplateStoreManager.ts b/src/keeper/contracts/managers/TemplateStoreManager.ts index c9270452a..2fbfbe105 100644 --- a/src/keeper/contracts/managers/TemplateStoreManager.ts +++ b/src/keeper/contracts/managers/TemplateStoreManager.ts @@ -71,10 +71,10 @@ export class TemplateStoreManager extends ContractBase { public async getTemplate(templateId: string) { const t: any = await this.call('getTemplate', [zeroX(templateId)]) return { - state: +t.state, + state: Number(t.state), owner: t.owner, lastUpdatedBy: t.lastUpdatedBy, - blockNumberUpdated: +t.blockNumberUpdated, + blockNumberUpdated: Number(t.blockNumberUpdated), } as TemplateMetadata } diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index a75cf7885..fd798af71 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -254,9 +254,8 @@ export abstract class AgreementTemplate extends ContractBase { consumer: Account, from: Account, txParams?: TxParameters, - observer?: (OrderProgressStep) => void, + observer?: (orderProgressStep: OrderProgressStep) => void, ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unused-vars observer = observer ? observer : (_) => ({}) const { instances, agreementId } = await this.instanceFromDDO( diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index fe3a38b2f..322cfb3a3 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -612,7 +612,7 @@ export abstract class RegistryBaseApi extends Instantiable { } /** - * Initialities the default Nevermined service plugins and return that instance + * Initializes the default Nevermined service plugins and return that instance * @param config Nevermined config * @returns The Nevermined Service Plugin instance */ diff --git a/src/utils/SubscribablePromise.ts b/src/utils/SubscribablePromise.ts index 97cfd9894..cdf342a0b 100644 --- a/src/utils/SubscribablePromise.ts +++ b/src/utils/SubscribablePromise.ts @@ -13,7 +13,7 @@ export class SubscribablePromise { ) constructor(executor: (observer: SubscribableObserver) => void | Promise

) { - // Defear + // Defer setTimeout(() => this.init(executor), 1) } From b87c6d253b297e40f391e59d860dcd124d988225 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 19 Jul 2023 17:10:40 +0200 Subject: [PATCH 021/151] fix: more integration tests --- integration/nevermined/NFT.test.ts | 2 +- integration/nevermined/NFT1155.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/nevermined/NFT.test.ts b/integration/nevermined/NFT.test.ts index 53f9da10b..70671ecbc 100644 --- a/integration/nevermined/NFT.test.ts +++ b/integration/nevermined/NFT.test.ts @@ -86,7 +86,7 @@ describe('Nfts operations', () => { metadata, serviceTypes: ['nft-sales', 'nft-access'], nftContractAddress: nevermined.nfts1155.nftContract.address, - cap: 20n, + cap: 10n, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 4109dd2b4..2d460e4b4 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -145,7 +145,7 @@ describe('NFT1155 End-to-End', () => { await nftUpgradeable.mint(someone.getId(), ddo.shortId(), 1n, minter.getId()) const afterBalance = await nftUpgradeable.balance(someone.getId(), ddo.shortId()) - assert.isTrue(beforeBalance.add(1).eq(afterBalance)) + assert.equal(beforeBalance + 1n, afterBalance) }) it('Should be able to burn', async () => { @@ -154,7 +154,7 @@ describe('NFT1155 End-to-End', () => { await nftUpgradeable.burn(someone.getId(), ddo.shortId(), 1n) const afterBalance = await nftUpgradeable.balance(someone.getId(), ddo.shortId()) - assert.isTrue(beforeBalance.sub(1).eq(afterBalance)) + assert.equal(beforeBalance - 1n, afterBalance) }) }) }) From d00034ecf6cb63bc366e65d027e6c3b42e286f56 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 19 Jul 2023 17:24:31 +0200 Subject: [PATCH 022/151] fix: subscribablePromise test --- integration/nevermined/ConsumeAssetViaNode.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration/nevermined/ConsumeAssetViaNode.test.ts b/integration/nevermined/ConsumeAssetViaNode.test.ts index 2c3f2dc06..9ebda017f 100644 --- a/integration/nevermined/ConsumeAssetViaNode.test.ts +++ b/integration/nevermined/ConsumeAssetViaNode.test.ts @@ -82,7 +82,8 @@ describe('Consume Asset (Nevermined Node)', () => { it('should order the asset', async () => { const steps = [] - agreementId = await nevermined.assets.order(ddo.id, consumer).next((step) => steps.push(step)) + const subscribablePromise = nevermined.assets.order(ddo.id, consumer) + agreementId = await subscribablePromise.next((step) => steps.push(step)) assert.isDefined(agreementId) assert.deepEqual(steps, [2, 3, 4, 5]) From 7f9533b25a1b8fe376edd2bda3b99c8ae39d6ce8 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 20 Jul 2023 15:14:56 +0200 Subject: [PATCH 023/151] fix: unit tests - Fix how the revert message is displayed in KeeperError --- package.json | 2 +- src/keeper/contracts/ContractBase.ts | 2 +- test/ddo/DDO.test.ts | 2 +- test/keeper/ContractEvent.test.ts | 5 ++-- test/keeper/TestContractHandler.ts | 39 ++++------------------------ test/mocha.opts | 1 - 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index d59686865..da5d546b3 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build:metadata": "./scripts/get-metadata.js > src/metadata.json", "build:dist": "cross-env NODE_ENV=production webpack", "build:watch": "tsc -w", - "test": "mocha", + "test": "mocha --opts test/mocha.opts ./test/**/*.test.ts", "test:watch": "mocha -w --watch-extensions js,ts,json", "test:cover": "nyc --report-dir coverage/unit mocha --opts test/mocha.opts ./test/**/*.test.ts", "integration": "mocha --opts integration/mocha.opts ./integration/nevermined/*.test.ts", diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index af5e2d104..460095c49 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -230,7 +230,7 @@ export abstract class ContractBase extends Instantiable { Sending transaction "${name}" on contract "${this.contractName}" at ${ this.address } failed.\n - Error: ${err.message}\n + Error: ${err.info.error.message}\n From: ${from}\n Parameters: ${JSON.stringify(mappedArgs, null, 2)}\n ${'-'.repeat(40)} diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index abb66c123..77fc0ea9a 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -128,7 +128,7 @@ describe('DDO', function () { ], }) - beforeEach(async () => { + before(async () => { await TestContractHandler.prepareContracts() await Nevermined.getInstance(config) }) diff --git a/test/keeper/ContractEvent.test.ts b/test/keeper/ContractEvent.test.ts index 1665f427f..fcad599b9 100644 --- a/test/keeper/ContractEvent.test.ts +++ b/test/keeper/ContractEvent.test.ts @@ -7,7 +7,8 @@ import { Account } from '../../src' import { Web3Provider } from '../../src/keeper' import { ethers } from 'ethers' -describe('ContractEvent', () => { +// Skipping this test until https://github.com/nevermined-io/sdk-js/issues/558 +describe.skip('ContractEvent', () => { let nevermined: Nevermined let account1: Account let account2: Account @@ -15,7 +16,7 @@ describe('ContractEvent', () => { let account4: Account let web3: ethers.JsonRpcProvider | ethers.BrowserProvider - beforeEach(async () => { + before(async () => { await TestContractHandler.prepareContracts() nevermined = await Nevermined.getInstance(config) web3 = Web3Provider.getWeb3(config) diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index d7386ed24..2fda8ab73 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -4,12 +4,7 @@ import * as KeeperUtils from '../../src/keeper/utils' import Logger from '../../src/utils/Logger' import config from '../config' import { ZeroAddress } from '../../src/utils' -import { - ContractTransactionReceipt, - ContractTransactionResponse, - JsonRpcSigner, - ethers, -} from 'ethers' +import { ContractTransactionReceipt, ContractTransactionResponse, ethers } from 'ethers' import fs from 'fs' import { NeverminedOptions } from '../../src' @@ -17,10 +12,7 @@ export default abstract class TestContractHandler extends ContractHandler { public static async prepareContracts(): Promise { TestContractHandler.setConfig(config) - const [deployerAddress] = await TestContractHandler.addresses( - TestContractHandler.config, - TestContractHandler.web3, - ) + const [deployerAddress] = await TestContractHandler.addresses(TestContractHandler.config) TestContractHandler.networkId = Number((await TestContractHandler.web3.getNetwork()).chainId) TestContractHandler.minter = ethers.encodeBytes32String('minter') @@ -348,23 +340,10 @@ export default abstract class TestContractHandler extends ContractHandler { return acc.connect(web3) } } - return web3.getSigner(from) } - public static async addresses( - config: NeverminedOptions, - web3: ethers.JsonRpcProvider | ethers.BrowserProvider, - ): Promise { - let ethAccounts: JsonRpcSigner[] = [] - try { - ethAccounts = await web3.listAccounts() - } catch (e) { - // ignore - } - const addresses = await Promise.all((config.accounts || []).map((a) => a.getAddress())) - return addresses.concat( - await Promise.all(ethAccounts.map(async (signer) => await signer.getAddress())), - ) + public static async addresses(config: NeverminedOptions): Promise { + return await Promise.all((config.accounts || []).map((a) => a.getAddress())) } private static async deployContract( @@ -376,11 +355,6 @@ export default abstract class TestContractHandler extends ContractHandler { ): Promise { const where = TestContractHandler.networkId - // do not redeploy if there is already something loaded - if (TestContractHandler.hasContract(name, where)) { - return ContractHandler.getContract(name, where) - } - let contractInstance: ethers.BaseContract try { const networkName = ( @@ -421,10 +395,7 @@ export default abstract class TestContractHandler extends ContractHandler { ): Promise { if (!from) { // eslint-disable-next-line @typescript-eslint/no-extra-semi - ;[from] = await TestContractHandler.addresses( - TestContractHandler.config, - TestContractHandler.web3, - ) + ;[from] = await TestContractHandler.addresses(TestContractHandler.config) } const sendConfig = { diff --git a/test/mocha.opts b/test/mocha.opts index 715d9ccb8..01bce8675 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -2,7 +2,6 @@ --require source-map-support/register --require mock-local-storage --full-trace ---bail --exit --timeout 60000 test/config.ts From 297c66dfaee3be77c24fcd5cb75b26c46cd9a9aa Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 20 Jul 2023 15:30:38 +0200 Subject: [PATCH 024/151] fix: unit tests CI workflow --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1bb390ca3..c62994e6a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -75,7 +75,7 @@ jobs: - name: Start ganache env: SEED_WORDS: ${{ secrets.seedWords }} - run: yarn ganache --port 18545 --chain.chainId 8998 -- mnemonic $SEED_WORDS & + run: yarn ganache --port 18545 --chain.chainId 8998 --wallet.mnemonic $SEED_WORDS --detach - name: Run unit tests env: From 8935c1d53bd541611dab8e2226fa61a41c50ad42 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 20 Jul 2023 15:56:15 +0200 Subject: [PATCH 025/151] fix: unit tests CI workflow --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c62994e6a..807f01852 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -75,7 +75,7 @@ jobs: - name: Start ganache env: SEED_WORDS: ${{ secrets.seedWords }} - run: yarn ganache --port 18545 --chain.chainId 8998 --wallet.mnemonic $SEED_WORDS --detach + run: yarn ganache --port 18545 --chain.chainId 8998 --wallet.mnemonic "$SEED_WORDS" --detach - name: Run unit tests env: From c087e6f07b9d960c70ffdf98039e8e7a59703cb0 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 20 Jul 2023 17:22:17 +0200 Subject: [PATCH 026/151] fix: remove unused param in createAgreementWithPayment --- src/keeper/contracts/templates/GenericAccess.ts | 1 - src/nevermined/api/RegistryBaseApi.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/keeper/contracts/templates/GenericAccess.ts b/src/keeper/contracts/templates/GenericAccess.ts index b3ed1d1dc..c68e1e0dc 100644 --- a/src/keeper/contracts/templates/GenericAccess.ts +++ b/src/keeper/contracts/templates/GenericAccess.ts @@ -9,7 +9,6 @@ export interface GenericAccess { parameters: any, consumer: Account, from: Account, - timeOuts?: number[], txParams?: TxParameters, observer?: (orderProgressStep: OrderProgressStep) => void, ): Promise diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 322cfb3a3..6eef758be 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -585,7 +585,6 @@ export abstract class RegistryBaseApi extends Instantiable { template.params(consumer), consumer, consumer, - undefined, params, (a) => observer.next(a), ) From a39e613f1748f1e0123429d34cebefc920548bb8 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 20 Jul 2023 18:26:19 +0200 Subject: [PATCH 027/151] chore: bump version to 2.0.0-rc0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 53c505d5f..c0091434d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "1.6.0", + "version": "2.0.0-rc0", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 06cdbc1b4ad8a3352e174b4d492e9f2d3c9dc7c2 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:40:04 +0200 Subject: [PATCH 028/151] feat: nfts multiservice support refactor --- integration/external/Datasets.e2e.test.ts | 14 ++- integration/external/Services.e2e.test.ts | 10 +- integration/nevermined/DDO.test.ts | 3 +- integration/nevermined/NFT1155.test.ts | 3 +- integration/nevermined/NFT1155Api.e2e.test.ts | 5 +- .../nevermined/NFT721Templates.test.ts | 11 +- integration/nevermined/NFTTemplates.test.ts | 12 +- .../nevermined/NFTTemplatesWithEther.test.ts | 3 +- .../NFTsWithMultipleServices.test.ts | 115 ++++++++++++++---- integration/nevermined/Poap.test.ts | 2 +- .../nevermined/SecondaryMarket.test.ts | 5 +- .../nevermined/SubscriptionDuration.test.ts | 15 +-- .../nevermined/Subscriptions.e2e.test.ts | 9 +- .../NFTs/TransferNFT721Condition.ts | 2 +- .../templates/AgreementTemplate.abstract.ts | 12 +- .../templates/BaseTemplate.abstract.ts | 2 +- .../templates/NFT721SalesTemplate.ts | 2 +- src/nevermined/AccessService.ts | 14 ++- src/nevermined/api/ConditionsApi.ts | 17 ++- src/nevermined/api/nfts/NFT1155Api.ts | 8 +- src/nevermined/api/nfts/NFT721Api.ts | 18 ++- 21 files changed, 206 insertions(+), 76 deletions(-) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index 359a5a893..221033472 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -181,13 +181,15 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { { serviceType: 'nft-sales', price: assetPrice, + nft: { + duration: subscriptionDuration, + nftTransfer, + }, }, ], providers: [neverminedNodeAddress], - duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, preMint, - nftTransfer, royaltyAttributes: royaltyAttributes, }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, publisher) @@ -201,11 +203,15 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { const nftAttributes = NFTAttributes.getNFT721Instance({ metadata: datasetMetadata, - services: [{ serviceType: 'nft-access' }], + services: [ + { + serviceType: 'nft-access', + nft: { nftTransfer }, + }, + ], providers: [neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint, - nftTransfer, royaltyAttributes: royaltyAttributes, }) datasetDDO = await nevermined.nfts721.create(nftAttributes, publisher) diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index e996535a8..ca7971d6a 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -241,13 +241,15 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { { serviceType: 'nft-sales', price: assetPrice, + nft: { + duration: subscriptionDuration, + nftTransfer, + }, }, ], providers: [neverminedNodeAddress], - duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, preMint, - nftTransfer, royaltyAttributes: royaltyAttributes, }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, publisher) @@ -277,12 +279,14 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { services: [ { serviceType: 'nft-access', + nft: { + nftTransfer, + }, }, ], providers: [neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint, - nftTransfer, royaltyAttributes: royaltyAttributes, }) serviceDDO = await nevermined.nfts721.create(nftAttributes, publisher) diff --git a/integration/nevermined/DDO.test.ts b/integration/nevermined/DDO.test.ts index cd1b0b5f0..0cb9eb1d6 100644 --- a/integration/nevermined/DDO.test.ts +++ b/integration/nevermined/DDO.test.ts @@ -150,9 +150,11 @@ describe('DDO Tests', () => { { serviceType: 'nft-sales', price, + nft: { amount: BigNumber.from(1) }, }, { serviceType: 'nft-access', + nft: { amount: BigNumber.from(1) }, }, ], providers: [config.neverminedNodeAddress], @@ -163,7 +165,6 @@ describe('DDO Tests', () => { ...assetAttributes, nftContractAddress: nevermined.nfts1155.nftContract.address, cap: BigNumber.from(10), - amount: BigNumber.from(1), royaltyAttributes, preMint: true, }) diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index bb094916b..ce1ade9f6 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -111,9 +111,11 @@ describe('NFT1155 End-to-End', () => { { serviceType: 'nft-sales', price: assetPrice, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', + nft: { amount: numberNFTs }, }, ], }) @@ -121,7 +123,6 @@ describe('NFT1155 End-to-End', () => { ...assetAttributes, nftContractAddress: nftUpgradeable.address, cap: cappedAmount, - amount: numberNFTs, royaltyAttributes, preMint, }) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index f9d6298f7..102da289e 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -155,9 +155,11 @@ function makeTest(isCustom) { { serviceType: 'nft-sales', price: assetPrice1, + nft: { amount: numberEditions }, }, { serviceType: 'nft-access', + nft: { amount: numberEditions }, }, ], providers: [config.neverminedNodeAddress], @@ -166,7 +168,6 @@ function makeTest(isCustom) { ...assetAttributes, nftContractAddress: nevermined.nfts1155.nftContract.address, cap: cappedAmount, - amount: numberEditions, royaltyAttributes, preMint: true, }) @@ -271,10 +272,12 @@ function makeTest(isCustom) { const escrowPaymentConditionBefore = await token.balanceOf( escrowPaymentCondition.getAddress(), ) + const service = ddo.findServiceByReference('nft-sales') await sleep(DELAY) const receipt = await nevermined.nfts1155.releaseRewards( agreementId, ddo.id, + service.index, numberEditions, artist, ) diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index b6b1a17d7..8712b1bc1 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -198,6 +198,7 @@ describe('NFT721Templates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { nftTransfer: false }, }, { serviceType: 'nft-access', @@ -207,7 +208,6 @@ describe('NFT721Templates E2E', () => { nftType: NeverminedNFT721Type.nft721, nftContractAddress: nft.address, preMint: true, - nftTransfer: false, royaltyAttributes: getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, 10000), }) ddo = await nevermined.nfts721.create(nftAttributes, artist) @@ -703,9 +703,11 @@ describe('NFT721Templates E2E', () => { const ownerBefore = await nft.ownerOf(ddo.shortId()) assert.equal(ownerBefore, artist.getId()) + const service = ddo.findServiceByType('nft-sales') const receipt = await nevermined.agreements.conditions.transferNft721( agreementId, ddo, + service.index, artist, ) assert.isTrue(receipt) @@ -718,9 +720,11 @@ describe('NFT721Templates E2E', () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( escrowPaymentCondition.getAddress(), ) + const receipt = await nevermined.agreements.conditions.releaseNft721Reward( agreementId, ddo, + 'nft-sales', artist, ) assert.isTrue(receipt) @@ -851,9 +855,12 @@ describe('NFT721Templates E2E', () => { const ownerBefore = await nft.ownerOf(ddo.shortId()) assert.equal(ownerBefore, collector1.getId()) + const service = ddo.findServiceByType('nft-sales') + const receipt = await nevermined.agreements.conditions.transferNft721( agreementId2, ddo, + service.index, collector1, ) assert.isTrue(receipt) @@ -866,9 +873,11 @@ describe('NFT721Templates E2E', () => { const escrowPaymentConditionBalanceBefore = await token.balanceOf( escrowPaymentCondition.getAddress(), ) + const receipt = await nevermined.agreements.conditions.releaseNft721Reward( agreementId2, ddo, + 'nft-sales', collector1, ) assert.isTrue(receipt) diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index a2baa38f6..6f47acc81 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -173,9 +173,11 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', + nft: { amount: numberNFTs }, }, ], }) @@ -183,7 +185,6 @@ describe('NFTTemplates E2E', () => { ...assetAttributes, nftContractAddress: nftUpgradeable.address, cap: cappedAmount, - amount: numberNFTs, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) @@ -635,9 +636,11 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', + nft: { amount: numberNFTs }, }, ], }) @@ -645,7 +648,6 @@ describe('NFTTemplates E2E', () => { ...assetAttributes, nftContractAddress: nftUpgradeable.address, cap: cappedAmount, - amount: numberNFTs, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) @@ -722,6 +724,7 @@ describe('NFTTemplates E2E', () => { const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId, ddo, + 'nft-sales', numberNFTs, artist, ) @@ -883,6 +886,7 @@ describe('NFTTemplates E2E', () => { const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId2, ddo, + 'nft-sales', numberNFTs2, collector1, ) @@ -943,6 +947,7 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', @@ -953,7 +958,6 @@ describe('NFTTemplates E2E', () => { ...assetAttributes, nftContractAddress: nftUpgradeable.address, cap: cappedAmount, - amount: numberNFTs, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) @@ -1023,6 +1027,7 @@ describe('NFTTemplates E2E', () => { const receipt = await nevermined.agreements.conditions.transferNftForDelegate( agreementId, ddo, + 'nft-sales', numberNFTs, gallery, ) @@ -1048,6 +1053,7 @@ describe('NFTTemplates E2E', () => { const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId, ddo, + 'nft-sales', numberNFTs, artist, gallery, diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index 460eddb3f..12e4f96d4 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -169,9 +169,11 @@ describe('NFTTemplates With Ether E2E', async () => { { serviceType: 'nft-sales', price: assetPrice, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', + nft: { amount: numberNFTs }, }, ], }) @@ -179,7 +181,6 @@ describe('NFTTemplates With Ether E2E', async () => { ...assetAttributes, nftContractAddress: nftUpgradeable.address, cap: cappedAmount, - amount: numberNFTs, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index 7f39b7f80..6361af5ef 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -12,9 +12,11 @@ import { ContractHandler, Nft721Contract, NFTAttributes, + ConditionState, } from '../../src' import { BigNumber } from '../../src/utils' import { ethers } from 'ethers' +import { repeat } from '../utils/utils' let nevermined: Nevermined let publisher: Account @@ -30,11 +32,11 @@ let agreementId let neverminedNodeAddress let nft: ethers.Contract let nftContract: Nft721Contract -let nftContractOwner: Account +let salesServices const totalAmount1 = '100' const totalAmount2 = '150' -describe('NFTs with multiple services', () => { +describe('E2E Flow for NFTs with multiple services', () => { before(async () => { nevermined = await Nevermined.getInstance(config) ;({ token } = nevermined.keeper) @@ -66,11 +68,12 @@ describe('NFTs with multiple services', () => { await nevermined.contracts.loadNft721(nftContract.address) - nftContractOwner = new Account((await nftContract.owner()) as string) + // nftContractOwner = new Account((await nftContract.owner()) as string) await nftContract.grantOperatorRole( - nevermined.keeper.conditions.transferNft721Condition.address, - nftContractOwner) + nevermined.keeper.conditions.transferNft721Condition.address, + publisher, + ) const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(publisher) @@ -90,21 +93,20 @@ describe('NFTs with multiple services', () => { metadata.userId = payload.sub }) - describe('E2E flow for an asset with multiple nft-sales services', () => { + describe('Asset with multiple NFTs registration', () => { it('Register with multiple access services', async () => { - const nftAttributes = NFTAttributes.getNFT721Instance({ metadata, services: [ { serviceType: 'nft-sales', price: assetPrice1, - nft: { nftTransfer: true } + nft: { nftTransfer: true }, }, { serviceType: 'nft-sales', price: assetPrice2, - nft: { nftTransfer: false } + nft: { nftTransfer: false }, }, { serviceType: 'nft-access', @@ -133,38 +135,107 @@ describe('NFTs with multiple services', () => { salesServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], totalAmount1, ) - + assert.isDefined(ddo.findServiceByType('metadata')) }) - it('I am ordering the NFT between multiple nft-sales services', async () => { - + it('The collector is ordering the NFT between multiple nft-sales services', async () => { const collector1BalanceBefore = await token.balanceOf(collector1.getId()) - const salesServices = ddo.getServicesByType('nft-sales') - service = salesServices[0] + salesServices = ddo.getServicesByType('nft-sales') + service = salesServices[1] agreementId = await nevermined.nfts721.order(ddo.id, collector1, service.index) - + assert.isDefined(agreementId) - console.log(`Agreement Id: ${agreementId}`) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const price = DDO.getAssetPriceFromService(service) - assert.isTrue( - collector1BalanceBefore.sub(price.getTotalPrice()) - .eq(collector1BalanceAfter)) + assert.isTrue(collector1BalanceBefore.sub(price.getTotalPrice()).eq(collector1BalanceAfter)) + + const status = await repeat(3, nevermined.agreements.status(agreementId)) + + assert.deepEqual(status, { + lockPayment: ConditionState.Fulfilled, + transferNFT: ConditionState.Unfulfilled, + escrowPayment: ConditionState.Unfulfilled, + }) }) it('The publisher can check the payment and transfer the NFT to the collector', async () => { - assert.equal(await nevermined.nfts721.ownerOfAsset(ddo.id), publisher.getId()) + service = salesServices[1] - const receipt = await nevermined.nfts721.transfer(agreementId, ddo.id, collector1) + const receipt = await nevermined.nfts721.transfer( + agreementId, + ddo.id, + publisher, + service.index, + ) assert.isTrue(receipt) - assert.equal(await nevermined.nfts721.ownerOfAsset(ddo.id), collector1.getId()) + const status = await repeat(3, nevermined.agreements.status(agreementId)) + + assert.deepEqual(status, { + lockPayment: ConditionState.Fulfilled, + transferNFT: ConditionState.Fulfilled, + escrowPayment: ConditionState.Unfulfilled, + }) + }) + + it('The publisher can get the rewards', async () => { + service = salesServices[1] + + const receipt = await nevermined.nfts721.releaseRewards( + agreementId, + ddo.id, + publisher, + service.index, + ) + assert.isTrue(receipt) + + const status = await repeat(3, nevermined.agreements.status(agreementId)) + + assert.deepEqual(status, { + lockPayment: ConditionState.Fulfilled, + transferNFT: ConditionState.Fulfilled, + escrowPayment: ConditionState.Fulfilled, + }) }) + it('The collector can order the other service too', async () => { + const collector1BalanceBefore = await token.balanceOf(collector1.getId()) + + service = salesServices[0] + + agreementId = await nevermined.nfts721.order(ddo.id, collector1, service.index) + + assert.isDefined(agreementId) + + const collector1BalanceAfter = await token.balanceOf(collector1.getId()) + + const price = DDO.getAssetPriceFromService(service) + assert.isTrue(collector1BalanceBefore.sub(price.getTotalPrice()).eq(collector1BalanceAfter)) + + let status = await repeat(3, nevermined.agreements.status(agreementId)) + + assert.deepEqual(status, { + lockPayment: ConditionState.Fulfilled, + transferNFT: ConditionState.Unfulfilled, + escrowPayment: ConditionState.Unfulfilled, + }) + + await nevermined.nfts721.transfer(agreementId, ddo.id, publisher) + + await nevermined.nfts721.releaseRewards(agreementId, ddo.id, publisher) + + status = await repeat(3, nevermined.agreements.status(agreementId)) + + assert.deepEqual(status, { + lockPayment: ConditionState.Fulfilled, + transferNFT: ConditionState.Fulfilled, + escrowPayment: ConditionState.Fulfilled, + }) + }) }) }) diff --git a/integration/nevermined/Poap.test.ts b/integration/nevermined/Poap.test.ts index 832c55761..7486f2ee9 100644 --- a/integration/nevermined/Poap.test.ts +++ b/integration/nevermined/Poap.test.ts @@ -77,6 +77,7 @@ describe('POAPs with Assets', () => { BigNumber.from(0), nevermined.utils.token.getAddress(), ), + nft: { nftTransfer: false }, }, { serviceType: 'nft-access', @@ -85,7 +86,6 @@ describe('POAPs with Assets', () => { providers: [gatewayAddress], nftContractAddress: poapContract.address, preMint: false, - nftTransfer: false, royaltyAttributes: getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, 0), }) poapDDO = await nevermined.nfts721.create(nftAttributes, editor) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index 9f72613ce..79d69e466 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -179,9 +179,11 @@ describe('Secondary Markets', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', + nft: { amount: numberNFTs }, }, ], }) @@ -189,7 +191,6 @@ describe('Secondary Markets', () => { ...assetAttributes, nftContractAddress: nftUpgradeable.address, cap: cappedAmount, - amount: numberNFTs, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) @@ -276,6 +277,7 @@ describe('Secondary Markets', () => { const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId, ddo, + 'nft-sales', numberNFTs, artist, ) @@ -479,6 +481,7 @@ describe('Secondary Markets', () => { const receipt = await nevermined.agreements.conditions.releaseNftReward( agreementId2, ddo, + 'nft-sales', numberNFTs2, collector1, ) diff --git a/integration/nevermined/SubscriptionDuration.test.ts b/integration/nevermined/SubscriptionDuration.test.ts index 52195d067..f9e216ead 100644 --- a/integration/nevermined/SubscriptionDuration.test.ts +++ b/integration/nevermined/SubscriptionDuration.test.ts @@ -52,13 +52,12 @@ describe('Subscription Durations', () => { { serviceType: 'nft-sales', price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + nft: { duration: 0, nftTransfer: false }, }, ], providers: [config.neverminedNodeAddress], - duration: 0, nftContractAddress: subscriptionNFT.address, preMint: false, - nftTransfer: false, }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, publisher) assert.isDefined(subscriptionDDO) @@ -71,12 +70,12 @@ describe('Subscription Durations', () => { services: [ { serviceType: 'nft-access', + nft: { nftTransfer: false }, }, ], providers: [config.neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint: false, - nftTransfer: false, }) datasetDDO = await nevermined.nfts721.create(nftAttributes, publisher) assert.isDefined(datasetDDO) @@ -146,13 +145,12 @@ describe('Subscription Durations', () => { { serviceType: 'nft-sales', price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + nft: { duration: 1000, nftTransfer: false }, }, ], providers: [config.neverminedNodeAddress], - duration: 1000, nftContractAddress: subscriptionNFT.address, preMint: false, - nftTransfer: false, }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, publisher) assert.isDefined(subscriptionDDO) @@ -164,12 +162,12 @@ describe('Subscription Durations', () => { services: [ { serviceType: 'nft-access', + nft: { nftTransfer: false }, }, ], providers: [config.neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint: false, - nftTransfer: false, }) datasetDDO = await nevermined.nfts721.create(nftAttributes, publisher) assert.isDefined(datasetDDO) @@ -239,13 +237,12 @@ describe('Subscription Durations', () => { { serviceType: 'nft-sales', price: new AssetPrice(publisher.getId(), BigNumber.from(0)), + nft: { duration: 1, nftTransfer: false }, }, ], providers: [config.neverminedNodeAddress], - duration: 1, nftContractAddress: subscriptionNFT.address, preMint: false, - nftTransfer: false, }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, publisher) assert.isDefined(subscriptionDDO) @@ -257,12 +254,12 @@ describe('Subscription Durations', () => { services: [ { serviceType: 'nft-access', + nft: { nftTransfer: false }, }, ], providers: [config.neverminedNodeAddress], nftContractAddress: subscriptionNFT.address, preMint: false, - nftTransfer: false, }) datasetDDO = await nevermined.nfts721.create(nftAttributes, publisher) assert.isDefined(datasetDDO) diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index d0b0cf750..71678108a 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -136,13 +136,12 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { duration: subscriptionDuration, nftTransfer }, }, ], providers: [neverminedNodeAddress], - duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, preMint, - nftTransfer, royaltyAttributes: royaltyAttributes, }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, editor) @@ -167,13 +166,12 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { services: [ { serviceType: 'nft-access', + nft: { duration: subscriptionDuration, nftTransfer }, }, ], providers: [neverminedNodeAddress], - duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, preMint, - nftTransfer, royaltyAttributes: royaltyAttributes, }) assetDDO = await nevermined.nfts721.create(nftAttributes, editor) @@ -316,13 +314,12 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { { serviceType: 'nft-sales', price: new AssetPrice(editor.getId(), BigNumber.from(0)), + nft: { duration: subscriptionDuration, nftTransfer }, }, ], providers: [neverminedNodeAddress], - duration: subscriptionDuration, nftContractAddress: subscriptionNFT.address, preMint, - nftTransfer, royaltyAttributes: royaltyAttributes, }) subscriptionDDO = await nevermined.nfts721.create(nftAttributes, editor) diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts index de92205ae..20fc336bb 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts @@ -80,7 +80,7 @@ export class TransferNFT721Condition extends ProviderCondition extends ContractBase { ddo: DDO, creator: string, parameters: Params, + serviceReference?: number, ): Promise> public abstract service(): ServiceType public standardContext(ddo: DDO, creator: string, serviceReference?: number): ConditionContext { - - const service = serviceReference ? ddo.findServiceById(serviceReference) : ddo.findServiceByType(this.service()) + const service = serviceReference + ? ddo.findServiceById(serviceReference) + : ddo.findServiceByType(this.service()) let rewards try { rewards = DDO.getAssetPriceFromService(service) @@ -263,14 +265,16 @@ export abstract class AgreementTemplate extends ContractBase { // eslint-disable-next-line @typescript-eslint/no-unused-vars observer = observer ? observer : (_) => ({}) + const service = ddo.findServiceByReference(serviceReference) + const { instances, agreementId } = await this.instanceFromDDO( agreementIdSeed, ddo, from.getId(), parameters, + service.index, ) - const service = ddo.findServiceByReference(serviceReference) const assetPrice = DDO.getAssetPriceFromService(service) const payment = DDO.findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') @@ -279,8 +283,6 @@ export abstract class AgreementTemplate extends ContractBase { const amounts = assetPrice.getAmounts() const receivers = assetPrice.getReceivers() - console.log(`Creating Agreement with AssetPrice: ${assetPrice.toString()}`) - const timeouts: number[] = [] const timelocks: number[] = [] service.attributes.serviceAgreementTemplate.conditions.map((condition) => { diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index c7f4b60e3..3c2a3240c 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -9,7 +9,7 @@ import { ServiceType, ValidationParams, } from '../../../ddo' -import { Account, Condition, MetaData, AssetPrice, NFTAttributes } from '../../../sdk' +import { Account, Condition, MetaData, NFTAttributes } from '../../../sdk' import { TxParameters } from '../ContractBase' import { ConditionInstance, ConditionState } from '../conditions' import { BigNumber } from 'ethers' diff --git a/src/keeper/contracts/templates/NFT721SalesTemplate.ts b/src/keeper/contracts/templates/NFT721SalesTemplate.ts index 2b9474bb4..f669b0546 100644 --- a/src/keeper/contracts/templates/NFT721SalesTemplate.ts +++ b/src/keeper/contracts/templates/NFT721SalesTemplate.ts @@ -64,7 +64,7 @@ export class NFT721SalesTemplate extends BaseTemplate> { const { transferNft721Condition, lockPaymentCondition, escrowPaymentCondition } = this.nevermined.keeper.conditions diff --git a/src/nevermined/AccessService.ts b/src/nevermined/AccessService.ts index 8581f8b8c..3b021e795 100644 --- a/src/nevermined/AccessService.ts +++ b/src/nevermined/AccessService.ts @@ -19,7 +19,7 @@ import { NFTSalesTemplate, } from '../keeper' import { Account } from './Account' -import { AssetPrice, NFTAttributes } from '../models' +import { NFTAttributes } from '../models' export interface AccessProofTemplateParams { type: 'access-proof' @@ -43,7 +43,13 @@ export class AccessService extends Instantiable implements ServicePlugin { const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index 4c5b2b782..f3e1d0787 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -129,7 +129,7 @@ export class NFT721Api extends NFTsBaseApi { public order( did: string, consumer: Account, - serviceReference: ServiceType | number = 'nft-sales', + serviceReference: number | ServiceType = 'nft-sales', txParams?: TxParameters, ): SubscribablePromise { return new SubscribablePromise(async (observer) => { @@ -220,13 +220,20 @@ export class NFT721Api extends NFTsBaseApi { agreementId: string, did: string, publisher: Account, + serviceReference: number | ServiceType = 'nft-sales', txParams?: TxParameters, ): Promise { const { agreements } = this.nevermined const ddo = await this.nevermined.assets.resolve(did) - - const result = await agreements.conditions.transferNft721(agreementId, ddo, publisher, txParams) + const service = ddo.findServiceByReference(serviceReference) + const result = await agreements.conditions.transferNft721( + agreementId, + ddo, + service.index, + publisher, + txParams, + ) if (!result) { throw new NFTError('Error transferring nft721.') } @@ -263,15 +270,18 @@ export class NFT721Api extends NFTsBaseApi { agreementId: string, did: string, publisher: Account, + serviceReference: number | ServiceType = 'nft-sales', txParams?: TxParameters, ): Promise { const { agreements } = this.nevermined const ddo = await this.nevermined.assets.resolve(did) + const service = ddo.findServiceByReference(serviceReference) const result = await agreements.conditions.releaseNft721Reward( agreementId, ddo, + service.index, publisher, undefined, txParams, @@ -525,6 +535,7 @@ export class NFT721Api extends NFTsBaseApi { let receipt = await this.nevermined.agreements.conditions.transferNft721( agreementId, ddo, + service.index, owner, txParams, ) @@ -534,6 +545,7 @@ export class NFT721Api extends NFTsBaseApi { receipt = await this.nevermined.agreements.conditions.releaseNft721Reward( agreementId, ddo, + service.index, owner, undefined, txParams, From 73691ad74a755400f5bab63d2f9a91b7ba779e96 Mon Sep 17 00:00:00 2001 From: r-marques Date: Thu, 20 Jul 2023 16:57:41 +0000 Subject: [PATCH 029/151] Automated CHANGELOG.md update Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eabe399c..49c37f553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc0](https://github.com/nevermined-io/sdk-js/compare/v1.13.16...v2.0.0-rc0) + +> 20 July 2023 + +- update to latest subgraphs [`#547`](https://github.com/nevermined-io/sdk-js/pull/547) +- Bringing `main` to `develop` [`#549`](https://github.com/nevermined-io/sdk-js/pull/549) +- fix: change resolve by retrieveDDO in servicesBySubscription search method [`#545`](https://github.com/nevermined-io/sdk-js/pull/545) +- Integration test improvements to facilitate basic authentication validation [`#544`](https://github.com/nevermined-io/sdk-js/pull/544) +- Feat/eip712 typed signatures [`#542`](https://github.com/nevermined-io/sdk-js/pull/542) +- fix: update polygon gasstation urls [`#541`](https://github.com/nevermined-io/sdk-js/pull/541) +- Improve getAgreementStatus [`#539`](https://github.com/nevermined-io/sdk-js/pull/539) +- fix: delete assets [`#536`](https://github.com/nevermined-io/sdk-js/pull/536) +- Adding networkId of the network where the asset is registered [`#535`](https://github.com/nevermined-io/sdk-js/pull/535) +- Handling encoding problem with dids starting by 0 [`#533`](https://github.com/nevermined-io/sdk-js/pull/533) +- Integration of Open service endpoints [`#532`](https://github.com/nevermined-io/sdk-js/pull/532) +- Feat/support custom query search [`#531`](https://github.com/nevermined-io/sdk-js/pull/531) +- fix: use gas station on polygon networks [`#528`](https://github.com/nevermined-io/sdk-js/pull/528) +- feat: update tests to use ethers v6 [`fe6eae1`](https://github.com/nevermined-io/sdk-js/commit/fe6eae173c42dba66ce017418d7688999f093e67) +- feat: remove getAddress method from ContractBase [`ac14d46`](https://github.com/nevermined-io/sdk-js/commit/ac14d4641e96a8d875ceaecc9a02236877529785) +- feat: replace BigNumber class with ES2020 BigInt [`4ed4b51`](https://github.com/nevermined-io/sdk-js/commit/4ed4b51fad163e189e52b97b965e6ab878017b01) + #### [v1.13.16](https://github.com/nevermined-io/sdk-js/compare/v1.6.0...v1.13.16) > 29 May 2023 @@ -1057,7 +1078,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1320,7 +1341,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1826,7 +1847,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1865,7 +1886,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 9a9239f746d5aa5483b92b3780730d5eb33f30c5 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 20 Jul 2023 19:18:16 +0200 Subject: [PATCH 030/151] feat: use develop branch of node in CI - Simplified the node testing workflow --- .github/workflows/testing-node.yml | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 1012a0c98..4e82e0c71 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -15,11 +15,8 @@ jobs: with: repository: nevermined-io/node path: node - token: ${{ secrets.API_TOKEN_GITHUB }} - - uses: actions/checkout@v3 - with: - repository: nevermined-io/sdk-dtp - path: sdk-dtp + # replace this with develop once https://github.com/nevermined-io/node/pull/212 is merged + ref: feat/sdk-2.0.0-rc0 token: ${{ secrets.API_TOKEN_GITHUB }} - uses: nevermined-io/nvm-tools-actions@v0.12.0 with: @@ -29,29 +26,15 @@ jobs: contracts-version: 'v3.2.1' node: 'false' - - name: Install sponge - run: sudo apt-get install -y moreutils - - name: Install dependencies run: yarn - name: Build SDK-JS package and node run: | yarn build - yarn pack - cp *.tgz sdk-dtp/sdk.tgz - cp *.tgz node/sdk.tgz - cd sdk-dtp - cat package.json | jq '.dependencies."@nevermined-io/sdk"="./sdk.tgz"' | sponge package.json - yarn - yarn build - yarn pack - cp *dtp*.tgz ../node/dtp.tgz cd ../node - cat package.json | jq '.dependencies."@nevermined-io/sdk"="./sdk.tgz"' | sponge package.json - cat package.json | jq '.dependencies."@nevermined-io/sdk-dtp"="./dtp.tgz"' | sponge package.json - yarn + yarn add ../ yarn run setup:dev yarn build From 2dd0b42117362e36022ad8f15bb51ba9cfecee63 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 20 Jul 2023 19:30:54 +0200 Subject: [PATCH 031/151] fix: node CI path --- .github/workflows/testing-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 4e82e0c71..4d4c7248f 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -33,7 +33,7 @@ jobs: run: | yarn build - cd ../node + cd node/ yarn add ../ yarn run setup:dev yarn build From adbcd8343e2ea84b73c7376b8a0356fd7f12bbd8 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 24 Jul 2023 13:02:16 +0200 Subject: [PATCH 032/151] test: fixing tests --- CHANGELOG.md | 8 +- .../ClaimPaymentAbortedAgreement.test.ts | 90 +++++++------------ integration/nevermined/NFT721.test.ts | 4 + .../nevermined/NFT721Templates.test.ts | 11 +++ src/ddo/types.ts | 9 +- .../contracts/templates/NFTSalesTemplate.ts | 2 +- src/models/NFTAttributes.ts | 10 +-- src/nevermined/api/RegistryBaseApi.ts | 5 +- src/utils/DDOHelpers.ts | 2 + .../conditions/NFTLockCondition.test.ts | 68 ++++++++------ .../conditions/TransferNFTCondition.test.ts | 51 ++++++----- 11 files changed, 136 insertions(+), 124 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dca882d83..0eabe399c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1057,7 +1057,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1320,7 +1320,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1826,7 +1826,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1865,7 +1865,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) diff --git a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts index 251065ea8..ac4e1daf0 100644 --- a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts +++ b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts @@ -127,49 +127,26 @@ describe('Claim aborted agreements End-to-End', () => { assert.isDefined(ddo) console.log(ddo.id) + // Timeout & Timelock should only be set for the access condition + const nftSalesService = ddo.findServiceByType('nft-sales') + assert.equal(nftSalesService.attributes.serviceAgreementTemplate?.conditions[0].timeout, 0) assert.equal( - ddo.findServiceByType('nft-sales').attributes.serviceAgreementTemplate?.conditions[0] - .timeout, - 0, - ) - assert.equal( - ddo.findServiceByType('nft-sales').attributes.serviceAgreementTemplate?.conditions[1] - .timeout, + nftSalesService.attributes.serviceAgreementTemplate?.conditions[1].timeout, accessTimeout, ) + assert.equal(nftSalesService.attributes.serviceAgreementTemplate?.conditions[0].timeout, 0) assert.equal( - ddo.findServiceByType('nft-sales').attributes.serviceAgreementTemplate?.conditions[0] - .timeout, - 0, - ) - assert.equal( - ddo.findServiceByType('nft-sales').attributes.serviceAgreementTemplate?.conditions[1] - .timelock, + nftSalesService.attributes.serviceAgreementTemplate?.conditions[1].timelock, accessTimelock, ) // Timeout & Timelock should not affect access services - assert.equal( - ddo.findServiceByType('nft-access').attributes.serviceAgreementTemplate?.conditions[0] - .timeout, - 0, - ) - assert.equal( - ddo.findServiceByType('nft-access').attributes.serviceAgreementTemplate?.conditions[1] - .timeout, - 0, - ) - assert.equal( - ddo.findServiceByType('nft-access').attributes.serviceAgreementTemplate?.conditions[0] - .timeout, - 0, - ) - assert.equal( - ddo.findServiceByType('nft-access').attributes.serviceAgreementTemplate?.conditions[1] - .timelock, - 0, - ) + const nftAccessService = ddo.findServiceByType('nft-access') + assert.equal(nftAccessService.attributes.serviceAgreementTemplate?.conditions[0].timeout, 0) + assert.equal(nftAccessService.attributes.serviceAgreementTemplate?.conditions[1].timeout, 0) + assert.equal(nftAccessService.attributes.serviceAgreementTemplate?.conditions[0].timeout, 0) + assert.equal(nftAccessService.attributes.serviceAgreementTemplate?.conditions[1].timelock, 0) }) }) @@ -286,22 +263,33 @@ describe('Claim aborted agreements End-to-End', () => { await mineBlocks(nevermined, collector1, accessTimeout + 1) + assert.isTrue( + await nevermined.keeper.conditionStoreManager.isConditionTimedOut( + agreement.conditionIds[1], + ), + ) + try { - assert.isTrue( - !(await nevermined.nfts721.claim(agreementId, publisher.getId(), collector1.getId())), + assert.isFalse( + await nevermined.nfts721.claim(agreementId, publisher.getId(), collector1.getId()), ) } catch (error) { - console.debug(`Unable to fullfill condition because timeout`) + console.debug(`Unable to fullfill condition because timeout: ${error.message}`) } - // Condition is timed out so the collector aborts it and gets the escrowed amount - await nevermined.keeper.conditions.transferNft721Condition.abortByTimeOut( - agreement.conditionIds[1], - collector1, - ) - const agreementStatusAfter = + let agreementStatusAfter = await nevermined.keeper.templates.nftSalesTemplate.getAgreementStatus(agreementId) + if (agreementStatusAfter['transferNFT'].state !== ConditionState.Aborted) { + // Condition is timed out so the collector aborts it and gets the escrowed amount + await nevermined.keeper.conditions.transferNft721Condition.abortByTimeOut( + agreement.conditionIds[1], + collector1, + ) + agreementStatusAfter = + await nevermined.keeper.templates.nftSalesTemplate.getAgreementStatus(agreementId) + } + assert.equal(agreementStatusAfter['lockPayment'].state, ConditionState.Fulfilled) assert.equal(agreementStatusAfter['transferNFT'].state, ConditionState.Aborted) assert.equal(agreementStatusAfter['escrowPayment'].state, ConditionState.Unfulfilled) @@ -319,20 +307,4 @@ describe('Claim aborted agreements End-to-End', () => { assert.isTrue(collector1BalanceBeforeOrder.eq(collector1BalanceReleased)) }) }) - - /** - * - it.skip('Because the conditions timedout I want my money back', async () => { - // TODO: wait for timeout - - const collector1BalanceBefore = await token.balanceOf(collector1.getId()) - - // TODO: Abort the Condition - // TODO: Call the EscrowPayment condition - - - const collector1BalanceAfter = await token.balanceOf(collector1.getId()) - assert.isTrue(collector1BalanceBefore.add(nftPrice).eq(collector1BalanceAfter)) - }) - */ }) diff --git a/integration/nevermined/NFT721.test.ts b/integration/nevermined/NFT721.test.ts index f566f1d68..81ed45ace 100644 --- a/integration/nevermined/NFT721.test.ts +++ b/integration/nevermined/NFT721.test.ts @@ -75,12 +75,14 @@ describe('Nfts721 operations', async () => { services: [ { serviceType: 'nft-sales', + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', }, ], nftContractAddress: nft.address, + preMint: true, }) assert.equal(nftAttributes.fulfillAccessTimelock, 0) ddo = await nevermined.nfts721.create(nftAttributes, artist) @@ -139,6 +141,7 @@ describe('Nfts721 operations', async () => { { serviceType: 'nft-sales', price: new AssetPrice().setTokenAddress(token.getAddress()), + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', @@ -188,6 +191,7 @@ describe('Nfts721 operations', async () => { { serviceType: 'nft-sales', price: assetPrice, + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 8712b1bc1..f27ff2e94 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -27,6 +27,7 @@ import { NFT721Api } from '../../src' import { getMetadata } from '../utils' import { BigNumber } from '../../src/utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' +import { repeat } from '../utils/utils' describe('NFT721Templates E2E', () => { let nftContractOwner: Account @@ -650,6 +651,7 @@ describe('NFT721Templates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', @@ -713,6 +715,15 @@ describe('NFT721Templates E2E', () => { assert.isTrue(receipt) const ownerAfter = await nft.ownerOf(ddo.shortId()) + + const status = await repeat(3, nevermined.agreements.status(agreementId)) + + assert.deepEqual(status, { + lockPayment: ConditionState.Fulfilled, + transferNFT: ConditionState.Fulfilled, + escrowPayment: ConditionState.Unfulfilled, + }) + assert.equal(ownerAfter, collector1.getId()) }) diff --git a/src/ddo/types.ts b/src/ddo/types.ts index af4dcf1a6..e1aa618b1 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -1,7 +1,14 @@ import { AaveConditionType, ServiceAaveCredit, TxParameters } from '../keeper' import { Account } from '../sdk' import { BigNumber } from 'ethers' -import { ERCType, NeverminedNFTType, AssetPrice, Babysig, NFTAttributes, NFTServiceAttributes } from '../models' +import { + ERCType, + NeverminedNFTType, + AssetPrice, + Babysig, + NFTAttributes, + NFTServiceAttributes, +} from '../models' export interface Authentication { type: string diff --git a/src/keeper/contracts/templates/NFTSalesTemplate.ts b/src/keeper/contracts/templates/NFTSalesTemplate.ts index 98657d607..4df9eac9d 100644 --- a/src/keeper/contracts/templates/NFTSalesTemplate.ts +++ b/src/keeper/contracts/templates/NFTSalesTemplate.ts @@ -64,7 +64,7 @@ export class NFTSalesTemplate extends BaseTemplate> { const { transferNftCondition, lockPaymentCondition, escrowPaymentCondition } = this.nevermined.keeper.conditions diff --git a/src/models/NFTAttributes.ts b/src/models/NFTAttributes.ts index cf6e70b15..056096d79 100644 --- a/src/models/NFTAttributes.ts +++ b/src/models/NFTAttributes.ts @@ -4,9 +4,7 @@ import { AssetAttributes } from './AssetAttributes' import { ERCType, NeverminedNFTType, NeverminedNFT1155Type, NeverminedNFT721Type } from './' import { ServiceType } from '../ddo/types' - export class NFTServiceAttributes { - /** * The asset is transferred (true) or minted (false) with Nevermined contracts */ @@ -40,7 +38,6 @@ export class NFTServiceAttributes { ...NFTServiceAttributes.defaultValues, } } - } export class NFTAttributes extends AssetAttributes { @@ -83,7 +80,6 @@ export class NFTAttributes extends AssetAttributes { */ cap?: BigNumber - static defaultValues = { ...AssetAttributes.defaultValues, royaltyAttributes: undefined, @@ -132,7 +128,9 @@ export class NFTAttributes extends AssetAttributes { ...NFTAttributes.defaultValues, ...nftAttributes, } - _instance.services.forEach((service) => { service.nft.isSubscription = true}) + _instance.services.forEach((service) => { + service.nft.isSubscription = true + }) return _instance } @@ -146,7 +144,6 @@ export class NFTAttributes extends AssetAttributes { ...NFTAttributes.defaultValues, ...nftAttributes, } - _instance.services.forEach((service) => { service.nft.isSubscription = false }) return _instance } @@ -160,7 +157,6 @@ export class NFTAttributes extends AssetAttributes { ...NFTAttributes.defaultValues, ...nftAttributes, } - _instance.services.forEach((service) => { service.nft.isSubscription = false }) return _instance } } diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 1989ddc03..ec7538127 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -100,7 +100,7 @@ export abstract class RegistryBaseApi extends Instantiable { const pricedData = serviceAttributes.price ? await this.getPriced(serviceAttributes.price) : undefined - + const serviceCreated = plugin.createService( publisher, assetAttributes.metadata, @@ -163,7 +163,6 @@ export abstract class RegistryBaseApi extends Instantiable { let serviceEndpoint = this.nevermined.services.metadata.getServiceEndpoint(DID.parse(ddo.id)) - ddo.updateService({ type: 'metadata', index: 0, @@ -255,7 +254,7 @@ export abstract class RegistryBaseApi extends Instantiable { txParams, ) } - + if (nftAttributes.royaltyAttributes != undefined) { this.logger.log(`Setting up royalties`) diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 47dc21a04..8c3295af6 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -43,6 +43,8 @@ export function getConditionsByParams( fulfillAccessTimeout = 0, fulfillAccessTimelock = 0, ): ServiceAgreementTemplateCondition[] { + console.log(`FulfillAccessTimeout: ${fulfillAccessTimeout}`) + console.log(`FulfillAccessTimelock: ${fulfillAccessTimelock}`) return conditions .map((condition) => { if ( diff --git a/test/keeper/conditions/NFTLockCondition.test.ts b/test/keeper/conditions/NFTLockCondition.test.ts index 9b75e3839..6ccbd25cd 100644 --- a/test/keeper/conditions/NFTLockCondition.test.ts +++ b/test/keeper/conditions/NFTLockCondition.test.ts @@ -79,13 +79,16 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - services: [{ - serviceType: 'nft-sales', - nft: { amount } - }, { - serviceType: 'nft-access', - nft: { amount } - }], + services: [ + { + serviceType: 'nft-sales', + nft: { amount }, + }, + { + serviceType: 'nft-access', + nft: { amount }, + }, + ], preMint: true, }) @@ -138,13 +141,16 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - services: [{ - serviceType: 'nft-sales', - nft: { amount } - }, { - serviceType: 'nft-access', - nft: { amount } - }], + services: [ + { + serviceType: 'nft-sales', + nft: { amount }, + }, + { + serviceType: 'nft-access', + nft: { amount }, + }, + ], preMint: true, }) @@ -176,13 +182,16 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - services: [{ - serviceType: 'nft-sales', - nft: { amount } - }, { - serviceType: 'nft-access', - nft: { amount } - }], + services: [ + { + serviceType: 'nft-sales', + nft: { amount }, + }, + { + serviceType: 'nft-access', + nft: { amount }, + }, + ], preMint: false, }) @@ -219,13 +228,16 @@ describe('NFTLockCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - services: [{ - serviceType: 'nft-sales', - nft: { amount } - }, { - serviceType: 'nft-access', - nft: { amount } - }], + services: [ + { + serviceType: 'nft-sales', + nft: { amount }, + }, + { + serviceType: 'nft-access', + nft: { amount }, + }, + ], preMint: true, }) diff --git a/test/keeper/conditions/TransferNFTCondition.test.ts b/test/keeper/conditions/TransferNFTCondition.test.ts index d33b73db7..8881d431c 100644 --- a/test/keeper/conditions/TransferNFTCondition.test.ts +++ b/test/keeper/conditions/TransferNFTCondition.test.ts @@ -126,13 +126,16 @@ describe('TransferNFTCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(100), - services: [{ - serviceType: 'nft-sales', - nft: { amount: nftAmount } - }, { - serviceType: 'nft-access', - nft: { amount: nftAmount } - }], + services: [ + { + serviceType: 'nft-sales', + nft: { amount: nftAmount }, + }, + { + serviceType: 'nft-access', + nft: { amount: nftAmount }, + }, + ], preMint: false, }) @@ -229,13 +232,16 @@ describe('TransferNFTCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(0), - services: [{ - serviceType: 'nft-sales', - nft: { amount: nftAmount } - }, { - serviceType: 'nft-access', - nft: { amount: nftAmount } - }], + services: [ + { + serviceType: 'nft-sales', + nft: { amount: nftAmount }, + }, + { + serviceType: 'nft-access', + nft: { amount: nftAmount }, + }, + ], preMint: false, }) @@ -327,13 +333,16 @@ describe('TransferNFTCondition', () => { nftType: NeverminedNFT1155Type.nft1155, nftContractAddress: nftUpgradeable.address, cap: BigNumber.from(0), - services: [{ - serviceType: 'nft-sales', - nft: { amount: nftAmount } - }, { - serviceType: 'nft-access', - nft: { amount: nftAmount } - }], + services: [ + { + serviceType: 'nft-sales', + nft: { amount: nftAmount }, + }, + { + serviceType: 'nft-access', + nft: { amount: nftAmount }, + }, + ], preMint: false, }) From 066aa9d1bf783b0456032dce8c0c7a3711fc4c3e Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 24 Jul 2023 13:17:04 +0200 Subject: [PATCH 033/151] Update testing-node.yml --- .github/workflows/testing-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 4d4c7248f..8d3a34927 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -15,7 +15,7 @@ jobs: with: repository: nevermined-io/node path: node - # replace this with develop once https://github.com/nevermined-io/node/pull/212 is merged + # TODO: replace this with develop once https://github.com/nevermined-io/node/pull/212 is merged ref: feat/sdk-2.0.0-rc0 token: ${{ secrets.API_TOKEN_GITHUB }} - uses: nevermined-io/nvm-tools-actions@v0.12.0 From 801c86d2773be2fb21ab781b5ea773651e898e29 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:53:59 +0200 Subject: [PATCH 034/151] ci: fixing test --- integration/nevermined/NFT721Api.e2e.test.ts | 3 +++ src/utils/DDOHelpers.ts | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index 458977f61..0e1e38ed2 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -115,12 +115,15 @@ describe('NFTs721 Api End-to-End', () => { { serviceType: 'nft-sales', price: assetPrice1, + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', + nft: { nftTransfer: true }, }, ], nftContractAddress: nftContract.address, + preMint: true, }) ddo = await nevermined.nfts721.create(nftAttributes, artist) diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 8c3295af6..47dc21a04 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -43,8 +43,6 @@ export function getConditionsByParams( fulfillAccessTimeout = 0, fulfillAccessTimelock = 0, ): ServiceAgreementTemplateCondition[] { - console.log(`FulfillAccessTimeout: ${fulfillAccessTimeout}`) - console.log(`FulfillAccessTimelock: ${fulfillAccessTimelock}`) return conditions .map((condition) => { if ( From b8c4d8fe28da2b1003bac42e6b5293ed48ec2d04 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 24 Jul 2023 15:39:28 +0200 Subject: [PATCH 035/151] chore: using bigint on tests --- .../nevermined/AssetsWithMultipleServices.test.ts | 13 ++++++------- integration/nevermined/NFT721Templates.test.ts | 1 + .../nevermined/NFTsWithMultipleServices.test.ts | 15 +++++++-------- integration/nevermined/SecondaryMarket.test.ts | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/integration/nevermined/AssetsWithMultipleServices.test.ts b/integration/nevermined/AssetsWithMultipleServices.test.ts index 0d5c288b9..5e9937f25 100644 --- a/integration/nevermined/AssetsWithMultipleServices.test.ts +++ b/integration/nevermined/AssetsWithMultipleServices.test.ts @@ -12,7 +12,6 @@ import { ConditionState, Token, } from '../../src' -import { BigNumber } from '../../src/utils' import { repeat, sleep } from '../utils/utils' let nevermined: Nevermined @@ -25,8 +24,8 @@ let assetPrice2: AssetPrice let payload: JWTPayload let ddo: DDO let token: Token -let balanceBefore: BigNumber -let balanceAfter: BigNumber +let balanceBefore: bigint +let balanceAfter: bigint let service let agreementId let neverminedNodeAddress @@ -47,11 +46,11 @@ describe('Assets with multiple services', () => { await nevermined.services.marketplace.login(clientAssertion) payload = decodeJwt(config.marketplaceAuthToken) - assetPrice1 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount1)) - assetPrice2 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount2)) + assetPrice1 = new AssetPrice(publisher.getId(), BigInt(totalAmount1)) + assetPrice2 = new AssetPrice(publisher.getId(), BigInt(totalAmount2)) try { - await consumer.requestTokens(BigNumber.from(totalAmount1).mul(10)) + await consumer.requestTokens(BigInt(totalAmount1) * 10n) } catch (error) { console.error(error) } @@ -125,7 +124,7 @@ describe('Assets with multiple services', () => { console.log(`Balance Before: ${balanceBefore.toString()}`) console.log(`Balance After : ${balanceAfter.toString()}`) - assert.isTrue(balanceBefore.sub(BigNumber.from(price)).eq(balanceAfter)) + assert.isTrue(balanceBefore - BigInt(price) === balanceAfter) }) it('Download assets through the Node', async () => { diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 920956615..3cdb1fc19 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -27,6 +27,7 @@ import { NFT721Api } from '../../src' import { getMetadata } from '../utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' import { EventLog } from 'ethers' +import { repeat } from '../utils/utils' describe('NFT721Templates E2E', () => { let nftContractOwner: Account diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index 6361af5ef..ae5454874 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -14,7 +14,6 @@ import { NFTAttributes, ConditionState, } from '../../src' -import { BigNumber } from '../../src/utils' import { ethers } from 'ethers' import { repeat } from '../utils/utils' @@ -30,7 +29,7 @@ let token: Token let service let agreementId let neverminedNodeAddress -let nft: ethers.Contract +let nft: ethers.BaseContract let nftContract: Nft721Contract let salesServices const totalAmount1 = '100' @@ -63,7 +62,7 @@ describe('E2E Flow for NFTs with multiple services', () => { nftContract = await Nft721Contract.getInstance( (nevermined.keeper as any).instanceConfig, - nft.address, + await nft.getAddress(), ) await nevermined.contracts.loadNft721(nftContract.address) @@ -80,11 +79,11 @@ describe('E2E Flow for NFTs with multiple services', () => { await nevermined.services.marketplace.login(clientAssertion) payload = decodeJwt(config.marketplaceAuthToken) - assetPrice1 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount1)) - assetPrice2 = new AssetPrice(publisher.getId(), BigNumber.from(totalAmount2)) + assetPrice1 = new AssetPrice(publisher.getId(), BigInt(totalAmount1)) + assetPrice2 = new AssetPrice(publisher.getId(), BigInt(totalAmount2)) try { - await collector1.requestTokens(BigNumber.from(totalAmount1).mul(10)) + await collector1.requestTokens(BigInt(totalAmount1) * 10n) } catch (error) { console.error(error) } @@ -152,7 +151,7 @@ describe('E2E Flow for NFTs with multiple services', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const price = DDO.getAssetPriceFromService(service) - assert.isTrue(collector1BalanceBefore.sub(price.getTotalPrice()).eq(collector1BalanceAfter)) + assert.isTrue(collector1BalanceBefore - price.getTotalPrice() === collector1BalanceAfter) const status = await repeat(3, nevermined.agreements.status(agreementId)) @@ -215,7 +214,7 @@ describe('E2E Flow for NFTs with multiple services', () => { const collector1BalanceAfter = await token.balanceOf(collector1.getId()) const price = DDO.getAssetPriceFromService(service) - assert.isTrue(collector1BalanceBefore.sub(price.getTotalPrice()).eq(collector1BalanceAfter)) + assert.isTrue(collector1BalanceBefore - price.getTotalPrice() === collector1BalanceAfter) let status = await repeat(3, nevermined.agreements.status(agreementId)) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index c67fc557f..e91d1ef71 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -21,7 +21,7 @@ import { NFTSalesTemplate, Token, } from '../../src/keeper' -import { formatUnits, parseUnits } from '../../src/utils' +import { formatUnits, getConditionsByParams, parseUnits } from '../../src/utils' import { config } from '../config' import { getMetadata } from '../utils' import { getRoyaltyAttributes, RoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' From ef51a67fcfccff1995c786e3653e91e2e0fc498e Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:20:28 +0200 Subject: [PATCH 036/151] ci: increase timeout --- integration/mocha.opts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/mocha.opts b/integration/mocha.opts index d8310c34a..d206be837 100644 --- a/integration/mocha.opts +++ b/integration/mocha.opts @@ -3,4 +3,4 @@ --require mock-local-storage --full-trace --exit ---timeout 300000 +--timeout 500000 From cee82444dd62c613a50af8f5c4ebd8f70833d117 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 09:43:57 +0200 Subject: [PATCH 037/151] fix: adding support to multiple services on erc1155 nfts --- MIGRATION_GUIDE.md | 14 +++ integration/nevermined/NFTTemplates.test.ts | 5 + .../nevermined/SecondaryMarket.test.ts | 6 ++ src/ddo/DDO.ts | 62 +++++++++-- src/nevermined/api/AssetsApi.ts | 12 +-- src/nevermined/api/ConditionsApi.ts | 4 + src/nevermined/api/nfts/NFT1155Api.ts | 15 ++- src/nevermined/api/nfts/NFT721Api.ts | 2 + src/utils/DDOHelpers.ts | 102 ------------------ 9 files changed, 105 insertions(+), 117 deletions(-) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 9d57e89ec..a450d87bf 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -33,3 +33,17 @@ isEqual = value1.eq(value2) // Using BigInt in v2 isEqual = value1 == value2 ``` + +### DDO Helper functions + +Most of them were migrated to the `DDO` class: + +- `findServiceConditionByName` -> `DDO.findServiceConditionByName` +- `getAssetPriceFromDDOByService` -> `DDO.getAssetPriceFromDDOByServiceType` +- `setNFTRewardsFromDDOByService` -> `DDO.setNFTRewardsFromDDOByService` +- `setAssetPriceFromDDOByService` -> `DDO.setAssetPriceFromDDOByService` +- `getAssetPriceFromService` -> `DDO.getAssetPriceFromService` +- `getDIDFromService` -> `DDO.getDIDFromService` +- `getNftHolderFromService` -> `DDO.getNftHolderFromService` +- `getNftAmountFromService` -> `DDO.getNftAmountFromService` +- `getNftContractAddressFromService` -> `DDO.getNftContractAddressFromService` diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index d0249ed23..e79974aee 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -686,9 +686,11 @@ describe('NFTTemplates E2E', () => { const nftBalanceArtistBefore = await nftUpgradeable.balance(artist.getId(), ddo.id) const nftBalanceCollectorBefore = await nftUpgradeable.balance(collector1.getId(), ddo.id) + const service = ddo.findServiceByType('nft-sales') const receipt = await nevermined.agreements.conditions.transferNft( agreementId, ddo, + service.index, numberNFTs, artist, ) @@ -844,9 +846,12 @@ describe('NFTTemplates E2E', () => { const nftBalanceCollector1Before = await nftUpgradeable.balance(collector1.getId(), ddo.id) const nftBalanceCollector2Before = await nftUpgradeable.balance(collector2.getId(), ddo.id) + const service = ddo.findServiceByType('nft-sales') + const receipt = await nevermined.agreements.conditions.transferNft( agreementId2, ddo, + service.index, numberNFTs2, collector1, ) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index e91d1ef71..5ae9ccf5f 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -251,9 +251,12 @@ describe('Secondary Markets', () => { const nftBalanceArtistBefore = await nftUpgradeable.balance(artist.getId(), ddo.id) const nftBalanceCollectorBefore = await nftUpgradeable.balance(collector1.getId(), ddo.id) + const service = ddo.findServiceByType('nft-sales') + const receipt = await nevermined.agreements.conditions.transferNft( agreementId, ddo, + service.index, numberNFTs, artist, ) @@ -435,9 +438,12 @@ describe('Secondary Markets', () => { const nftBalanceCollector1Before = await nftUpgradeable.balance(collector1.getId(), ddo.id) const nftBalanceCollector2Before = await nftUpgradeable.balance(collector2.getId(), ddo.id) + const service = ddo.findServiceByType('nft-sales') + const receipt = await nevermined.agreements.conditions.transferNft( agreementId2, ddo, + service.index, numberNFTs2, collector1, ) diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 5e2f4da94..5c9d62975 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -129,7 +129,7 @@ export class DDO { /** * Finds a service of a DDO by index. - * @param index - index. + * @param index - index of the service in the DDO. * @returns Service. */ public findServiceById(index: number): Service { @@ -147,7 +147,7 @@ export class DDO { /** * Finds the first service of a DDO by type. - * @param serviceType - Service type. + * @param serviceType - Service type used by find the service * * @throws {@link DDOServiceNotFoundError} If the service is not in the DDO. * @returns {@link Service}. @@ -163,7 +163,7 @@ export class DDO { /** * Finds a service of a DDO by index. - * @param index - index. + * @param serviceReference - reference to the service (index or type). * @returns Service. */ public findServiceByReference( @@ -198,7 +198,7 @@ export class DDO { /** * Checks if a service index in the DDO. - * @param serviceIndex - Service . + * @param serviceIndex - Service index. * * @returns true if service exists. */ @@ -252,6 +252,10 @@ export class DDO { } } + /** + * Get the checksum of the proof. + * @returns string containing the checksum of the proof. + */ public getProofChecksum(): string { return this.checksum(JSON.stringify(this.proof.checksum)) } @@ -259,7 +263,7 @@ export class DDO { /** * Generates and adds a proof using personal sign on the DDO. * @param publicKey - Public key to be used on personal sign. - * @returns Proof object. + * @returns void. */ public async addProof(publicKey: string): Promise { if (this.proof) { @@ -268,6 +272,9 @@ export class DDO { this.proof = await this.generateProof(publicKey) } + /** + * It reorders the services of the DDO using the service index + */ public reorderServices(): void { this.service.sort((a, b) => (a.index > b.index ? 1 : -1)) for (let i = 0; i < this.service.length; i++) { @@ -276,14 +283,29 @@ export class DDO { this.service.sort((a, b) => (a.index > b.index ? 1 : -1)) } + /** + * Adds a service to the DDO. + * @param service + */ public addService(service: ServiceCommon) { this.service.push(service) } + /** + * Replaces a service in the DDO. + * @param index + * @param service + */ public replaceService(index: number, service: any) { this.service[index] = service } + /** + * Adds a default metadata service to the DDO. + * @param metadata metadata + * @param nftAttributes nft attributes + * @returns main metadata attributes + */ public addDefaultMetadataService( metadata: MetaData, nftAttributes?: NFTAttributes, @@ -315,10 +337,21 @@ export class DDO { return metadataService.attributes.main } + /** + * Updates a service in the DDO + * @param service the service to be updated + * @param serviceIndex the position of the service in the DDO.services array + */ public updateService(service: any, serviceIndex = 0) { this.service[serviceIndex] = service } + /** + * Assign a DID to the DDO + * @param didSeed DID seed + * @param didRegistry DIDRegistry contract + * @param publisher account registering the DID + */ public async assignDid(didSeed: string, didRegistry: DIDRegistry, publisher: Account) { const did = didPrefixed(await didRegistry.hashDID(didSeed, publisher.getId())) this.id = did @@ -327,10 +360,20 @@ export class DDO { this.publicKey[0].id = did } + /** + * It generates a DID seed from a seed + * @param seed the seed + * @returns the string represeing the DID seed + */ public async generateDidSeed(seed) { return zeroX(this.checksum(JSON.stringify(seed))) } + /** + * It adds a signature to the the proof object of the DDO + * @param nevermined nevermined object + * @param publicKey public key to sign the DDO + */ public async addSignature(nevermined: Nevermined, publicKey: string) { this.proof.signatureValue = await nevermined.utils.signature.signText(this.shortId(), publicKey) } @@ -341,7 +384,7 @@ export class DDO { * If fins a service condition by name * @param service the service to search in * @param name the name of the condition - * @returns the condition + * @returns ServiceAgreementTemplateCondition the condition */ public static findServiceConditionByName( service: Service, @@ -490,6 +533,13 @@ export class DDO { holder.value = holderAddress } + /** + * Finds an attribute in the DDO and replace it with the given value + * @param ddo the originial DDO + * @param paramName the param name to replace + * @param value the new value + * @returns the DDO with the replaced attribute + */ public static findAndReplaceDDOAttribute(ddo: DDO, paramName: string, value: string): DDO { return DDO.deserialize(DDO.serialize(ddo).replaceAll(paramName, value)) } diff --git a/src/nevermined/api/AssetsApi.ts b/src/nevermined/api/AssetsApi.ts index 9c99ad874..95acb0892 100644 --- a/src/nevermined/api/AssetsApi.ts +++ b/src/nevermined/api/AssetsApi.ts @@ -173,7 +173,7 @@ export class AssetsApi extends RegistryBaseApi { * If the access service to purchase is having associated some price, it will make the payment * for that service. * @param did - Unique identifier of the asset to order - * @param serviceReference - The service to order. By default is the access service, but it can be specified the service.index too + * @param serviceReference - The service to order. By default is the access service, but it can be specified the service.index to refer a different specific service * @param consumerAccount - The account of the user ordering the asset * @param txParams - Optional transaction parameters * @returns The agreement ID identifying the order @@ -192,6 +192,7 @@ export class AssetsApi extends RegistryBaseApi { * This method allows to download the assets associated to that service. * @param agreementId - The unique identifier of the order placed for a service * @param did - Unique identifier of the asset ordered + * @param serviceReference - The service to download. By default is the access service, but it can be specified the service.index to refer a different specific service * @param consumerAccount - The account of the user who ordered the asset and is downloading the files * @param resultPath - Where the files will be downloaded * @param fileIndex - The file to download. If not given or is -1 it will download all of them. @@ -219,17 +220,16 @@ export class AssetsApi extends RegistryBaseApi { } const { files } = attributes.main - const serviceEndpoint = this.nevermined.services.node.getAccessEndpoint() + // const serviceEndpoint = this.nevermined.services.node.getAccessEndpoint() // let serviceEndpoint // if (service.serviceEndpoint) { // serviceEndpoint = service.serviceEndpoint // } else { // serviceEndpoint = this.nevermined.services.node.getAccessEndpoint() - // //"http://node.nevermined.localnet/api/v1/node/services/access - // // throw new AssetError( - // // 'Consume asset failed, service definition is missing the `serviceEndpoint`.', - // // ) // } + const serviceEndpoint = service.serviceEndpoint + ? service.serviceEndpoint + : this.nevermined.services.node.getAccessEndpoint() this.logger.log('Consuming files') diff --git a/src/nevermined/api/ConditionsApi.ts b/src/nevermined/api/ConditionsApi.ts index af39caaa4..724ba4c3b 100644 --- a/src/nevermined/api/ConditionsApi.ts +++ b/src/nevermined/api/ConditionsApi.ts @@ -410,6 +410,7 @@ export class ConditionsApi extends Instantiable { * Transfers a certain amount of nfts after payment as been made. * @param agreementId - The service agreement id of the nft transfer. * @param ddo - The decentralized identifier of the asset containing the nfts. + * @param serviceIndex - The index of the service containing the nfts to transfer * @param nftAmount - The amount of nfts to transfer. * @param from - Account. * @returns {@link true} if the transfer is successful @@ -417,6 +418,7 @@ export class ConditionsApi extends Instantiable { public async transferNft( agreementId: string, ddo: DDO, + serviceIndex: number, nftAmount: bigint, from?: Account, txParams?: txParams, @@ -432,6 +434,7 @@ export class ConditionsApi extends Instantiable { ddo, creator, template.params(accessConsumer, nftAmount), + serviceIndex, ) const contractReceipt: ContractTransactionReceipt = await transferNftCondition.fulfillInstance( @@ -491,6 +494,7 @@ export class ConditionsApi extends Instantiable { * Transfers a certain amount of nfts after payment as been made. * @param agreementId - The service agreement id of the nft transfer. * @param ddo - The decentralized identifier of the asset containing the nfts. + * @param serviceIndex - The index of the service containing the nfts to transfer * @param publisher - Account. * @returns {@link true} if the transfer is successful */ diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index f68696cef..89ec9d988 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -293,8 +293,8 @@ export class NFT1155Api extends NFTsBaseApi { * @param did - The Decentralized identifier of the NFT asset. * @param nftAmount - The number of NFTs to transfer. * @param publisher - The current owner of the NFTs. + * @param serviceReference - The reference to identify wich service within the DDO to transfer * @param txParams - Optional transaction parameters. - * * @returns true if the transfer was successful. * * @throws {@link NFTError} @@ -305,14 +305,17 @@ export class NFT1155Api extends NFTsBaseApi { did: string, nftAmount: bigint, publisher: Account, + serviceReference: number | ServiceType = 'nft-sales', txParams?: TxParameters, ): Promise { const { agreements } = this.nevermined const ddo = await this.nevermined.assets.resolve(did) + const service = ddo.findServiceByReference(serviceReference) const result = await agreements.conditions.transferNft( agreementId, ddo, + service.index, nftAmount, publisher, txParams, @@ -343,6 +346,7 @@ export class NFT1155Api extends NFTsBaseApi { * * @param agreementId - The NFT sales agreement id. * @param did - The Decentralized identifier of the NFT asset. + * @param serviceReference - The reference to identify wich service within the DDO to release rewards * @param nftAmount - The amount of NFTs to transfer. * @param publisher - The current owner of the NFTs. * @param txParams - Optional transaction parameters. @@ -481,8 +485,10 @@ export class NFT1155Api extends NFTsBaseApi { * ``` * * @param owner - The owner account. - * @param agreementId - the Id of the underlying service agreement. - * + * @param consumer - The consumer account. + * @param agreementIdSeed - the Id of the underlying service agreement seed. + * @param serviceReference - The reference to identify wich service within the DDO to release rewards + * @param txParams - Optional transaction parameters. * @returns true if the transaction was successful. * * @throws {@link NFTError} @@ -505,9 +511,12 @@ export class NFT1155Api extends NFTsBaseApi { consumer.getId(), ) + const ddoService = ddo.findServiceByReference(serviceReference) + let receipt = await this.nevermined.agreements.conditions.transferNft( agreementId, ddo, + ddoService.index, nftAmount, owner, txParams, diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index 6f7c37ba2..6dd91164a 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -207,6 +207,7 @@ export class NFT721Api extends NFTsBaseApi { * @param agreementId - The NFT sales agreement id. * @param did - The Decentralized identifier of the NFT asset. * @param publisher - The current owner of the NFTs. + * @param serviceReference - The reference to identify wich service within the DDO to transfer * @param txParams - Optional transaction parameters. * * @returns true if the transfer was successful. @@ -257,6 +258,7 @@ export class NFT721Api extends NFTsBaseApi { * @param agreementId - The NFT sales agreement id. * @param did - The Decentralized identifier of the NFT asset. * @param publisher - The current owner of the NFTs. + * @param serviceReference - The reference to identify wich service within the DDO to release rewards * @param txParams - Optional transaction parameters. * * @returns true if the funds release was successful. diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 33a8204e6..c048945bb 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -1,12 +1,7 @@ import { - DDO, ServiceAgreementTemplateCondition, ServiceAgreementTemplateParameter, - ConditionType, - Service, ServiceType, - ServiceNFTAccess, - ServiceNFTSales, } from '../ddo' import { AssetPrice } from '../models' @@ -121,100 +116,3 @@ function getParameter( return { ...parameter, value } } - -// @deprecated Use `DDO.findServiceConditionByName` instead -export function findServiceConditionByName( - service: Service, - name: ConditionType, -): ServiceAgreementTemplateCondition { - return service.attributes.serviceAgreementTemplate.conditions.find((c) => c.name === name) -} - -// @deprecated Use `DDO.getAssetPriceFromDDOByServiceType` instead -export function getAssetPriceFromDDOByService(ddo: DDO, service: ServiceType): AssetPrice { - return getAssetPriceFromService(ddo.findServiceByType(service)) -} - -// @deprecated Use `DDO.setNFTRewardsFromDDOByService` instead -export function setNFTRewardsFromDDOByService( - ddo: DDO, - serviceType: ServiceType, - rewards: AssetPrice, - holderAddress: string, -) { - setAssetPriceFromDDOByService(ddo, serviceType, rewards) - const service = ddo.findServiceByType(serviceType) - const transferCondition = findServiceConditionByName(service, 'transferNFT') - if (!transferCondition) { - return - } - const holder = transferCondition.parameters.find((p) => p.name === '_nftHolder') - holder.value = holderAddress -} - -// @deprecated Use `DDO.setAssetPriceFromDDOByService` instead -export function setAssetPriceFromDDOByService( - ddo: DDO, - serviceType: ServiceType, - rewards: AssetPrice, -) { - const service = ddo.findServiceByType(serviceType) - const escrowPaymentCondition = findServiceConditionByName(service, 'escrowPayment') - if (!escrowPaymentCondition) { - return - } - const amounts = escrowPaymentCondition.parameters.find((p) => p.name === '_amounts') - const receivers = escrowPaymentCondition.parameters.find((p) => p.name === '_receivers') - amounts.value = Array.from(rewards.getAmounts(), (v) => v.toString()) - receivers.value = rewards.getReceivers() -} - -// @deprecated Use `DDO.getAssetPriceFromService` instead -export function getAssetPriceFromService(service: Service): AssetPrice { - const escrowPaymentCondition = findServiceConditionByName(service, 'escrowPayment') - if (!escrowPaymentCondition) { - return - } - - const amounts = escrowPaymentCondition.parameters.find((p) => p.name === '_amounts') - .value as string[] - const receivers = escrowPaymentCondition.parameters.find((p) => p.name === '_receivers') - .value as string[] - - const rewardsMap = new Map() - - for (let i = 0; i < amounts.length; i++) rewardsMap.set(receivers[i], BigInt(amounts[i])) - - return new AssetPrice(rewardsMap) -} - -// @deprecated Use `DDO.getDIDFromService` instead -export function getDIDFromService(service: Service): string { - const escrowPaymentCondition = findServiceConditionByName(service, 'escrowPayment') - return ('did:nv:' + - escrowPaymentCondition.parameters.find((p) => p.name === '_did').value) as string -} - -// @deprecated Use `DDO.getNftHolderFromService` instead -export function getNftHolderFromService(service: Service): string { - const nftTransferCondition = findServiceConditionByName(service, 'transferNFT') - return nftTransferCondition.parameters.find((p) => p.name === '_nftHolder').value as string -} - -// @deprecated Use `DDO.getNftAmountFromService` instead -export function getNftAmountFromService(service: Service): bigint { - const nftTransferCondition = findServiceConditionByName(service, 'transferNFT') - return BigInt( - nftTransferCondition.parameters.find((p) => p.name === '_numberNfts').value as string, - ) -} - -// @deprecated Use `DDO.getNftContractAddressFromService` instead -export function getNftContractAddressFromService( - service: ServiceNFTAccess | ServiceNFTSales, -): string { - const paramName = '_contractAddress' - const conditionName = service.type === 'nft-access' ? 'nftHolder' : 'transferNFT' - const nftTransferCondition = findServiceConditionByName(service, conditionName) - return nftTransferCondition.parameters.find((p) => p.name === paramName).value as string -} From 0376a87a750c8677ef5cca0a32f63d22d1f89c17 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 09:47:51 +0200 Subject: [PATCH 038/151] chore: updating migration guide --- MIGRATION_GUIDE.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index a450d87bf..4e692acb1 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -1,5 +1,31 @@ # Migration guide to v2 +## Breaking changes + +### Defining Asset Price + +The assetPrice is not part of AssetAttributes anymore and is part of each individual service added to the DDO when registering a service. So for services having a price, this must be added as part of the services array of the AssetAttributes. + +Example: + +```typescript +const nftAttributes = NFTAttributes.getNFT721Instance({ + metadata, + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + }, + { + serviceType: 'nft-access', + }, + ], + nftContractAddress: nftContract.address, +}) +``` + +You will find multiple examples of this in the integration tests. + ### Big Numbers To handle big numbers v2 uses the ES2020 built-in `BigInt` values ([see the BigInt documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)): From c4b2b5fa245788699d55d6a442544fa1ed7e1388 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 13:22:26 +0200 Subject: [PATCH 039/151] chore: addressing comments --- integration/mocha.opts | 2 +- .../AssetsWithMultipleServices.test.ts | 4 +-- .../NFTsWithMultipleServices.test.ts | 6 ++-- package.json | 4 +-- src/ddo/DDO.ts | 33 +++++++++++++++++-- src/errors/DDOError.ts | 6 ++++ .../conditions/Condition.abstract.ts | 2 +- .../templates/AgreementTemplate.abstract.ts | 11 +++---- src/models/AssetAttributes.ts | 2 -- src/nevermined/api/AssetsApi.ts | 9 +---- src/nevermined/api/RegistryBaseApi.ts | 8 +---- src/nevermined/api/nfts/NFT1155Api.ts | 2 +- src/nevermined/api/nfts/NFT721Api.ts | 2 +- src/nevermined/api/nfts/NFTsBaseApi.ts | 2 +- 14 files changed, 54 insertions(+), 39 deletions(-) diff --git a/integration/mocha.opts b/integration/mocha.opts index d206be837..d8310c34a 100644 --- a/integration/mocha.opts +++ b/integration/mocha.opts @@ -3,4 +3,4 @@ --require mock-local-storage --full-trace --exit ---timeout 500000 +--timeout 300000 diff --git a/integration/nevermined/AssetsWithMultipleServices.test.ts b/integration/nevermined/AssetsWithMultipleServices.test.ts index 5e9937f25..ebcc26bad 100644 --- a/integration/nevermined/AssetsWithMultipleServices.test.ts +++ b/integration/nevermined/AssetsWithMultipleServices.test.ts @@ -93,11 +93,11 @@ describe('Assets with multiple services', () => { assert.equal( accessServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], - totalAmount2, + totalAmount1, ) assert.equal( accessServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], - totalAmount1, + totalAmount2, ) const metadata = ddo.findServiceByType('metadata') diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index ae5454874..ba17686f6 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -67,8 +67,6 @@ describe('E2E Flow for NFTs with multiple services', () => { await nevermined.contracts.loadNft721(nftContract.address) - // nftContractOwner = new Account((await nftContract.owner()) as string) - await nftContract.grantOperatorRole( nevermined.keeper.conditions.transferNft721Condition.address, publisher, @@ -128,11 +126,11 @@ describe('E2E Flow for NFTs with multiple services', () => { assert.equal( salesServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], - totalAmount2, + totalAmount1, ) assert.equal( salesServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], - totalAmount1, + totalAmount2, ) assert.isDefined(ddo.findServiceByType('metadata')) diff --git a/package.json b/package.json index c0091434d..e26cf3b49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc0", + "version": "2.0.0-rc1", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", @@ -15,7 +15,7 @@ "test": "mocha --opts test/mocha.opts ./test/**/*.test.ts", "test:watch": "mocha -w --watch-extensions js,ts,json", "test:cover": "nyc --report-dir coverage/unit mocha --opts test/mocha.opts ./test/**/*.test.ts", - "integration": "mocha --opts integration/mocha.opts ./integration/nevermined/*.test.ts", + "integration": "mocha --opts integration/mocha.opts ", "integration:subgraph": "mocha --opts integration/mocha.opts ./integration/**/*.test.subgraph.ts", "integration:production": "export NETWORK_NAME=production; yarn integration", "integration:staging": "export NETWORK_NAME=staging; yarn integration", diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 5c9d62975..e0f1fc534 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -19,7 +19,11 @@ import { DIDRegistry } from '../keeper' import { ethers } from 'ethers' import { AssetPrice, NFTAttributes } from '../models' import { DDOPriceNotFoundError, DDOServiceNotFoundError } from '../errors' -import { DDOConditionNotFoundError, DDOParamNotFoundError } from '../errors/DDOError' +import { + DDOConditionNotFoundError, + DDOParamNotFoundError, + DDOServiceAlreadyExists, +} from '../errors/DDOError' // DDO Services including a sales process export const SALES_SERVICES = ['access', 'compute', 'nft-sales'] @@ -132,7 +136,7 @@ export class DDO { * @param index - index of the service in the DDO. * @returns Service. */ - public findServiceById(index: number): Service { + public findServiceByIndex(index: number): Service { if (isNaN(index)) { throw new Error('index is not set') } @@ -170,7 +174,7 @@ export class DDO { serviceReference: ServiceType | number, ): Service { if (typeof serviceReference === 'number') { - return this.findServiceById(serviceReference) + return this.findServiceByIndex(serviceReference) } else { return this.findServiceByType(serviceReference) as Service } @@ -288,6 +292,13 @@ export class DDO { * @param service */ public addService(service: ServiceCommon) { + const newIndex = + this.service.length > 0 + ? this.service.reduce((a, b) => (a.index > b.index ? a : b)).index + 1 + : 0 + if (this.service.find((s) => s.index === newIndex)) + throw new DDOServiceAlreadyExists(service.type, newIndex) + service.index = newIndex this.service.push(service) } @@ -297,6 +308,8 @@ export class DDO { * @param service */ public replaceService(index: number, service: any) { + if (!this.service.find((s) => s.index === service.index)) + throw new DDOServiceNotFoundError(service.type) this.service[index] = service } @@ -338,6 +351,7 @@ export class DDO { } /** + * @deprecated use the `updateMetadataService` or `replaceService` methods instead * Updates a service in the DDO * @param service the service to be updated * @param serviceIndex the position of the service in the DDO.services array @@ -346,6 +360,19 @@ export class DDO { this.service[serviceIndex] = service } + /** + * Updates a service in the DDO + * @param service the service to be updated + * @param serviceIndex the position of the service in the DDO.services array + */ + public updateMetadataService(service: any) { + const arrayIndex = this.service.findIndex((s) => s.type === 'metadata') + if (arrayIndex < 0) { + throw new DDOServiceNotFoundError('metadata') + } + this.service[arrayIndex] = service + } + /** * Assign a DID to the DDO * @param didSeed DID seed diff --git a/src/errors/DDOError.ts b/src/errors/DDOError.ts index 81db084c8..b4a5e1aed 100644 --- a/src/errors/DDOError.ts +++ b/src/errors/DDOError.ts @@ -20,6 +20,12 @@ export class DDOServiceNotFoundError extends DDOError { } } +export class DDOServiceAlreadyExists extends DDOError { + constructor(serviceType: ServiceType, index: number) { + super(`Service with type "${serviceType}" and index ${index} already exists`) + } +} + export class DDOConditionNotFoundError extends DDOError { constructor(conditionName: string) { super(`Condition with name "${conditionName}" not found`) diff --git a/src/keeper/contracts/conditions/Condition.abstract.ts b/src/keeper/contracts/conditions/Condition.abstract.ts index 63e1ac9c5..a34c8209f 100644 --- a/src/keeper/contracts/conditions/Condition.abstract.ts +++ b/src/keeper/contracts/conditions/Condition.abstract.ts @@ -20,7 +20,7 @@ export interface ConditionContext { service: Service price: AssetPrice creator: string - serviceReference?: number + // serviceReference?: number } export interface ConditionParameters { diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index 9748269cf..a42d18140 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -192,14 +192,14 @@ export abstract class AgreementTemplate extends ContractBase { ddo: DDO, creator: string, parameters: Params, - serviceReference?: number, + serviceIndex?: number, ): Promise> public abstract service(): ServiceType - public standardContext(ddo: DDO, creator: string, serviceReference?: number): ConditionContext { - const service = serviceReference - ? ddo.findServiceById(serviceReference) + public standardContext(ddo: DDO, creator: string, serviceIndex?: number): ConditionContext { + const service = serviceIndex + ? ddo.findServiceByIndex(serviceIndex) : ddo.findServiceByType(this.service()) let rewards try { @@ -207,8 +207,7 @@ export abstract class AgreementTemplate extends ContractBase { } catch (_e) { rewards = undefined } - // const rewards = DDO.getAssetPriceFromService(service) - return { ddo, service, price: rewards, creator, serviceReference } + return { ddo, service, price: rewards, creator } } public async agreementId(agreementIdSeed: string, creator: string): Promise { diff --git a/src/models/AssetAttributes.ts b/src/models/AssetAttributes.ts index 898db7a06..fd6ff6749 100644 --- a/src/models/AssetAttributes.ts +++ b/src/models/AssetAttributes.ts @@ -67,7 +67,6 @@ export class AssetAttributes { fulfillAccessTimelock?: number static defaultValues = { - // price: new AssetPrice().setTokenAddress(process.env.TOKEN_ADDRESS || ZeroAddress), // It means there is no payment required encryptionMethod: AssetAttributes.DEFAULT_ENCRYPTION_METHOD, // The default encryption method for the internal metadata attributes is PSK-RSA services: [ { @@ -75,7 +74,6 @@ export class AssetAttributes { price: new AssetPrice().setTokenAddress(process.env.TOKEN_ADDRESS || ZeroAddress), // It means there is no payment required }, ], // By default it will be added an access service - // serviceTypes: ['access'] as ServiceType[], // By default it will be added an access service predefinedAssetServices: [] as Service[], // By default there in additional services to add to the asset providers: [], // By default there are no addresses registered as providers for the asset appId: '', // No appId by default diff --git a/src/nevermined/api/AssetsApi.ts b/src/nevermined/api/AssetsApi.ts index 95acb0892..dc76d4c96 100644 --- a/src/nevermined/api/AssetsApi.ts +++ b/src/nevermined/api/AssetsApi.ts @@ -214,19 +214,12 @@ export class AssetsApi extends RegistryBaseApi { const { attributes } = ddo.findServiceByType('metadata') let service if (typeof serviceReference === 'number') { - service = ddo.findServiceById(serviceReference) + service = ddo.findServiceByIndex(serviceReference) } else { service = ddo.findServiceByType(serviceReference) } const { files } = attributes.main - // const serviceEndpoint = this.nevermined.services.node.getAccessEndpoint() - // let serviceEndpoint - // if (service.serviceEndpoint) { - // serviceEndpoint = service.serviceEndpoint - // } else { - // serviceEndpoint = this.nevermined.services.node.getAccessEndpoint() - // } const serviceEndpoint = service.serviceEndpoint ? service.serviceEndpoint : this.nevermined.services.node.getAccessEndpoint() diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 6e4aee60e..6312f486e 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -163,7 +163,7 @@ export abstract class RegistryBaseApi extends Instantiable { let serviceEndpoint = this.nevermined.services.metadata.getServiceEndpoint(DID.parse(ddo.id)) - ddo.updateService({ + ddo.updateMetadataService({ type: 'metadata', index: 0, serviceEndpoint, @@ -547,12 +547,6 @@ export abstract class RegistryBaseApi extends Instantiable { const { keeper } = this.nevermined - // let service - // if (typeof serviceReference === 'number') { - // service = ddo.findServiceById(serviceReference) - // } else { - // service = ddo.findServiceByType(serviceReference) - // } const service = ddo.findServiceByReference(serviceReference) const templateName = service.attributes.serviceAgreementTemplate.contractName diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index 89ec9d988..f6ebd0868 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -505,7 +505,7 @@ export class NFT1155Api extends NFTsBaseApi { const did = DDO.getDIDFromService(service) const nftAmount = DDO.getNftAmountFromService(service) const ddo = await this.nevermined.assets.resolve(did) - ddo.updateService(service) + ddo.updateMetadataService(service) const agreementId = await this.nevermined.keeper.agreementStoreManager.agreementId( agreementIdSeed, consumer.getId(), diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index 6dd91164a..4c833309c 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -527,7 +527,7 @@ export class NFT721Api extends NFTsBaseApi { const service = await this.nevermined.services.metadata.retrieveService(agreementIdSeed) const did = DDO.getDIDFromService(service) const ddo = await this.nevermined.assets.resolve(did) - ddo.updateService(service) + ddo.updateMetadataService(service) const agreementId = await this.nevermined.keeper.agreementStoreManager.agreementId( agreementIdSeed, account.getId(), diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 5aa786c7d..19beb0de3 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -330,7 +330,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { const did = DDO.getDIDFromService(service) const ddo = await this.nevermined.assets.resolve(did) - ddo.updateService(service) + ddo.updateMetadataService(service) const agreementId = await nftSalesTemplate.createAgreementFromDDO( agreementIdSeed, From d735c780e4551eedc7e9e00bd0a5dc1db03b36ec Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 14:47:28 +0200 Subject: [PATCH 040/151] chore: adding v2.0.0-rc1 Changelog updates --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a0a7f901..d53cc5b4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc1](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc0...v2.0.0-rc1) + +> 25 July 2023 + +- Feat/ethers v6 [`#556`](https://github.com/nevermined-io/sdk-js/pull/556) +- feat: support for multiple services of the same type [`240cca6`](https://github.com/nevermined-io/sdk-js/commit/240cca68afdfe264aaf006d76cc0aa4cec0097be) +- feat: allow the registration of multiple services of the same type [`ad2d1b4`](https://github.com/nevermined-io/sdk-js/commit/ad2d1b4eb25772a589fb4cd0ab26007bbc7af74a) +- ci: multiple services tests [`afe27c3`](https://github.com/nevermined-io/sdk-js/commit/afe27c3a649b30a9f9e2f75ec6ed566630ac87d0) + #### [v2.0.0-rc0](https://github.com/nevermined-io/sdk-js/compare/v1.13.16...v2.0.0-rc0) > 20 July 2023 @@ -339,7 +348,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384) - linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4) -### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) +#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) > 14 February 2023 From a3ed88895bb053852c400548230ae7e8eb385a57 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:08:41 +0200 Subject: [PATCH 041/151] ci: testing with latest node --- .github/workflows/testing-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 8d3a34927..2e1833bd7 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -16,7 +16,7 @@ jobs: repository: nevermined-io/node path: node # TODO: replace this with develop once https://github.com/nevermined-io/node/pull/212 is merged - ref: feat/sdk-2.0.0-rc0 + ref: feat/sdk_v2.0.0-rc1 token: ${{ secrets.API_TOKEN_GITHUB }} - uses: nevermined-io/nvm-tools-actions@v0.12.0 with: From 3d45ff92801ff2cbe8a4372ff28be00148cd6fde Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 18:04:18 +0200 Subject: [PATCH 042/151] test: fixing problem with nft amounts --- integration/nevermined/DDO.test.ts | 4 ++-- integration/nevermined/NFT1155.test.ts | 4 ++-- integration/nevermined/NFT1155Api.e2e.test.ts | 4 ++-- integration/nevermined/NFTTemplates.test.ts | 10 +++++----- .../nevermined/NFTTemplatesWithEther.test.ts | 4 ++-- .../nevermined/NFTsWithMultipleServices.test.ts | 16 ++++++++++++++-- integration/nevermined/SecondaryMarket.test.ts | 4 ++-- package.json | 2 +- .../contracts/templates/BaseTemplate.abstract.ts | 2 +- src/models/NFTAttributes.ts | 7 ++++--- src/utils/DDOHelpers.ts | 4 ++-- 11 files changed, 37 insertions(+), 24 deletions(-) diff --git a/integration/nevermined/DDO.test.ts b/integration/nevermined/DDO.test.ts index d7c47910e..123bb44e7 100644 --- a/integration/nevermined/DDO.test.ts +++ b/integration/nevermined/DDO.test.ts @@ -149,11 +149,11 @@ describe('DDO Tests', () => { { serviceType: 'nft-sales', price, - nft: { amount: 1n }, + nft: { nftAmount: 1n }, }, { serviceType: 'nft-access', - nft: { amount: 1n }, + nft: { nftAmount: 1n }, }, ], providers: [config.neverminedNodeAddress], diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 4b6bb69b6..70cdcf615 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -110,11 +110,11 @@ describe('NFT1155 End-to-End', () => { { serviceType: 'nft-sales', price: assetPrice, - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, ], }) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 8d8f5a164..dde8cb1a7 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -156,11 +156,11 @@ function makeTest(isCustom) { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberEditions }, + nft: { nftAmount: numberEditions }, }, { serviceType: 'nft-access', - nft: { amount: numberEditions }, + nft: { nftAmount: numberEditions }, }, ], providers: [config.neverminedNodeAddress], diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index e79974aee..461190609 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -173,11 +173,11 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, ], }) @@ -627,11 +627,11 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, ], }) @@ -938,7 +938,7 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, { serviceType: 'nft-access', diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index 1166b9cc1..26a85be6b 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -165,11 +165,11 @@ describe('NFTTemplates With Ether E2E', async () => { { serviceType: 'nft-sales', price: assetPrice, - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, ], }) diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index ba17686f6..86f4fcec6 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -13,6 +13,7 @@ import { Nft721Contract, NFTAttributes, ConditionState, + NFTServiceAttributes, } from '../../src' import { ethers } from 'ethers' import { repeat } from '../utils/utils' @@ -98,12 +99,12 @@ describe('E2E Flow for NFTs with multiple services', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { nftTransfer: true }, + nft: { ...NFTServiceAttributes.defaultValues, nftTransfer: true }, }, { serviceType: 'nft-sales', price: assetPrice2, - nft: { nftTransfer: false }, + nft: { nftTransfer: false, nftAmount: 2n }, }, { serviceType: 'nft-access', @@ -128,10 +129,21 @@ describe('E2E Flow for NFTs with multiple services', () => { salesServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], totalAmount1, ) + assert.equal( + salesServices[0].attributes.serviceAgreementTemplate.conditions[1].parameters[2] + .value as string, + '1', + ) + assert.equal( salesServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], totalAmount2, ) + assert.equal( + salesServices[1].attributes.serviceAgreementTemplate.conditions[1].parameters[2] + .value as string, + '2', + ) assert.isDefined(ddo.findServiceByType('metadata')) }) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index 5ae9ccf5f..6987c755f 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -179,11 +179,11 @@ describe('Secondary Markets', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { amount: numberNFTs }, + nft: { nftAmount: numberNFTs }, }, ], }) diff --git a/package.json b/package.json index e26cf3b49..46763f453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc1", + "version": "2.0.0-rc2", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index ea23bf3b1..5b7804fa5 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -55,7 +55,7 @@ export abstract class BaseTemplate tokenAddress, nftAttributes?.nftContractAddress, publisher.getId(), - assetPrice ? assetPrice.getTotalPrice() : 0n, + serviceAttributes?.nft?.nftAmount, serviceAttributes?.nft?.nftTransfer, serviceAttributes?.nft?.duration, nftAttributes?.fulfillAccessTimeout, diff --git a/src/models/NFTAttributes.ts b/src/models/NFTAttributes.ts index cd8b89827..1753fa411 100644 --- a/src/models/NFTAttributes.ts +++ b/src/models/NFTAttributes.ts @@ -22,17 +22,17 @@ export class NFTServiceAttributes { /** * Number of editions */ - amount?: bigint + nftAmount?: bigint static defaultValues = { serviceType: 'nft-access' as ServiceType, nftTransfer: true, // The NFT will use transfers isSubscription: false, // By default the asset doesn't represent a subscription duration: 0, // Because it's not a subscription it doesn't have a duration - amount: 1n, // By default just one edition + nftAmount: 1n, // By default just one edition } - public static getDefaultNFTServiceAttributes(): NFTServiceAttributes { + public static getDefaultNFTServiceAttributes(): Required { return { ...NFTServiceAttributes.defaultValues, } @@ -81,6 +81,7 @@ export class NFTAttributes extends AssetAttributes { static defaultValues = { ...AssetAttributes.defaultValues, + nft: NFTServiceAttributes.defaultValues, royaltyAttributes: undefined, preMint: true, // It means the NFT will mint all the editions defined in the `amount` attributed during the registration nftMetadataUrl: '', // Url to the metadata describing the NFT OpenSea style diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index c048945bb..336a17b38 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -31,7 +31,7 @@ export function getConditionsByParams( erc20TokenContract?: string, nftTokenContract?: string, nftHolder?: string, - nftAmount?: bigint, + nftAmount = 1n, nftTransfer = false, duration = 0, fulfillAccessTimeout = 0, @@ -96,7 +96,7 @@ function getParameter( case 'rewardAddress': return owner case 'numberNfts': - return String(nftAmount) + return nftAmount && nftAmount >= 1 ? String(nftAmount) : '1' case 'tokenAddress': return erc20TokenContract case 'contract': From f6928591032435692fe1b1c514b947fc8152a4a9 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 18:06:24 +0200 Subject: [PATCH 043/151] ci: using node from develop --- .github/workflows/testing-node.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 2e1833bd7..b9f99ace6 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -15,8 +15,8 @@ jobs: with: repository: nevermined-io/node path: node - # TODO: replace this with develop once https://github.com/nevermined-io/node/pull/212 is merged - ref: feat/sdk_v2.0.0-rc1 + # TODO: remove this when Node integrated with SDKv2 is integraged + ref: develop token: ${{ secrets.API_TOKEN_GITHUB }} - uses: nevermined-io/nvm-tools-actions@v0.12.0 with: From b43378856afe56af7b355a0ffadf77bd2b69226f Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 18:36:30 +0200 Subject: [PATCH 044/151] test: adjusting attributes --- test/keeper/conditions/NFTLockCondition.test.ts | 16 ++++++++-------- .../conditions/TransferNFTCondition.test.ts | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/keeper/conditions/NFTLockCondition.test.ts b/test/keeper/conditions/NFTLockCondition.test.ts index 75f35e01a..6b28ec07c 100644 --- a/test/keeper/conditions/NFTLockCondition.test.ts +++ b/test/keeper/conditions/NFTLockCondition.test.ts @@ -81,11 +81,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { amount }, + nft: { nftAmount: amount }, }, { serviceType: 'nft-access', - nft: { amount }, + nft: { nftAmount: amount }, }, ], preMint: true, @@ -147,11 +147,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { amount }, + nft: { nftAmount: amount }, }, { serviceType: 'nft-access', - nft: { amount }, + nft: { nftAmount: amount }, }, ], preMint: true, @@ -188,11 +188,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { amount }, + nft: { nftAmount: amount }, }, { serviceType: 'nft-access', - nft: { amount }, + nft: { nftAmount: amount }, }, ], preMint: false, @@ -234,11 +234,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { amount }, + nft: { nftAmount: amount }, }, { serviceType: 'nft-access', - nft: { amount }, + nft: { nftAmount: amount }, }, ], preMint: true, diff --git a/test/keeper/conditions/TransferNFTCondition.test.ts b/test/keeper/conditions/TransferNFTCondition.test.ts index c575518de..6be40ae60 100644 --- a/test/keeper/conditions/TransferNFTCondition.test.ts +++ b/test/keeper/conditions/TransferNFTCondition.test.ts @@ -129,11 +129,11 @@ describe('TransferNFTCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { amount: nftAmount }, + nft: { nftAmount }, }, { serviceType: 'nft-access', - nft: { amount: nftAmount }, + nft: { nftAmount }, }, ], preMint: false, @@ -233,11 +233,11 @@ describe('TransferNFTCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { amount: nftAmount }, + nft: { nftAmount }, }, { serviceType: 'nft-access', - nft: { amount: nftAmount }, + nft: { nftAmount }, }, ], preMint: false, @@ -336,11 +336,11 @@ describe('TransferNFTCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { amount: nftAmount }, + nft: { nftAmount }, }, { serviceType: 'nft-access', - nft: { amount: nftAmount }, + nft: { nftAmount }, }, ], preMint: false, From 941f96f485fee18398fe7e1517e8a43e85361754 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 25 Jul 2023 19:32:07 +0200 Subject: [PATCH 045/151] chore: coming back to original attribute name --- integration/nevermined/DDO.test.ts | 4 ++-- integration/nevermined/NFT1155.test.ts | 4 ++-- integration/nevermined/NFT1155Api.e2e.test.ts | 4 ++-- integration/nevermined/NFTTemplates.test.ts | 10 +++++----- .../nevermined/NFTTemplatesWithEther.test.ts | 4 ++-- .../nevermined/NFTsWithMultipleServices.test.ts | 2 +- integration/nevermined/SecondaryMarket.test.ts | 4 ++-- .../contracts/templates/BaseTemplate.abstract.ts | 2 +- src/models/NFTAttributes.ts | 4 ++-- test/keeper/conditions/NFTLockCondition.test.ts | 16 ++++++++-------- .../conditions/TransferNFTCondition.test.ts | 12 ++++++------ 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/integration/nevermined/DDO.test.ts b/integration/nevermined/DDO.test.ts index 123bb44e7..d7c47910e 100644 --- a/integration/nevermined/DDO.test.ts +++ b/integration/nevermined/DDO.test.ts @@ -149,11 +149,11 @@ describe('DDO Tests', () => { { serviceType: 'nft-sales', price, - nft: { nftAmount: 1n }, + nft: { amount: 1n }, }, { serviceType: 'nft-access', - nft: { nftAmount: 1n }, + nft: { amount: 1n }, }, ], providers: [config.neverminedNodeAddress], diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 70cdcf615..4b6bb69b6 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -110,11 +110,11 @@ describe('NFT1155 End-to-End', () => { { serviceType: 'nft-sales', price: assetPrice, - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, ], }) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index dde8cb1a7..8d8f5a164 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -156,11 +156,11 @@ function makeTest(isCustom) { { serviceType: 'nft-sales', price: assetPrice1, - nft: { nftAmount: numberEditions }, + nft: { amount: numberEditions }, }, { serviceType: 'nft-access', - nft: { nftAmount: numberEditions }, + nft: { amount: numberEditions }, }, ], providers: [config.neverminedNodeAddress], diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index 461190609..e79974aee 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -173,11 +173,11 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, ], }) @@ -627,11 +627,11 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, ], }) @@ -938,7 +938,7 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index 26a85be6b..1166b9cc1 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -165,11 +165,11 @@ describe('NFTTemplates With Ether E2E', async () => { { serviceType: 'nft-sales', price: assetPrice, - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, ], }) diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index 86f4fcec6..1bea1305e 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -104,7 +104,7 @@ describe('E2E Flow for NFTs with multiple services', () => { { serviceType: 'nft-sales', price: assetPrice2, - nft: { nftTransfer: false, nftAmount: 2n }, + nft: { nftTransfer: false, amount: 2n }, }, { serviceType: 'nft-access', diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index 6987c755f..5ae9ccf5f 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -179,11 +179,11 @@ describe('Secondary Markets', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, { serviceType: 'nft-access', - nft: { nftAmount: numberNFTs }, + nft: { amount: numberNFTs }, }, ], }) diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 5b7804fa5..1583cc005 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -55,7 +55,7 @@ export abstract class BaseTemplate tokenAddress, nftAttributes?.nftContractAddress, publisher.getId(), - serviceAttributes?.nft?.nftAmount, + serviceAttributes?.nft?.amount, serviceAttributes?.nft?.nftTransfer, serviceAttributes?.nft?.duration, nftAttributes?.fulfillAccessTimeout, diff --git a/src/models/NFTAttributes.ts b/src/models/NFTAttributes.ts index 1753fa411..fb00a2b73 100644 --- a/src/models/NFTAttributes.ts +++ b/src/models/NFTAttributes.ts @@ -22,14 +22,14 @@ export class NFTServiceAttributes { /** * Number of editions */ - nftAmount?: bigint + amount?: bigint static defaultValues = { serviceType: 'nft-access' as ServiceType, nftTransfer: true, // The NFT will use transfers isSubscription: false, // By default the asset doesn't represent a subscription duration: 0, // Because it's not a subscription it doesn't have a duration - nftAmount: 1n, // By default just one edition + amount: 1n, // By default just one edition } public static getDefaultNFTServiceAttributes(): Required { diff --git a/test/keeper/conditions/NFTLockCondition.test.ts b/test/keeper/conditions/NFTLockCondition.test.ts index 6b28ec07c..75f35e01a 100644 --- a/test/keeper/conditions/NFTLockCondition.test.ts +++ b/test/keeper/conditions/NFTLockCondition.test.ts @@ -81,11 +81,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { nftAmount: amount }, + nft: { amount }, }, { serviceType: 'nft-access', - nft: { nftAmount: amount }, + nft: { amount }, }, ], preMint: true, @@ -147,11 +147,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { nftAmount: amount }, + nft: { amount }, }, { serviceType: 'nft-access', - nft: { nftAmount: amount }, + nft: { amount }, }, ], preMint: true, @@ -188,11 +188,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { nftAmount: amount }, + nft: { amount }, }, { serviceType: 'nft-access', - nft: { nftAmount: amount }, + nft: { amount }, }, ], preMint: false, @@ -234,11 +234,11 @@ describe('NFTLockCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { nftAmount: amount }, + nft: { amount }, }, { serviceType: 'nft-access', - nft: { nftAmount: amount }, + nft: { amount }, }, ], preMint: true, diff --git a/test/keeper/conditions/TransferNFTCondition.test.ts b/test/keeper/conditions/TransferNFTCondition.test.ts index 6be40ae60..c575518de 100644 --- a/test/keeper/conditions/TransferNFTCondition.test.ts +++ b/test/keeper/conditions/TransferNFTCondition.test.ts @@ -129,11 +129,11 @@ describe('TransferNFTCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { nftAmount }, + nft: { amount: nftAmount }, }, { serviceType: 'nft-access', - nft: { nftAmount }, + nft: { amount: nftAmount }, }, ], preMint: false, @@ -233,11 +233,11 @@ describe('TransferNFTCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { nftAmount }, + nft: { amount: nftAmount }, }, { serviceType: 'nft-access', - nft: { nftAmount }, + nft: { amount: nftAmount }, }, ], preMint: false, @@ -336,11 +336,11 @@ describe('TransferNFTCondition', () => { services: [ { serviceType: 'nft-sales', - nft: { nftAmount }, + nft: { amount: nftAmount }, }, { serviceType: 'nft-access', - nft: { nftAmount }, + nft: { amount: nftAmount }, }, ], preMint: false, From 8a04a81a84c2f464309aaa29e89b29c5558cbc27 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 26 Jul 2023 13:30:02 +0200 Subject: [PATCH 046/151] feat: reduce number of calls to chainId - updated to ethers v6.6.5 --- package.json | 4 ++-- src/Instantiable.abstract.ts | 10 +++++----- src/keeper/Web3Provider.ts | 28 +++++++++++++++++++++++++--- src/nevermined/Nevermined.ts | 2 +- test/keeper/ContractEvent.test.ts | 5 ++--- test/keeper/DIDRegistry.test.ts | 2 +- test/keeper/TestContractHandler.ts | 8 ++++---- 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 46763f453..74c957c53 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "test": "mocha --opts test/mocha.opts ./test/**/*.test.ts", "test:watch": "mocha -w --watch-extensions js,ts,json", "test:cover": "nyc --report-dir coverage/unit mocha --opts test/mocha.opts ./test/**/*.test.ts", - "integration": "mocha --opts integration/mocha.opts ", + "integration": "mocha --opts integration/mocha.opts ./integration/nevermined/*.test.ts", "integration:subgraph": "mocha --opts integration/mocha.opts ./integration/**/*.test.subgraph.ts", "integration:production": "export NETWORK_NAME=production; yarn integration", "integration:staging": "export NETWORK_NAME=staging; yarn integration", @@ -66,7 +66,7 @@ "cross-fetch": "^4.0.0", "crypto-browserify": "^3.12.0", "deprecated-decorator": "^0.1.6", - "ethers": "^6.6.4", + "ethers": "^6.6.5", "graphql": "^16.7.1", "https-browserify": "^1.0.0", "jose": "^4.5.1", diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index bd31e7341..081489615 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -13,9 +13,9 @@ export interface InstantiableConfig { circuitsFolder?: string } -export function generateIntantiableConfigFromConfig( +export async function generateIntantiableConfigFromConfig( config: NeverminedOptions, -): Partial { +): Promise> { const logLevel = typeof config.verbose !== 'number' ? config.verbose @@ -24,7 +24,7 @@ export function generateIntantiableConfigFromConfig( : (config.verbose as LogLevel) return { config, - web3: Web3Provider.getWeb3(config), + web3: await Web3Provider.getWeb3(config), logger: new Logger(logLevel), artifactsFolder: config.artifactsFolder, circuitsFolder: config.circuitsFolder, @@ -41,8 +41,8 @@ export abstract class Instantiable { public get web3() { if (!this._instantiableConfig?.web3) { - this.logger.warn('ethers.Provider instance is not defined. Using default instance.') - return Web3Provider.getWeb3() + this.logger.error('Web3 Provider not initialized') + throw new Error('Web3 Provider not initialized') } return this._instantiableConfig.web3 } diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index 940a161bd..7d47af483 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -7,15 +7,37 @@ export class Web3Provider { * * @returns web3 instance */ - public static getWeb3( + public static async getWeb3( config: Partial = {}, - ): ethers.JsonRpcProvider | ethers.BrowserProvider { + ): Promise { if (config.web3Provider) { return new ethers.BrowserProvider(config.web3Provider) } // disabling the cache since this will lead to duplicated nonces on test networks // See https://docs.ethers.org/v6/api/providers/abstract-provider/#AbstractProviderOptions - return new ethers.JsonRpcProvider(config.web3ProviderUri, undefined, { cacheTimeout: -1 }) + let provider = new ethers.JsonRpcProvider(config.web3ProviderUri, undefined, { + cacheTimeout: -1, + }) + + // Adding the static network prevents ethers from calling eth_chainId with every call + const network = await provider.getNetwork() + console.log('network', network.chainId, network.name) + provider = new ethers.JsonRpcProvider(config.web3ProviderUri, undefined, { + cacheTimeout: -1, + staticNetwork: network, + }) + + // provider.addListener('debug', (event) => { + // if (event.payload) { + // if (Array.isArray(event.payload)) { + // console.log(event.payload.map((e) => e.method)) + // } else { + // console.log(event.payload.method) + // } + // } + // }) + + return provider } } diff --git a/src/nevermined/Nevermined.ts b/src/nevermined/Nevermined.ts index bd9c131dc..8ef493cd0 100644 --- a/src/nevermined/Nevermined.ts +++ b/src/nevermined/Nevermined.ts @@ -35,7 +35,7 @@ export class Nevermined extends Instantiable { const instance = new Nevermined() const instanceConfig = { - ...generateIntantiableConfigFromConfig(config), + ...(await generateIntantiableConfigFromConfig(config)), nevermined: instance, } instance.setInstanceConfig(instanceConfig) diff --git a/test/keeper/ContractEvent.test.ts b/test/keeper/ContractEvent.test.ts index fcad599b9..b87da4333 100644 --- a/test/keeper/ContractEvent.test.ts +++ b/test/keeper/ContractEvent.test.ts @@ -7,8 +7,7 @@ import { Account } from '../../src' import { Web3Provider } from '../../src/keeper' import { ethers } from 'ethers' -// Skipping this test until https://github.com/nevermined-io/sdk-js/issues/558 -describe.skip('ContractEvent', () => { +describe('ContractEvent', () => { let nevermined: Nevermined let account1: Account let account2: Account @@ -19,7 +18,7 @@ describe.skip('ContractEvent', () => { before(async () => { await TestContractHandler.prepareContracts() nevermined = await Nevermined.getInstance(config) - web3 = Web3Provider.getWeb3(config) + web3 = await Web3Provider.getWeb3(config) ;[account1, account2, account3, account4] = await nevermined.accounts.list() }) diff --git a/test/keeper/DIDRegistry.test.ts b/test/keeper/DIDRegistry.test.ts index c1b135b28..926b2f23d 100644 --- a/test/keeper/DIDRegistry.test.ts +++ b/test/keeper/DIDRegistry.test.ts @@ -42,7 +42,7 @@ describe('DIDRegistry', () => { const [ownerAccount] = await nevermined.accounts.list() const did = generateId() const data = 'hola hola' - const provider = Web3Provider.getWeb3(config) + const provider = await Web3Provider.getWeb3(config) const txCount = await provider.getTransactionCount(ownerAccount.getId(), 'pending') const txParams: TxParameters = { nonce: txCount } diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index 2fda8ab73..ee3df775b 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -10,7 +10,7 @@ import { NeverminedOptions } from '../../src' export default abstract class TestContractHandler extends ContractHandler { public static async prepareContracts(): Promise { - TestContractHandler.setConfig(config) + await TestContractHandler.setConfig(config) const [deployerAddress] = await TestContractHandler.addresses(TestContractHandler.config) TestContractHandler.networkId = Number((await TestContractHandler.web3.getNetwork()).chainId) @@ -24,11 +24,11 @@ export default abstract class TestContractHandler extends ContractHandler { private static networkId: number private static minter: string private static config = config - private static web3 = Web3Provider.getWeb3(config) + private static web3: ethers.JsonRpcProvider | ethers.BrowserProvider - public static setConfig(config) { + public static async setConfig(config) { TestContractHandler.config = config - TestContractHandler.web3 = Web3Provider.getWeb3(TestContractHandler.config) + TestContractHandler.web3 = await Web3Provider.getWeb3(TestContractHandler.config) } private static async deployContracts(deployerAddress: string) { From 89511f11140398c146246a19438e958938b83376 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 26 Jul 2023 15:51:55 +0200 Subject: [PATCH 047/151] feat: make keeper network info static --- MIGRATION_GUIDE.md | 16 +++++ integration/nevermined/Artifacts.test.ts | 6 +- integration/nevermined/Assets.test.ts | 2 +- .../ClaimPaymentAbortedAgreement.test.ts | 2 +- integration/nevermined/NFT1155.test.ts | 2 +- integration/nevermined/NFT1155Api.e2e.test.ts | 4 +- integration/nevermined/NFT721.test.ts | 2 +- integration/nevermined/NFT721Api.e2e.test.ts | 2 +- .../nevermined/NFT721Templates.test.ts | 4 +- .../NFTsWithMultipleServices.test.ts | 2 +- src/events/ContractEvent.ts | 2 +- src/keeper/ContractHandler.ts | 16 ++--- src/keeper/Keeper.ts | 58 ++++++++----------- src/keeper/contracts/ContractBase.ts | 2 +- src/keeper/contracts/Nft1155Contract.ts | 2 +- src/keeper/contracts/Nft721Contract.ts | 2 +- src/keeper/utils.ts | 18 +++--- src/nevermined/Versions.ts | 6 +- src/nevermined/api/RegistryBaseApi.ts | 2 +- src/nevermined/utils/JwtUtils.ts | 2 +- test/keeper/ContractHandler.test.ts | 2 +- test/keeper/Keeper.test.ts | 2 +- .../conditions/NFT721LockCondition.test.ts | 2 +- 23 files changed, 82 insertions(+), 76 deletions(-) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 4e692acb1..a3d73611f 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -2,6 +2,22 @@ ## Breaking changes +### Keeper Network info + +`Keeper.version`, `Keeper.getNetworkId()`, `Keeper.getNetworkName()` are removed and instead the network information is static and set during Keeper initialization: + +```ts +// v1 +const chainId = await nevermined.keeper.getNetworkId() +const networkName = await nevermined.keeper.getNetworkName() +const version = nevermined.keeper.version + +// v2 +const chainId = nevermined.network.chainId +const networkName = nevermined.keeper.network.name +const version = nevermined.keeper.network.version +``` + ### Defining Asset Price The assetPrice is not part of AssetAttributes anymore and is part of each individual service added to the DDO when registering a service. So for services having a price, this must be added as part of the services array of the AssetAttributes. diff --git a/integration/nevermined/Artifacts.test.ts b/integration/nevermined/Artifacts.test.ts index 45cca7815..f405dca4b 100644 --- a/integration/nevermined/Artifacts.test.ts +++ b/integration/nevermined/Artifacts.test.ts @@ -44,12 +44,12 @@ describe('Artifacts', () => { artifactsFolder: tempDir, } as NeverminedOptions) - assert.equal(networkId[0], await nvm.keeper.getNetworkId()) + assert.equal(networkId[0], nvm.keeper.network.chainId) assert.isDefined(nvm) assert.isDefined(nvm.keeper) assert.isDefined(nvm.keeper.didRegistry) - assert.oneOf((await nvm.keeper.getNetworkName()).toLowerCase(), networkName) - assert.oneOf(await nvm.keeper.getNetworkId(), networkId) + assert.oneOf(nvm.keeper.network.name, networkName) + assert.oneOf(nvm.keeper.network.chainId, networkId) }) } }) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index cd646ad75..a73f0275d 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -70,7 +70,7 @@ describe('Assets', () => { assert.equal(ddo._nvm.versions[0].immutableBackend, 'ipfs') assert.equal(Object.keys(ddo._nvm.networks).length, 1) - assert.equal(ddo._nvm.networks[await nevermined.keeper.getNetworkId()], true) + assert.equal(ddo._nvm.networks[nevermined.keeper.network.chainId], true) const metadata = ddo.findServiceByType('metadata') assert.equal(metadata.attributes.main.ercType, 721) diff --git a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts index 910971e11..9f3214e1b 100644 --- a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts +++ b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts @@ -50,7 +50,7 @@ describe('Claim aborted agreements End-to-End', () => { nevermined = await Nevermined.getInstance(config) ;[, publisher, collector1, , other] = await nevermined.accounts.list() - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 4b6bb69b6..9252d45aa 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -68,7 +68,7 @@ describe('NFT1155 End-to-End', () => { describe('As user I can deploy Nevermined ERC-1155 NFT contract instances', () => { it('Using the ABI', async () => { - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc1155ABI = await ContractHandler.getABI( 'NFT1155Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 8d8f5a164..388255176 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -86,7 +86,7 @@ function makeTest(isCustom) { ) if (isCustom) { - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc1155ABI = await ContractHandler.getABI( 'NFT1155Upgradeable', config.artifactsFolder, @@ -468,7 +468,7 @@ function makeTest(isCustom) { describe('Node should not be able to transfer the nft without the operator role', () => { it('should create the subscription NFT without granting Nevermined the operator role', async () => { - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc1155ABI = await ContractHandler.getABI( 'NFT1155Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT721.test.ts b/integration/nevermined/NFT721.test.ts index 8baeb4a18..f25e8f9a7 100644 --- a/integration/nevermined/NFT721.test.ts +++ b/integration/nevermined/NFT721.test.ts @@ -29,7 +29,7 @@ describe('Nfts721 operations', async () => { // Accounts ;[deployer, artist, collector] = await nevermined.accounts.list() - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index f182f158d..d91254c1e 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -47,7 +47,7 @@ describe('NFTs721 Api End-to-End', () => { nevermined = await Nevermined.getInstance(config) ;[, artist, collector1, , gallery] = await nevermined.accounts.list() - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 3cdb1fc19..88a442544 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -90,7 +90,7 @@ describe('NFT721Templates E2E', () => { nevermined = await Nevermined.getInstance(config) ;[owner, artist, collector1, collector2, gallery] = await nevermined.accounts.list() - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, @@ -609,7 +609,7 @@ describe('NFT721Templates E2E', () => { collector2.getId(), ) - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index 1bea1305e..da1feb548 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -45,7 +45,7 @@ describe('E2E Flow for NFTs with multiple services', () => { neverminedNodeAddress = await nevermined.services.node.getProviderAddress() - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/src/events/ContractEvent.ts b/src/events/ContractEvent.ts index eea0b2e15..17cff5db1 100644 --- a/src/events/ContractEvent.ts +++ b/src/events/ContractEvent.ts @@ -34,7 +34,7 @@ export class ContractEvent extends NeverminedEvent { public async getPastEvents(options: EventOptions): EventResult { try { - const chainId = await this.nevermined.keeper.getNetworkId() + const chainId = this.nevermined.keeper.network.chainId options.fromBlock = 0 options.toBlock = 'latest' diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index d31ca1932..9b459963a 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -55,13 +55,13 @@ export class ContractHandler extends Instantiable { artifactsFolder: string, address?: string, ): Promise { - const networkId = await this.nevermined.keeper.getNetworkId() - const where = (await this.nevermined.keeper.getNetworkName()).toLowerCase() + const chainId = this.nevermined.keeper.network.chainId + const where = this.nevermined.keeper.network.name try { this.logger.debug(`ContractHandler :: get :: ${artifactsFolder} and address ${address}`) return ( - ContractHandler.getContract(what, networkId, address) || - (await this.load(what, where, networkId, artifactsFolder, address)) + ContractHandler.getContract(what, chainId, address) || + (await this.load(what, where, chainId, artifactsFolder, address)) ) } catch (err) { if (!optional) { @@ -98,7 +98,7 @@ export class ContractHandler extends Instantiable { } public async getVersion(contractName: string, artifactsFolder: string): Promise { - const where = (await this.nevermined.keeper.getNetworkName()).toLowerCase() + const where = this.nevermined.keeper.network.name let artifact this.logger.debug( `ContractHandler :: getVersion :: Trying to read ${artifactsFolder}/${contractName}.${where}.json`, @@ -257,9 +257,9 @@ export class ContractHandler extends Instantiable { public async getFeeData(gasPrice?: bigint, maxFeePerGas?: bigint, maxPriorityFeePerGas?: bigint) { // Custom gas fee for polygon networks - const networkId = await this.nevermined.keeper.getNetworkId() - if (networkId === 137 || networkId === 80001) { - return this.getFeeDataPolygon(networkId) + const chainId = this.nevermined.keeper.network.chainId + if (chainId === 137 || chainId === 80001) { + return this.getFeeDataPolygon(chainId) } const feeData = await this.web3.getFeeData() diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index 9b50a9576..d601a0b9b 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -150,7 +150,7 @@ export class Keeper extends Instantiable { } catch (err) { this.connected = false throw new KeeperError( - `Keeper could not connect to ${await this.getNetworkName()} - ${err.message} ${err.stack}`, + `Keeper could not connect to ${this.network.name} - ${err.message} ${err.stack}`, ) } @@ -226,7 +226,13 @@ export class Keeper extends Instantiable { eventHandler: new EventHandler(), } // version - this.version = this.didRegistry.version.replace('v', '') + const chainId = Number((await this.web3.getNetwork()).chainId) + this.network = { + chainId, + version: this.didRegistry.version.replace('v', ''), + name: await KeeperUtils.getNetworkName(chainId), + loading: false, + } } /** @@ -328,16 +334,25 @@ export class Keeper extends Instantiable { eventHandler: EventHandler } - /** - * Version of the artifacts in use - */ - public version: string - /** * Network id loaded from web3 */ - protected network: { - id?: number + public network: { + /** + * chainId of the network + */ + chainId?: number + /** + * Name of the network + */ + name?: string + /** + * Version of the artifacts in use + */ + version?: string + /** + * True if keeper is still connecting + */ loading: boolean } = { loading: true, @@ -381,31 +396,6 @@ export class Keeper extends Instantiable { return Object.values(this.templates).find((template) => template.address === address) } - /** - * Returns the network by name. - * @returns Network name. - */ - public async getNetworkName(): Promise { - return KeeperUtils.getNetworkName(await this.getNetworkId()) - } - - /** - * Returns the id of the network. - * @returns Network ID. - */ - public async getNetworkId(): Promise { - if (this.network.loading) { - this.network.loading = false - this.network.id = Number((await this.web3.getNetwork()).chainId) - } - - while (!this.network.id) { - await new Promise((resolve) => setTimeout(resolve, 1)) - } - - return this.network.id - } - public getAllInstances() { return this.instances } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 460095c49..c061d610c 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -67,7 +67,7 @@ export abstract class ContractBase extends Instantiable { this, eventEmitter, this.config.graphHttpUri, - await this.nevermined.keeper.getNetworkName(), + this.nevermined.keeper.network.name, ) } else { this.events = ContractEvent.getInstance(this, eventEmitter, config.nevermined, this.web3) diff --git a/src/keeper/contracts/Nft1155Contract.ts b/src/keeper/contracts/Nft1155Contract.ts index e4c24440d..2a3c172a7 100644 --- a/src/keeper/contracts/Nft1155Contract.ts +++ b/src/keeper/contracts/Nft1155Contract.ts @@ -20,7 +20,7 @@ export class Nft1155Contract extends NFTContractsBase { await nft.init(config) if (address) { - const networkName = (await nft.nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nft.nevermined.keeper.network.name const solidityABI = await ContractHandler.getABI(contractName, artifactsFolder, networkName) await new ContractHandler(config).checkExists(address) diff --git a/src/keeper/contracts/Nft721Contract.ts b/src/keeper/contracts/Nft721Contract.ts index 8d7410bf7..0cba341b6 100644 --- a/src/keeper/contracts/Nft721Contract.ts +++ b/src/keeper/contracts/Nft721Contract.ts @@ -16,7 +16,7 @@ export class Nft721Contract extends NFTContractsBase { ): Promise { const nft: Nft721Contract = new Nft721Contract(contractName) nft.setInstanceConfig(config) - const networkName = (await nft.nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nft.nevermined.keeper.network.name // We don't have a subgraph for NFT721 so we can only use ContractEvent const eventEmitter = new EventHandler() diff --git a/src/keeper/utils.ts b/src/keeper/utils.ts index d927e6984..ff33a2ec3 100644 --- a/src/keeper/utils.ts +++ b/src/keeper/utils.ts @@ -4,23 +4,23 @@ import { KeeperError } from '../errors' export async function getNetworkName(networkId: number): Promise { switch (networkId) { case 1: - return 'Mainnet' + return 'mainnet' case 2: - return 'Morden' + return 'morden' case 3: - return 'Ropsten' + return 'ropsten' case 4: - return 'Rinkeby' + return 'rinkeby' case 5: - return 'Goerli' + return 'goerli' case 77: - return 'POA_Sokol' + return 'poa_sokol' case 99: - return 'POA_Core' + return 'poa_core' case 42: - return 'Kovan' + return 'kovan' case 100: - return 'Gnosis' + return 'gnosis' case 137: return 'matic' case 1337: diff --git a/src/nevermined/Versions.ts b/src/nevermined/Versions.ts index ac3c7ab19..c3c19e94a 100644 --- a/src/nevermined/Versions.ts +++ b/src/nevermined/Versions.ts @@ -57,9 +57,9 @@ export class Versions extends Instantiable { version: metadata.version, commit: metadata.commit, status: PlatformTechStatus.Working, - network: (await this.nevermined.keeper.getNetworkName()).toLowerCase(), - keeperVersion: this.nevermined.keeper.version, - contracts: Object.values(await this.nevermined.keeper.getAllInstances()) + network: this.nevermined.keeper.network.name, + keeperVersion: this.nevermined.keeper.network.version, + contracts: Object.values(this.nevermined.keeper.getAllInstances()) .filter((_) => !!_) .reduce( (acc, { contractName, address }) => ({ diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 6312f486e..bcaaf6329 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -203,7 +203,7 @@ export abstract class RegistryBaseApi extends Instantiable { immutableUrl: '', } ddo._nvm.versions.push(ddoVersion) - const networkId = await this.nevermined.keeper.getNetworkId() + const networkId = this.nevermined.keeper.network.chainId ddo._nvm.networks = { [networkId]: true } if (publishMetadata != PublishMetadata.OnlyMetadataAPI) { diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index 708da900c..c1cfc2429 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -145,7 +145,7 @@ export class JwtUtils extends Instantiable { if (message) { eip712Data = { message, - chainId: await this.nevermined.keeper.getNetworkId(), + chainId: this.nevermined.keeper.network.chainId, } } return new EthSignJWT({ diff --git a/test/keeper/ContractHandler.test.ts b/test/keeper/ContractHandler.test.ts index 288cd045d..215cc41b8 100644 --- a/test/keeper/ContractHandler.test.ts +++ b/test/keeper/ContractHandler.test.ts @@ -13,7 +13,7 @@ describe('ContractHandler', () => { nevermined = await Nevermined.getInstance(config) const { instanceConfig } = nevermined as any contractHandler = new ContractHandler(instanceConfig) - networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + networkName = nevermined.keeper.network.name }) describe('ABIs parsing', () => { diff --git a/test/keeper/Keeper.test.ts b/test/keeper/Keeper.test.ts index 5f0dfebb5..990658393 100644 --- a/test/keeper/Keeper.test.ts +++ b/test/keeper/Keeper.test.ts @@ -31,7 +31,7 @@ describe('Keeper', () => { describe('#getNetworkName()', () => { it('should get localnet as default', async () => { - const networkName: string = (await keeper.getNetworkName()).toLowerCase() + const networkName: string = keeper.network.name assert( networkName === 'geth-localnet' || networkName === 'polygon-localnet' || diff --git a/test/keeper/conditions/NFT721LockCondition.test.ts b/test/keeper/conditions/NFT721LockCondition.test.ts index 642084f92..80d5be5f2 100644 --- a/test/keeper/conditions/NFT721LockCondition.test.ts +++ b/test/keeper/conditions/NFT721LockCondition.test.ts @@ -35,7 +35,7 @@ describe('NFT721LockCondition', () => { ;({ conditionStoreManager, didRegistry } = nevermined.keeper) ;[owner, lockAddress] = await nevermined.accounts.list() - const networkName = (await nevermined.keeper.getNetworkName()).toLowerCase() + const networkName = nevermined.keeper.network.name const erc721ABI = await TestContractHandler.getABI( 'NFT721Upgradeable', From 6004a8b513be0abb30f3f40d48b3a35917d0744d Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 26 Jul 2023 15:58:24 +0200 Subject: [PATCH 048/151] chore: cleanup code --- src/keeper/Web3Provider.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index 7d47af483..4c6075bb5 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -22,22 +22,11 @@ export class Web3Provider { // Adding the static network prevents ethers from calling eth_chainId with every call const network = await provider.getNetwork() - console.log('network', network.chainId, network.name) provider = new ethers.JsonRpcProvider(config.web3ProviderUri, undefined, { cacheTimeout: -1, staticNetwork: network, }) - // provider.addListener('debug', (event) => { - // if (event.payload) { - // if (Array.isArray(event.payload)) { - // console.log(event.payload.map((e) => e.method)) - // } else { - // console.log(event.payload.method) - // } - // } - // }) - return provider } } From 1ef05470e53cbe91fcba5aa6e951bbd10b60decc Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 26 Jul 2023 17:05:55 +0200 Subject: [PATCH 049/151] fix: bring back network info getters - needed for lazy loading: getNetworkId, getNetworkName, getNetworkVersion --- MIGRATION_GUIDE.md | 16 ------- integration/nevermined/Artifacts.test.ts | 6 +-- integration/nevermined/Assets.test.ts | 2 +- .../ClaimPaymentAbortedAgreement.test.ts | 2 +- integration/nevermined/NFT1155.test.ts | 2 +- integration/nevermined/NFT1155Api.e2e.test.ts | 4 +- integration/nevermined/NFT721.test.ts | 2 +- integration/nevermined/NFT721Api.e2e.test.ts | 2 +- .../nevermined/NFT721Templates.test.ts | 4 +- .../NFTsWithMultipleServices.test.ts | 2 +- src/events/ContractEvent.ts | 2 +- src/keeper/ContractHandler.ts | 8 ++-- src/keeper/Keeper.ts | 43 ++++++++++++++++++- src/keeper/contracts/ContractBase.ts | 2 +- src/keeper/contracts/Nft1155Contract.ts | 2 +- src/keeper/contracts/Nft721Contract.ts | 2 +- src/nevermined/Nevermined.ts | 2 +- src/nevermined/Versions.ts | 4 +- src/nevermined/api/RegistryBaseApi.ts | 2 +- src/nevermined/utils/JwtUtils.ts | 2 +- test/keeper/ContractHandler.test.ts | 2 +- test/keeper/Keeper.test.ts | 2 +- .../conditions/NFT721LockCondition.test.ts | 2 +- 23 files changed, 70 insertions(+), 47 deletions(-) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index a3d73611f..4e692acb1 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -2,22 +2,6 @@ ## Breaking changes -### Keeper Network info - -`Keeper.version`, `Keeper.getNetworkId()`, `Keeper.getNetworkName()` are removed and instead the network information is static and set during Keeper initialization: - -```ts -// v1 -const chainId = await nevermined.keeper.getNetworkId() -const networkName = await nevermined.keeper.getNetworkName() -const version = nevermined.keeper.version - -// v2 -const chainId = nevermined.network.chainId -const networkName = nevermined.keeper.network.name -const version = nevermined.keeper.network.version -``` - ### Defining Asset Price The assetPrice is not part of AssetAttributes anymore and is part of each individual service added to the DDO when registering a service. So for services having a price, this must be added as part of the services array of the AssetAttributes. diff --git a/integration/nevermined/Artifacts.test.ts b/integration/nevermined/Artifacts.test.ts index f405dca4b..671dbfab8 100644 --- a/integration/nevermined/Artifacts.test.ts +++ b/integration/nevermined/Artifacts.test.ts @@ -44,12 +44,12 @@ describe('Artifacts', () => { artifactsFolder: tempDir, } as NeverminedOptions) - assert.equal(networkId[0], nvm.keeper.network.chainId) + assert.equal(networkId[0], await nvm.keeper.getNetworkId()) assert.isDefined(nvm) assert.isDefined(nvm.keeper) assert.isDefined(nvm.keeper.didRegistry) - assert.oneOf(nvm.keeper.network.name, networkName) - assert.oneOf(nvm.keeper.network.chainId, networkId) + assert.oneOf(await nvm.keeper.getNetworkName(), networkName) + assert.oneOf(await nvm.keeper.getNetworkId(), networkId) }) } }) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index a73f0275d..cd646ad75 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -70,7 +70,7 @@ describe('Assets', () => { assert.equal(ddo._nvm.versions[0].immutableBackend, 'ipfs') assert.equal(Object.keys(ddo._nvm.networks).length, 1) - assert.equal(ddo._nvm.networks[nevermined.keeper.network.chainId], true) + assert.equal(ddo._nvm.networks[await nevermined.keeper.getNetworkId()], true) const metadata = ddo.findServiceByType('metadata') assert.equal(metadata.attributes.main.ercType, 721) diff --git a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts index 9f3214e1b..5da5c8baa 100644 --- a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts +++ b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts @@ -50,7 +50,7 @@ describe('Claim aborted agreements End-to-End', () => { nevermined = await Nevermined.getInstance(config) ;[, publisher, collector1, , other] = await nevermined.accounts.list() - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index 9252d45aa..ef7171f75 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -68,7 +68,7 @@ describe('NFT1155 End-to-End', () => { describe('As user I can deploy Nevermined ERC-1155 NFT contract instances', () => { it('Using the ABI', async () => { - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc1155ABI = await ContractHandler.getABI( 'NFT1155Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 388255176..bd9d8764c 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -86,7 +86,7 @@ function makeTest(isCustom) { ) if (isCustom) { - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc1155ABI = await ContractHandler.getABI( 'NFT1155Upgradeable', config.artifactsFolder, @@ -468,7 +468,7 @@ function makeTest(isCustom) { describe('Node should not be able to transfer the nft without the operator role', () => { it('should create the subscription NFT without granting Nevermined the operator role', async () => { - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc1155ABI = await ContractHandler.getABI( 'NFT1155Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT721.test.ts b/integration/nevermined/NFT721.test.ts index f25e8f9a7..ca20e079d 100644 --- a/integration/nevermined/NFT721.test.ts +++ b/integration/nevermined/NFT721.test.ts @@ -29,7 +29,7 @@ describe('Nfts721 operations', async () => { // Accounts ;[deployer, artist, collector] = await nevermined.accounts.list() - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index d91254c1e..64543c7c4 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -47,7 +47,7 @@ describe('NFTs721 Api End-to-End', () => { nevermined = await Nevermined.getInstance(config) ;[, artist, collector1, , gallery] = await nevermined.accounts.list() - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 88a442544..313560fe8 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -90,7 +90,7 @@ describe('NFT721Templates E2E', () => { nevermined = await Nevermined.getInstance(config) ;[owner, artist, collector1, collector2, gallery] = await nevermined.accounts.list() - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, @@ -609,7 +609,7 @@ describe('NFT721Templates E2E', () => { collector2.getId(), ) - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index da1feb548..a63aa6736 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -45,7 +45,7 @@ describe('E2E Flow for NFTs with multiple services', () => { neverminedNodeAddress = await nevermined.services.node.getProviderAddress() - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc721ABI = await ContractHandler.getABI( 'NFT721Upgradeable', config.artifactsFolder, diff --git a/src/events/ContractEvent.ts b/src/events/ContractEvent.ts index 17cff5db1..eea0b2e15 100644 --- a/src/events/ContractEvent.ts +++ b/src/events/ContractEvent.ts @@ -34,7 +34,7 @@ export class ContractEvent extends NeverminedEvent { public async getPastEvents(options: EventOptions): EventResult { try { - const chainId = this.nevermined.keeper.network.chainId + const chainId = await this.nevermined.keeper.getNetworkId() options.fromBlock = 0 options.toBlock = 'latest' diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index 9b459963a..e4502e793 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -55,8 +55,8 @@ export class ContractHandler extends Instantiable { artifactsFolder: string, address?: string, ): Promise { - const chainId = this.nevermined.keeper.network.chainId - const where = this.nevermined.keeper.network.name + const chainId = await this.nevermined.keeper.getNetworkId() + const where = await this.nevermined.keeper.getNetworkName() try { this.logger.debug(`ContractHandler :: get :: ${artifactsFolder} and address ${address}`) return ( @@ -98,7 +98,7 @@ export class ContractHandler extends Instantiable { } public async getVersion(contractName: string, artifactsFolder: string): Promise { - const where = this.nevermined.keeper.network.name + const where = await this.nevermined.keeper.getNetworkName() let artifact this.logger.debug( `ContractHandler :: getVersion :: Trying to read ${artifactsFolder}/${contractName}.${where}.json`, @@ -257,7 +257,7 @@ export class ContractHandler extends Instantiable { public async getFeeData(gasPrice?: bigint, maxFeePerGas?: bigint, maxPriorityFeePerGas?: bigint) { // Custom gas fee for polygon networks - const chainId = this.nevermined.keeper.network.chainId + const chainId = await this.nevermined.keeper.getNetworkId() if (chainId === 137 || chainId === 80001) { return this.getFeeDataPolygon(chainId) } diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index d601a0b9b..3cc5f3422 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -150,7 +150,7 @@ export class Keeper extends Instantiable { } catch (err) { this.connected = false throw new KeeperError( - `Keeper could not connect to ${this.network.name} - ${err.message} ${err.stack}`, + `Keeper could not connect to ${await this.getNetworkName()} - ${err.message} ${err.stack}`, ) } @@ -337,7 +337,7 @@ export class Keeper extends Instantiable { /** * Network id loaded from web3 */ - public network: { + protected network: { /** * chainId of the network */ @@ -378,6 +378,45 @@ export class Keeper extends Instantiable { return Object.values(this.templates).find((template) => template.contractName === name) } + /** + * Returns the network by name. + * @returns Network name. + */ + public async getNetworkName(): Promise { + if (!this.network.name) { + this.network.name = await KeeperUtils.getNetworkName(await this.getNetworkId()) + } + return this.network.name + } + + /** + * Returns the id of the network. + * @returns Network ID. + */ + public async getNetworkId(): Promise { + if (!this.network.chainId) { + this.network.loading = false + this.network.chainId = Number((await this.web3.getNetwork()).chainId) + } + + while (!this.network.chainId) { + await new Promise((resolve) => setTimeout(resolve, 1)) + } + + return this.network.chainId + } + + /** + * Returns the network version. + * @returns Network version. + */ + public getNetworkVersion(): string { + if (!this.network.version) { + this.network.version = this.didRegistry.version.replace('v', '') + } + return this.network.version + } + /** * Returns a Access template by name. * @param name - Template name. diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index c061d610c..460095c49 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -67,7 +67,7 @@ export abstract class ContractBase extends Instantiable { this, eventEmitter, this.config.graphHttpUri, - this.nevermined.keeper.network.name, + await this.nevermined.keeper.getNetworkName(), ) } else { this.events = ContractEvent.getInstance(this, eventEmitter, config.nevermined, this.web3) diff --git a/src/keeper/contracts/Nft1155Contract.ts b/src/keeper/contracts/Nft1155Contract.ts index 2a3c172a7..c3278e84a 100644 --- a/src/keeper/contracts/Nft1155Contract.ts +++ b/src/keeper/contracts/Nft1155Contract.ts @@ -20,7 +20,7 @@ export class Nft1155Contract extends NFTContractsBase { await nft.init(config) if (address) { - const networkName = nft.nevermined.keeper.network.name + const networkName = await nft.nevermined.keeper.getNetworkName() const solidityABI = await ContractHandler.getABI(contractName, artifactsFolder, networkName) await new ContractHandler(config).checkExists(address) diff --git a/src/keeper/contracts/Nft721Contract.ts b/src/keeper/contracts/Nft721Contract.ts index 0cba341b6..4a6871b3a 100644 --- a/src/keeper/contracts/Nft721Contract.ts +++ b/src/keeper/contracts/Nft721Contract.ts @@ -16,7 +16,7 @@ export class Nft721Contract extends NFTContractsBase { ): Promise { const nft: Nft721Contract = new Nft721Contract(contractName) nft.setInstanceConfig(config) - const networkName = nft.nevermined.keeper.network.name + const networkName = await nft.nevermined.keeper.getNetworkName() // We don't have a subgraph for NFT721 so we can only use ContractEvent const eventEmitter = new EventHandler() diff --git a/src/nevermined/Nevermined.ts b/src/nevermined/Nevermined.ts index 8ef493cd0..e14fe3ec8 100644 --- a/src/nevermined/Nevermined.ts +++ b/src/nevermined/Nevermined.ts @@ -22,7 +22,7 @@ export class Nevermined extends Instantiable { * * @example * ```ts - * import { Nevermined, Config } from '@nevermined-io/nevermied-sdk-js' + * import { Nevermined, Config } from '@nevermined-io/sdk' * * const config: Config = {...} * const nevermined = await Nevermined.getInstance(config) diff --git a/src/nevermined/Versions.ts b/src/nevermined/Versions.ts index c3c19e94a..02ef09afa 100644 --- a/src/nevermined/Versions.ts +++ b/src/nevermined/Versions.ts @@ -57,8 +57,8 @@ export class Versions extends Instantiable { version: metadata.version, commit: metadata.commit, status: PlatformTechStatus.Working, - network: this.nevermined.keeper.network.name, - keeperVersion: this.nevermined.keeper.network.version, + network: await this.nevermined.keeper.getNetworkName(), + keeperVersion: this.nevermined.keeper.getNetworkVersion(), contracts: Object.values(this.nevermined.keeper.getAllInstances()) .filter((_) => !!_) .reduce( diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index bcaaf6329..6312f486e 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -203,7 +203,7 @@ export abstract class RegistryBaseApi extends Instantiable { immutableUrl: '', } ddo._nvm.versions.push(ddoVersion) - const networkId = this.nevermined.keeper.network.chainId + const networkId = await this.nevermined.keeper.getNetworkId() ddo._nvm.networks = { [networkId]: true } if (publishMetadata != PublishMetadata.OnlyMetadataAPI) { diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index c1cfc2429..708da900c 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -145,7 +145,7 @@ export class JwtUtils extends Instantiable { if (message) { eip712Data = { message, - chainId: this.nevermined.keeper.network.chainId, + chainId: await this.nevermined.keeper.getNetworkId(), } } return new EthSignJWT({ diff --git a/test/keeper/ContractHandler.test.ts b/test/keeper/ContractHandler.test.ts index 215cc41b8..8aa0342b6 100644 --- a/test/keeper/ContractHandler.test.ts +++ b/test/keeper/ContractHandler.test.ts @@ -13,7 +13,7 @@ describe('ContractHandler', () => { nevermined = await Nevermined.getInstance(config) const { instanceConfig } = nevermined as any contractHandler = new ContractHandler(instanceConfig) - networkName = nevermined.keeper.network.name + networkName = await nevermined.keeper.getNetworkName() }) describe('ABIs parsing', () => { diff --git a/test/keeper/Keeper.test.ts b/test/keeper/Keeper.test.ts index 990658393..e7620ca83 100644 --- a/test/keeper/Keeper.test.ts +++ b/test/keeper/Keeper.test.ts @@ -31,7 +31,7 @@ describe('Keeper', () => { describe('#getNetworkName()', () => { it('should get localnet as default', async () => { - const networkName: string = keeper.network.name + const networkName: string = await keeper.getNetworkName() assert( networkName === 'geth-localnet' || networkName === 'polygon-localnet' || diff --git a/test/keeper/conditions/NFT721LockCondition.test.ts b/test/keeper/conditions/NFT721LockCondition.test.ts index 80d5be5f2..767289cf6 100644 --- a/test/keeper/conditions/NFT721LockCondition.test.ts +++ b/test/keeper/conditions/NFT721LockCondition.test.ts @@ -35,7 +35,7 @@ describe('NFT721LockCondition', () => { ;({ conditionStoreManager, didRegistry } = nevermined.keeper) ;[owner, lockAddress] = await nevermined.accounts.list() - const networkName = nevermined.keeper.network.name + const networkName = await nevermined.keeper.getNetworkName() const erc721ABI = await TestContractHandler.getABI( 'NFT721Upgradeable', From 81c34f4d205576290c6788c873f905d77c123af3 Mon Sep 17 00:00:00 2001 From: r-marques Date: Wed, 26 Jul 2023 15:56:05 +0000 Subject: [PATCH 050/151] Automated CHANGELOG.md update Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d53cc5b4c..d4669ffe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc1...v2.0.0-rc2) + +> 26 July 2023 + +- Support of assets with multiple services of the same type [`#555`](https://github.com/nevermined-io/sdk-js/pull/555) +- feat: make keeper network info static [`89511f1`](https://github.com/nevermined-io/sdk-js/commit/89511f11140398c146246a19438e958938b83376) +- fix: bring back network info getters [`1ef0547`](https://github.com/nevermined-io/sdk-js/commit/1ef05470e53cbe91fcba5aa6e951bbd10b60decc) +- chore: coming back to original attribute name [`941f96f`](https://github.com/nevermined-io/sdk-js/commit/941f96f485fee18398fe7e1517e8a43e85361754) + #### [v2.0.0-rc1](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc0...v2.0.0-rc1) > 25 July 2023 @@ -348,7 +357,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384) - linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4) -#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) +### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) > 14 February 2023 @@ -1087,7 +1096,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1350,7 +1359,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1856,7 +1865,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1895,7 +1904,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 61f990b4165c4687c4776f6d3118eb1b98bde718 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:00:59 +0200 Subject: [PATCH 051/151] test: using mocha rc because opts is deprecated --- aave_integration/.mocharc.json | 6 ++++++ integration/.mocharc.json | 6 ++++++ integration/mocha.opts | 6 ------ package.json | 20 ++++++++++---------- test/.mocharc.json | 6 ++++++ test/mocha.opts | 8 -------- 6 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 aave_integration/.mocharc.json create mode 100644 integration/.mocharc.json delete mode 100644 integration/mocha.opts create mode 100644 test/.mocharc.json delete mode 100644 test/mocha.opts diff --git a/aave_integration/.mocharc.json b/aave_integration/.mocharc.json new file mode 100644 index 000000000..860f598d7 --- /dev/null +++ b/aave_integration/.mocharc.json @@ -0,0 +1,6 @@ +{ + "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "full-trace": true, + "exit": true, + "timeout": "300000" +} diff --git a/integration/.mocharc.json b/integration/.mocharc.json new file mode 100644 index 000000000..860f598d7 --- /dev/null +++ b/integration/.mocharc.json @@ -0,0 +1,6 @@ +{ + "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "full-trace": true, + "exit": true, + "timeout": "300000" +} diff --git a/integration/mocha.opts b/integration/mocha.opts deleted file mode 100644 index d8310c34a..000000000 --- a/integration/mocha.opts +++ /dev/null @@ -1,6 +0,0 @@ ---require ts-node/register ---require source-map-support/register ---require mock-local-storage ---full-trace ---exit ---timeout 300000 diff --git a/package.json b/package.json index 46763f453..54592e85d 100644 --- a/package.json +++ b/package.json @@ -12,21 +12,21 @@ "build:metadata": "./scripts/get-metadata.js > src/metadata.json", "build:dist": "cross-env NODE_ENV=production webpack", "build:watch": "tsc -w", - "test": "mocha --opts test/mocha.opts ./test/**/*.test.ts", + "test": "mocha --config test/.mocharc.json ./test/**/*.test.ts", "test:watch": "mocha -w --watch-extensions js,ts,json", - "test:cover": "nyc --report-dir coverage/unit mocha --opts test/mocha.opts ./test/**/*.test.ts", - "integration": "mocha --opts integration/mocha.opts ", - "integration:subgraph": "mocha --opts integration/mocha.opts ./integration/**/*.test.subgraph.ts", + "test:cover": "nyc --report-dir coverage/unit mocha --config test/.mocharc.json ./test/**/*.test.ts", + "integration": "mocha --config integration/.mocharc.json ", + "integration:subgraph": "mocha --config integration/.mocharc.json ./integration/**/*.test.subgraph.ts", "integration:production": "export NETWORK_NAME=production; yarn integration", "integration:staging": "export NETWORK_NAME=staging; yarn integration", "integration:integration": "export NETWORK_NAME=integration; yarn integration", - "integration:watch": "mocha -w --watch-extensions js,ts,json --opts integration/mocha.opts ./integration/**/*.test.ts", - "integration:cover": "nyc --report-dir coverage/integration mocha --opts integration/mocha.opts ./integration/nevermined/*.test.ts", - "integration:aave": "mocha --opts aave_integration/mocha.opts ./aave_integration/**/*.test.ts", - "integration:e2e": "mocha --opts integration/mocha.opts ./integration/nevermined/NFT1155Api.e2e.test.ts", + "integration:watch": "mocha -w --watch-extensions js,ts,json --config integration/.mocharc.json ./integration/**/*.test.ts", + "integration:cover": "nyc --report-dir coverage/integration mocha --config integration/.mocharc.json ./integration/nevermined/*.test.ts", + "integration:aave": "mocha --config aave_integration/.mocharc.json ./aave_integration/**/*.test.ts", + "integration:e2e": "mocha --config integration/.mocharc.json ./integration/nevermined/NFT1155Api.e2e.test.ts", "integration:e2e:mumbai": "export NETWORK_NAME=mumbai; yarn integration:e2e", - "integration:compute": "mocha --opts integration/mocha.opts ./integration/compute/Compute*.test.ts", - "integration:external": "mocha --opts integration/mocha.opts ./integration/external/*.test.ts", + "integration:compute": "mocha --config integration/.mocharc.json ./integration/compute/Compute*.test.ts", + "integration:external": "mocha --config integration/.mocharc.json ./integration/external/*.test.ts", "clean": "rm -rf ./dist/ ./doc/ ./.nyc_output", "lint": "eslint ./", "lint:fix": "eslint ./ --fix", diff --git a/test/.mocharc.json b/test/.mocharc.json new file mode 100644 index 000000000..4ad2aa2ba --- /dev/null +++ b/test/.mocharc.json @@ -0,0 +1,6 @@ +{ + "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "full-trace": true, + "exit": true, + "timeout": "60000" +} diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 01bce8675..000000000 --- a/test/mocha.opts +++ /dev/null @@ -1,8 +0,0 @@ ---require ts-node/register ---require source-map-support/register ---require mock-local-storage ---full-trace ---exit ---timeout 60000 -test/config.ts -test/**/*.test.ts From 5070f319baaa7fa361e103c6e1a4ffac2548012f Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:01:55 +0200 Subject: [PATCH 052/151] test: e2e tests for credit subscriptions --- src/keeper/contracts/NFTContractsBase.ts | 26 + src/keeper/contracts/Nft1155Contract.ts | 25 + src/keeper/contracts/Nft721Contract.ts | 20 - src/models/NFTAttributes.ts | 18 + src/nevermined/api/nfts/index.ts | 1 + .../NFT1155SubscriptionUpgradeable.json | 1338 +++++++++++++++++ 6 files changed, 1408 insertions(+), 20 deletions(-) create mode 100644 test/resources/artifacts/NFT1155SubscriptionUpgradeable.json diff --git a/src/keeper/contracts/NFTContractsBase.ts b/src/keeper/contracts/NFTContractsBase.ts index 694a3d804..6d38cb814 100644 --- a/src/keeper/contracts/NFTContractsBase.ts +++ b/src/keeper/contracts/NFTContractsBase.ts @@ -4,6 +4,12 @@ import { Account } from '../../nevermined' import { ContractTransactionReceipt, EventLog } from 'ethers' import { KeeperError } from '../../errors' +export interface MintedEntry { + tokenId: bigint + expirationBlock: bigint + mintBlock: bigint +} + export class NFTContractsBase extends ContractBase { /** * Gets the contract owner @@ -106,4 +112,24 @@ export class NFTContractsBase extends ContractBase { public revokeOperatorRole(operatorAddress: string, from?: Account, txParams?: TxParameters) { return this.sendFrom('revokeOperatorRole', [zeroX(operatorAddress)], from, txParams) } + + /** + * It gets all the `MintedEntries` events from the NFT Contract + * @param owner the user owning the NFT + * @param did the tokenId of the NFT + * @returns An array of `MintedEntry` objects + */ + public async getMintedEntries(owner: string, did?: string): Promise { + const minted: string[][] = await this.call('getMintedEntries', did ? [owner, did] : [owner]) + + const entries: MintedEntry[] = [] + for (let i = 0; i < minted.length; i++) { + entries.push({ + tokenId: BigInt(minted[i][0]), + expirationBlock: BigInt(minted[i][1]), + mintBlock: BigInt(minted[i][2]), + }) + } + return entries + } } diff --git a/src/keeper/contracts/Nft1155Contract.ts b/src/keeper/contracts/Nft1155Contract.ts index e4c24440d..494b07228 100644 --- a/src/keeper/contracts/Nft1155Contract.ts +++ b/src/keeper/contracts/Nft1155Contract.ts @@ -5,6 +5,7 @@ import { TxParameters } from './ContractBase' import { ethers } from 'ethers' import { NFTContractsBase } from './NFTContractsBase' import { ContractHandler } from '../ContractHandler' +import { ContractEvent, EventHandler } from '../../events' /** * NFTs contracts DTO allowing to manage Nevermined ERC-1155 NFTs @@ -22,6 +23,10 @@ export class Nft1155Contract extends NFTContractsBase { if (address) { const networkName = (await nft.nevermined.keeper.getNetworkName()).toLowerCase() + // We don't have a subgraph for NFT1155 so we can only use ContractEvent + const eventEmitter = new EventHandler() + nft.events = ContractEvent.getInstance(nft, eventEmitter, config.nevermined, config.web3) + const solidityABI = await ContractHandler.getABI(contractName, artifactsFolder, networkName) await new ContractHandler(config).checkExists(address) nft.contract = new ethers.Contract(address, solidityABI.abi, nft.web3) @@ -31,6 +36,26 @@ export class Nft1155Contract extends NFTContractsBase { return nft } + public static async getInstanceUsingABI( + config: InstantiableConfig, + address: string, + solidityABI: any, + ): Promise { + const contractName = solidityABI.contractName + const nft: Nft1155Contract = new Nft1155Contract(contractName) + nft.setInstanceConfig(config) + + // We don't have a subgraph for NFT1155 so we can only use ContractEvent + const eventEmitter = new EventHandler() + nft.events = ContractEvent.getInstance(nft, eventEmitter, config.nevermined, config.web3) + + await new ContractHandler(config).checkExists(address) + nft.contract = new ethers.Contract(address, solidityABI.abi, nft.web3) + nft.address = await nft.contract.getAddress() + + return nft + } + /** * Creates a contract clone of an existing contract instance * diff --git a/src/keeper/contracts/Nft721Contract.ts b/src/keeper/contracts/Nft721Contract.ts index 8d7410bf7..8a4c9787a 100644 --- a/src/keeper/contracts/Nft721Contract.ts +++ b/src/keeper/contracts/Nft721Contract.ts @@ -124,24 +124,4 @@ export class Nft721Contract extends NFTContractsBase { public async tokenURI(did: string): Promise { return this.call('tokenURI', [didZeroX(did)]) } - - public async getMintedEntries(owner: string): Promise { - const minted: string[][] = await this.call('getMintedEntries', [owner]) - - const entries: MintedEntry[] = [] - for (let i = 0; i < minted.length; i++) { - entries.push({ - tokenId: BigInt(minted[i][0]), - expirationBlock: BigInt(minted[i][1]), - mintBlock: BigInt(minted[i][2]), - }) - } - return entries - } -} - -export interface MintedEntry { - tokenId: bigint - expirationBlock: bigint - mintBlock: bigint } diff --git a/src/models/NFTAttributes.ts b/src/models/NFTAttributes.ts index fb00a2b73..028b8d917 100644 --- a/src/models/NFTAttributes.ts +++ b/src/models/NFTAttributes.ts @@ -106,6 +106,24 @@ export class NFTAttributes extends AssetAttributes { } } + static getCreditsSubscriptionInstance( + nftAttributes: Partial, + ): Required { + const _instance = { + ercType: 1155, + nftType: NeverminedNFT1155Type.nft1155Credit, + // isSubscription: true, + nftContractAddress: nftAttributes.nftContractAddress, + metadata: nftAttributes.metadata, + ...NFTAttributes.defaultValues, + ...nftAttributes, + } + _instance.services.forEach((service) => { + service.nft.isSubscription = true + }) + return _instance + } + static getNFT721Instance(nftAttributes: Partial): Required { return { ercType: 721, diff --git a/src/nevermined/api/nfts/index.ts b/src/nevermined/api/nfts/index.ts index 5d74b68ca..7935c4d34 100644 --- a/src/nevermined/api/nfts/index.ts +++ b/src/nevermined/api/nfts/index.ts @@ -4,3 +4,4 @@ export * from './NFTsBaseApi' export * from './PoapApi' export * from './SoulBoundApi' export * from './SubscriptionNFTApi' +export * from './SubscriptionCreditsNFTApi' diff --git a/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json new file mode 100644 index 000000000..d9037a2b3 --- /dev/null +++ b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json @@ -0,0 +1,1338 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "NFT1155SubscriptionUpgradeable", + "sourceName": "contracts/token/erc1155/NFT1155SubcriptionUpgradeable.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_newAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_fromAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ercType", + "type": "uint256" + } + ], + "name": "NFTCloned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "TransferBatch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "TransferSingle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "URI", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NVM_OPERATOR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "didRegistryAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "string", + "name": "uri_", + "type": "string" + } + ], + "name": "__NFT1155Upgradeable_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "didRegistryAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "string", + "name": "uri_", + "type": "string" + } + ], + "name": "__NFT1155Upgradeable_unchained", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "addressToBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "balanceOfBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_b32", + "type": "bytes32" + } + ], + "name": "bytes32ToAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_amounts", + "type": "uint256[]" + } + ], + "name": "calculateTotalAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "contractURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "address[]", + "name": "_operators", + "type": "address[]" + } + ], + "name": "createClone", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getMintedEntries", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "amountMinted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintBlock", + "type": "uint256" + } + ], + "internalType": "struct NFT1155SubscriptionUpgradeable.MintedTokens[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getNFTAttributes", + "outputs": [ + { + "internalType": "bool", + "name": "nftInitialized", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "nftSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintCap", + "type": "uint256" + }, + { + "internalType": "string", + "name": "nftURI", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNvmConfigAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTrustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantOperatorRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "didRegistryAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "string", + "name": "uri_", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isContract", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationBlock", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nftType", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nvmConfig", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOperatorRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeOperatorRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "royaltyInfo", + "outputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "royaltyAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeBatchTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_uri", + "type": "string" + } + ], + "name": "setContractMetadataUri", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nftSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintCap", + "type": "uint256" + }, + { + "internalType": "string", + "name": "nftURI", + "type": "string" + } + ], + "name": "setNFTAttributes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "nftURI", + "type": "string" + } + ], + "name": "setNFTMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "setNvmConfigAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "royaltyAmount", + "type": "uint256" + } + ], + "name": "setTokenRoyalty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "uri", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "whenWasMinted", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50613f4d806100206000396000f3fe608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e7b565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ebd565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612eda565b6107f3565b005b6102d161081d565b6040516102889190612f47565b6102d16102ec366004612f5a565b6108ac565b6102a46102ff366004612eda565b3b151590565b6102c7610313366004612f73565b610951565b61032b6103263660046130e7565b610977565b6040516102889190613193565b6102c76103463660046131a7565b610b7d565b61027e610359366004612f5a565b610bb7565b6102c761036c366004612eda565b610bcc565b61038461037f366004612f73565b610c37565b6040516102889291906131e3565b6102c76103a0366004613262565b610c8d565b6102c76103b336600461330f565b610ceb565b6102c76103c636600461330f565b610d0c565b6102c7610d96565b6102c76103e136600461333f565b610db7565b6103f96103f4366004612f5a565b610ed9565b60405161028894939291906133bc565b61041c6104173660046133ed565b610fd6565b6040516102889190613481565b6102a4610437366004612eda565b6110ff565b61032b61044a366004612f5a565b90565b61027e61045b366004613494565b611124565b6102a461046e366004612eda565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134d0565b61119f565b61027e6104c9366004612eda565b6001600160a01b031690565b61027e600080516020613ed883398151915281565b61032b61147c565b6102a461050036600461330f565b61148b565b6102d16114b6565b6102c761051b366004613526565b6114c4565b6102c761052e36600461355e565b6114f6565b61027e600081565b6102c76105493660046135ad565b611529565b61032b61153b565b6102c7610564366004612eda565b61154a565b6102c7610577366004612f73565b6115b2565b6102c761058a3660046135db565b6115c4565b61032b611637565b6102c76105a536600461363a565b6116c2565b6102c76105b836600461330f565b61171e565b6102c76105cb36600461333f565b61173a565b6102d161181a565b6102a46105e636600461366e565b6118ac565b60ff5461032b906001600160a01b031681565b61061161060c366004612e7b565b6118ed565b604051610288919061369c565b61041c61062c366004612e7b565b611988565b6102c761063f3660046136f5565b611a69565b6102c7610652366004612eda565b611ac0565b6102c7610665366004613751565b611b36565b6102c761067836600461333f565b611e78565b60008061068a8484611ed5565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613786565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613786565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613786565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613786565b9060005260206000209060030201600001548261079991906137b2565b91505b806107a6816137c5565b915050610690565b509150505b92915050565b60006107c482611f08565b806107d357506107d382611f29565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611f79565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137de565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137de565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137de565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611fe8565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611ff7565b9050806001600160a01b038116633f2f5ee26109d2611fe8565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613818565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613786565b60200260200101516040518263ffffffff1660e01b8152600401610a8a9190613193565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137c5565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611fe8565b610bad5760405162461bcd60e51b8152600401610ba490613876565b60405180910390fd5b6109738282612091565b600090815260c9602052604090206001015490565b610bd4611fe8565b6001600160a01b0316610be561147c565b6001600160a01b03161480610c005750610c0061046e611fe8565b610c1c5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed8833981519152826120b7565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138d1565b610c8391906138e8565b9150509250929050565b610c95611fe8565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611fe8565b610cd75760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856120c1565b5050505050565b610cf482610bb7565b610cfd816122b2565b610d0783836122c3565b505050565b610d14611fe8565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b610973828261234a565b610db5600080516020613ed8833981519152610db0611fe8565b61234a565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de6306123cf565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611e78565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137de565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612f95565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613786565b60200260200101518583815181106110bd576110bd613786565b602002602001015161067d565b8282815181106110dc576110dc613786565b60209081029190910101526110f0816137c5565b9050611085565b509392505050565b6000611109611637565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613786565b60200260200101518261115891906137b2565b915080611164816137c5565b91505061112a565b5092915050565b60006107b3600080516020613ed88339815191528361148b565b611195611f79565b610db560006123de565b6111aa61046e611fe8565b806111cd57506111b861147c565b6001600160a01b0316846001600160a01b0316145b8061125d575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa15801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190613958565b6001600160a01b0316611252611fe8565b6001600160a01b0316145b6112a25760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff166112f65760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc60205260409020600201541561136e57600083815260fc6020526040902060028101546001909101546113319084906137b2565b111561136e5760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc60205260408120600101805484929061138f9084906137b2565b9091555050610102546001600160a01b031663bb794d92846113af611fe8565b85436040516020016113c4949392919061398c565b604051602081830303815290604052805190602001208560001b6113e6611fe8565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161142694939291906139c8565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114699190613a08565b5061147684848484612430565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137de565b6114cf61046e611fe8565b6114eb5760405162461bcd60e51b8152600401610ba490613876565b610d0783838361254e565b61150161046e611fe8565b61151d5760405162461bcd60e51b8152600401610ba490613876565b611476848484846125e6565b610973611534611fe8565b838361261a565b60ff546001600160a01b031690565b611552611fe8565b6001600160a01b031661156361147c565b6001600160a01b0316148061157e575061157e61046e611fe8565b61159a5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed88339815191528261234a565b6109736115bd611fe8565b8383611b36565b6115d08585858461119f565b60006115dc8686611ed5565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b60008061164261153b565b90506001600160a01b03811661165a57600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc9190613958565b91505090565b6116ca611fe8565b6001600160a01b03166116db61147c565b6001600160a01b031614806116f657506116f661046e611fe8565b6117125760405162461bcd60e51b8152600401610ba4906138a1565b60fe6109738282613a6b565b61172782610bb7565b611730816122b2565b610d07838361234a565b600054610100900460ff166117615760405162461bcd60e51b8152600401610ba490613b2a565b611780600080516020613ed883398151915261177b611fe8565b6120b7565b611798600080516020613ed8833981519152856120b7565b6117b0600080516020613ed8833981519152866120b7565b6117b9816116c2565b6101006117c68482613a6b565b506101016117d48382613a6b565b5061010280546001600160a01b0319166001600160a01b0386161790556117f9611fe8565b6001600160a01b0316856001600160a01b031614610ce457610ce485611ac0565b606060fe8054611829906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054611855906137de565b80156118a25780601f10611877576101008083540402835291602001916118a2565b820191906000526020600020905b81548152906001019060200180831161188557829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff16806118e657506118e682611173565b9392505050565b606061010360006118fe8585611ed5565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561197c578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508152602001906001019061192c565b50505050905092915050565b606060006119968484611ed5565b60008181526101036020526040812054919250906001600160401b038111156119c1576119c1612f95565b6040519080825280602002602001820160405280156119ea578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae57600083815261010360205260409020805482908110611a2857611a28613786565b906000526020600020906003020160020154828281518110611a4c57611a4c613786565b602090810291909101015280611a61816137c5565b9150506119f0565b611a71611fe8565b6001600160a01b0316856001600160a01b03161480611a975750611a97856105e6611fe8565b611ab35760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856126fa565b611ac8611f79565b6001600160a01b038116611b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c34816123de565b80611b41848461282f565b1015611b9b5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b611ba661046e611fe8565b80611bc95750611bb4611fe8565b6001600160a01b0316836001600160a01b0316145b80611bdb5750611bdb836105e6611fe8565b611c395760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611c5a908490613b75565b9091555050610102546001600160a01b031663bb794d9283611c7a611fe8565b8443604051602001611c8f9493929190613b9f565b604051602081830303815290604052805190602001208460001b611cb1611fe8565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611cf19493929190613bc8565b6020604051808303816000875af1158015611d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d349190613a08565b506000611d418484611ed5565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611d7f57611d7f613786565b9060005260206000209060030201600001548211611de657600083815261010360205260409020805483919083908110611dbb57611dbb613786565b90600052602060002090600302016000016000828254611ddb9190613b75565b90915550610ed19050565b600083815261010360205260409020805482908110611e0757611e07613786565b90600052602060002090600302016000015482611e249190613b75565b60008481526101036020526040902080549193509082908110611e4957611e49613786565b600091825260208220600390910201818155600181018290556002015580611e70816137c5565b915050611d47565b600054610100900460ff16611e9f5760405162461bcd60e51b8152600401610ba490613b2a565b611ea76128c2565b611eaf6128c2565b611eb8816128e9565b611ec0612919565b611ec86128c2565b610ce4858585858561173a565b60008282604051602001611eea9291906131e3565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611f5a57506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611f81611fe8565b6001600160a01b0316611f9261147c565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611ff2612950565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b03811661208c5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d078282613a6b565b61097382826122c3565b81518351146121235760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b0384166121495760405162461bcd60e51b8152600401610ba490613c08565b6000612153611fe8565b905061216381878787878761297e565b60005b845181101561224c57600085828151811061218357612183613786565b6020026020010151905060008583815181106121a1576121a1613786565b60209081029190910181015160008481526097835260408082206001600160a01b038e1683529093529190912054909150818110156121f25760405162461bcd60e51b8152600401610ba490613c4d565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906122319084906137b2565b9250508190555050505080612245906137c5565b9050612166565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161229c929190613c97565b60405180910390a4610ed18187878787876129e5565b610c34816122be611fe8565b612b47565b6122cd828261148b565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612306611fe8565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612354828261148b565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916905561238b611fe8565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0384166124905760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b600061249a611fe8565b905060006124a785612ba0565b905060006124b485612ba0565b90506124c58360008985858961297e565b60008681526097602090815260408083206001600160a01b038b168452909152812080548792906124f79084906137b2565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613ef8833981519152910160405180910390a461254583600089898989612beb565b50505050505050565b620f424081111561259e5760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce48282613a6b565b816001600160a01b0316836001600160a01b03160361268d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166127205760405162461bcd60e51b8152600401610ba490613c08565b600061272a611fe8565b9050600061273785612ba0565b9050600061274485612ba0565b905061275483898985858961297e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156127975760405162461bcd60e51b8152600401610ba490613c4d565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906127d69084906137b2565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613ef8833981519152910160405180910390a4612824848a8a8a8a8a612beb565b505050505050505050565b60006001600160a01b03831661289a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613b2a565b600054610100900460ff166129105760405162461bcd60e51b8152600401610ba490613b2a565b610c3481612cad565b600054610100900460ff166129405760405162461bcd60e51b8152600401610ba490613b2a565b610db561294b611fe8565b6123de565b6000601436108015906129675750612967336110ff565b15612979575060131936013560601c90565b503390565b6001600160a01b038516158061299b57506001600160a01b038416155b806129ac57506129ac61046e611fe8565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6129f7846001600160a01b03166123cf565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612a309089908990889088908890600401613cc5565b6020604051808303816000875af1925050508015612a6b575060408051601f3d908101601f19168201909252612a6891810190613d03565b60015b612b1757612a77613d20565b806308c379a003612ab05750612a8b613d3b565b80612a965750612ab2565b8060405162461bcd60e51b8152600401610ba49190612f47565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b612b51828261148b565b61097357612b5e81612cb9565b612b69836020612ccb565b604051602001612b7a929190613e0c565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f47565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612bda57612bda613786565b602090810291909101015292915050565b612bfd846001600160a01b03166123cf565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c369089908990889088908890600401613e7b565b6020604051808303816000875af1925050508015612c71575060408051601f3d908101601f19168201909252612c6e91810190613d03565b60015b612c7d57612a77613d20565b6001600160e01b0319811663f23a6e6160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b60996109738282613a6b565b60606107b36001600160a01b03831660145b60606000612cda8360026138d1565b612ce59060026137b2565b6001600160401b03811115612cfc57612cfc612f95565b6040519080825280601f01601f191660200182016040528015612d26576020820181803683370190505b509050600360fc1b81600081518110612d4157612d41613786565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7057612d70613786565b60200101906001600160f81b031916908160001a9053506000612d948460026138d1565b612d9f9060016137b2565b90505b6001811115612e17576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612dd357612dd3613786565b1a60f81b828281518110612de957612de9613786565b60200101906001600160f81b031916908160001a90535060049490941c93612e1081613ec0565b9050612da2565b5083156118e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e8e57600080fd5b8235612e9981612e66565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612ecf57600080fd5b81356118e681612ea7565b600060208284031215612eec57600080fd5b81356118e681612e66565b60005b83811015612f12578181015183820152602001612efa565b50506000910152565b60008151808452612f33816020860160208601612ef7565b601f01601f19169290920160200192915050565b6020815260006118e66020830184612f1b565b600060208284031215612f6c57600080fd5b5035919050565b60008060408385031215612f8657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fd057612fd0612f95565b6040525050565b600082601f830112612fe857600080fd5b81356001600160401b0381111561300157613001612f95565b604051613018601f8301601f191660200182612fab565b81815284602083860101111561302d57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561306357613063612f95565b5060051b60200190565b600082601f83011261307e57600080fd5b8135602061308b8261304a565b6040516130988282612fab565b83815260059390931b85018201928281019150868411156130b857600080fd5b8286015b848110156130dc5780356130cf81612e66565b83529183019183016130bc565b509695505050505050565b600080600080608085870312156130fd57600080fd5b84356001600160401b038082111561311457600080fd5b61312088838901612fd7565b9550602087013591508082111561313657600080fd5b61314288838901612fd7565b9450604087013591508082111561315857600080fd5b61316488838901612fd7565b9350606087013591508082111561317a57600080fd5b506131878782880161306d565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131ba57600080fd5b8235915060208301356001600160401b038111156131d757600080fd5b610c8385828601612fd7565b6001600160a01b03929092168252602082015260400190565b600082601f83011261320d57600080fd5b8135602061321a8261304a565b6040516132278282612fab565b83815260059390931b850182019282810191508684111561324757600080fd5b8286015b848110156130dc578035835291830191830161324b565b600080600080600060a0868803121561327a57600080fd5b853561328581612e66565b9450602086013561329581612e66565b935060408601356001600160401b03808211156132b157600080fd5b6132bd89838a016131fc565b945060608801359150808211156132d357600080fd5b6132df89838a016131fc565b935060808801359150808211156132f557600080fd5b5061330288828901612fd7565b9150509295509295909350565b6000806040838503121561332257600080fd5b82359150602083013561333481612e66565b809150509250929050565b600080600080600060a0868803121561335757600080fd5b853561336281612e66565b9450602086013561337281612e66565b935060408601356001600160401b038082111561338e57600080fd5b61339a89838a01612fd7565b945060608801359150808211156133b057600080fd5b6132df89838a01612fd7565b84151581528360208201528260408201526080606082015260006133e36080830184612f1b565b9695505050505050565b6000806040838503121561340057600080fd5b82356001600160401b038082111561341757600080fd5b6134238683870161306d565b9350602085013591508082111561343957600080fd5b50610c83858286016131fc565b600081518084526020808501945080840160005b838110156134765781518752958201959082019060010161345a565b509495945050505050565b6020815260006118e66020830184613446565b6000602082840312156134a657600080fd5b81356001600160401b038111156134bc57600080fd5b6134c8848285016131fc565b949350505050565b600080600080608085870312156134e657600080fd5b84356134f181612e66565b9350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b61318787828801612fd7565b60008060006060848603121561353b57600080fd5b83359250602084013561354d81612e66565b929592945050506040919091013590565b6000806000806080858703121561357457600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b8015158114610c3457600080fd5b600080604083850312156135c057600080fd5b82356135cb81612e66565b915060208301356133348161359f565b600080600080600060a086880312156135f357600080fd5b85356135fe81612e66565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b61330288828901612fd7565b60006020828403121561364c57600080fd5b81356001600160401b0381111561366257600080fd5b6134c884828501612fd7565b6000806040838503121561368157600080fd5b823561368c81612e66565b9150602083013561333481612e66565b602080825282518282018190526000919060409081850190868401855b828110156136e857815180518552868101518786015285015185850152606090930192908501906001016136b9565b5091979650505050505050565b600080600080600060a0868803121561370d57600080fd5b853561371881612e66565b9450602086013561372881612e66565b9350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b60008060006060848603121561376657600080fd5b833561377181612e66565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b361379c565b6000600182016137d7576137d761379c565b5060010190565b600181811c908216806137f257607f821691505b60208210810361381257634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061384490830186612f1b565b82810360608401526138568186612f1b565b9050828103608084015261386a8185612f1b565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b361379c565b60008261390557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561396a57600080fd5b81516118e681612e66565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613975565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613975565b600060208284031215613a1a57600080fd5b81516118e68161359f565b601f821115610d0757600081815260208120601f850160051c81016020861015613a4c5750805b601f850160051c820191505b81811015610ed157828155600101613a58565b81516001600160401b03811115613a8457613a84612f95565b613a9881613a9284546137de565b84613a25565b602080601f831160018114613acd5760008415613ab55750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613afc57888601518255948401946001909101908401613add565b5085821015613b1a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b361379c565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613b88565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613b88565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613caa6040830185613446565b8281036020840152613cbc8185613446565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090613cf190830186613446565b82810360608401526138568186613446565b600060208284031215613d1557600080fd5b81516118e681612ea7565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d495790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d7857505050505090565b8285019150815181811115613d905750505050505090565b843d8701016020828501011115613daa5750505050505090565b613db960208286010187612fab565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e3e816017850160208801612ef7565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e6f816028840160208801612ef7565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613eb590830184612f1b565b979650505050505050565b600081613ecf57613ecf61379c565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220acddfb70104e79f1ac2b78e25c39a2d66eeec2fe68b7ba2188c38257a7cfd96264736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e7b565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ebd565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612eda565b6107f3565b005b6102d161081d565b6040516102889190612f47565b6102d16102ec366004612f5a565b6108ac565b6102a46102ff366004612eda565b3b151590565b6102c7610313366004612f73565b610951565b61032b6103263660046130e7565b610977565b6040516102889190613193565b6102c76103463660046131a7565b610b7d565b61027e610359366004612f5a565b610bb7565b6102c761036c366004612eda565b610bcc565b61038461037f366004612f73565b610c37565b6040516102889291906131e3565b6102c76103a0366004613262565b610c8d565b6102c76103b336600461330f565b610ceb565b6102c76103c636600461330f565b610d0c565b6102c7610d96565b6102c76103e136600461333f565b610db7565b6103f96103f4366004612f5a565b610ed9565b60405161028894939291906133bc565b61041c6104173660046133ed565b610fd6565b6040516102889190613481565b6102a4610437366004612eda565b6110ff565b61032b61044a366004612f5a565b90565b61027e61045b366004613494565b611124565b6102a461046e366004612eda565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134d0565b61119f565b61027e6104c9366004612eda565b6001600160a01b031690565b61027e600080516020613ed883398151915281565b61032b61147c565b6102a461050036600461330f565b61148b565b6102d16114b6565b6102c761051b366004613526565b6114c4565b6102c761052e36600461355e565b6114f6565b61027e600081565b6102c76105493660046135ad565b611529565b61032b61153b565b6102c7610564366004612eda565b61154a565b6102c7610577366004612f73565b6115b2565b6102c761058a3660046135db565b6115c4565b61032b611637565b6102c76105a536600461363a565b6116c2565b6102c76105b836600461330f565b61171e565b6102c76105cb36600461333f565b61173a565b6102d161181a565b6102a46105e636600461366e565b6118ac565b60ff5461032b906001600160a01b031681565b61061161060c366004612e7b565b6118ed565b604051610288919061369c565b61041c61062c366004612e7b565b611988565b6102c761063f3660046136f5565b611a69565b6102c7610652366004612eda565b611ac0565b6102c7610665366004613751565b611b36565b6102c761067836600461333f565b611e78565b60008061068a8484611ed5565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613786565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613786565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613786565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613786565b9060005260206000209060030201600001548261079991906137b2565b91505b806107a6816137c5565b915050610690565b509150505b92915050565b60006107c482611f08565b806107d357506107d382611f29565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611f79565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137de565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137de565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137de565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611fe8565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611ff7565b9050806001600160a01b038116633f2f5ee26109d2611fe8565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613818565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613786565b60200260200101516040518263ffffffff1660e01b8152600401610a8a9190613193565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137c5565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611fe8565b610bad5760405162461bcd60e51b8152600401610ba490613876565b60405180910390fd5b6109738282612091565b600090815260c9602052604090206001015490565b610bd4611fe8565b6001600160a01b0316610be561147c565b6001600160a01b03161480610c005750610c0061046e611fe8565b610c1c5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed8833981519152826120b7565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138d1565b610c8391906138e8565b9150509250929050565b610c95611fe8565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611fe8565b610cd75760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856120c1565b5050505050565b610cf482610bb7565b610cfd816122b2565b610d0783836122c3565b505050565b610d14611fe8565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b610973828261234a565b610db5600080516020613ed8833981519152610db0611fe8565b61234a565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de6306123cf565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611e78565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137de565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612f95565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613786565b60200260200101518583815181106110bd576110bd613786565b602002602001015161067d565b8282815181106110dc576110dc613786565b60209081029190910101526110f0816137c5565b9050611085565b509392505050565b6000611109611637565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613786565b60200260200101518261115891906137b2565b915080611164816137c5565b91505061112a565b5092915050565b60006107b3600080516020613ed88339815191528361148b565b611195611f79565b610db560006123de565b6111aa61046e611fe8565b806111cd57506111b861147c565b6001600160a01b0316846001600160a01b0316145b8061125d575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa15801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190613958565b6001600160a01b0316611252611fe8565b6001600160a01b0316145b6112a25760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff166112f65760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc60205260409020600201541561136e57600083815260fc6020526040902060028101546001909101546113319084906137b2565b111561136e5760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc60205260408120600101805484929061138f9084906137b2565b9091555050610102546001600160a01b031663bb794d92846113af611fe8565b85436040516020016113c4949392919061398c565b604051602081830303815290604052805190602001208560001b6113e6611fe8565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161142694939291906139c8565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114699190613a08565b5061147684848484612430565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137de565b6114cf61046e611fe8565b6114eb5760405162461bcd60e51b8152600401610ba490613876565b610d0783838361254e565b61150161046e611fe8565b61151d5760405162461bcd60e51b8152600401610ba490613876565b611476848484846125e6565b610973611534611fe8565b838361261a565b60ff546001600160a01b031690565b611552611fe8565b6001600160a01b031661156361147c565b6001600160a01b0316148061157e575061157e61046e611fe8565b61159a5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed88339815191528261234a565b6109736115bd611fe8565b8383611b36565b6115d08585858461119f565b60006115dc8686611ed5565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b60008061164261153b565b90506001600160a01b03811661165a57600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc9190613958565b91505090565b6116ca611fe8565b6001600160a01b03166116db61147c565b6001600160a01b031614806116f657506116f661046e611fe8565b6117125760405162461bcd60e51b8152600401610ba4906138a1565b60fe6109738282613a6b565b61172782610bb7565b611730816122b2565b610d07838361234a565b600054610100900460ff166117615760405162461bcd60e51b8152600401610ba490613b2a565b611780600080516020613ed883398151915261177b611fe8565b6120b7565b611798600080516020613ed8833981519152856120b7565b6117b0600080516020613ed8833981519152866120b7565b6117b9816116c2565b6101006117c68482613a6b565b506101016117d48382613a6b565b5061010280546001600160a01b0319166001600160a01b0386161790556117f9611fe8565b6001600160a01b0316856001600160a01b031614610ce457610ce485611ac0565b606060fe8054611829906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054611855906137de565b80156118a25780601f10611877576101008083540402835291602001916118a2565b820191906000526020600020905b81548152906001019060200180831161188557829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff16806118e657506118e682611173565b9392505050565b606061010360006118fe8585611ed5565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561197c578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508152602001906001019061192c565b50505050905092915050565b606060006119968484611ed5565b60008181526101036020526040812054919250906001600160401b038111156119c1576119c1612f95565b6040519080825280602002602001820160405280156119ea578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae57600083815261010360205260409020805482908110611a2857611a28613786565b906000526020600020906003020160020154828281518110611a4c57611a4c613786565b602090810291909101015280611a61816137c5565b9150506119f0565b611a71611fe8565b6001600160a01b0316856001600160a01b03161480611a975750611a97856105e6611fe8565b611ab35760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856126fa565b611ac8611f79565b6001600160a01b038116611b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c34816123de565b80611b41848461282f565b1015611b9b5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b611ba661046e611fe8565b80611bc95750611bb4611fe8565b6001600160a01b0316836001600160a01b0316145b80611bdb5750611bdb836105e6611fe8565b611c395760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611c5a908490613b75565b9091555050610102546001600160a01b031663bb794d9283611c7a611fe8565b8443604051602001611c8f9493929190613b9f565b604051602081830303815290604052805190602001208460001b611cb1611fe8565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611cf19493929190613bc8565b6020604051808303816000875af1158015611d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d349190613a08565b506000611d418484611ed5565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611d7f57611d7f613786565b9060005260206000209060030201600001548211611de657600083815261010360205260409020805483919083908110611dbb57611dbb613786565b90600052602060002090600302016000016000828254611ddb9190613b75565b90915550610ed19050565b600083815261010360205260409020805482908110611e0757611e07613786565b90600052602060002090600302016000015482611e249190613b75565b60008481526101036020526040902080549193509082908110611e4957611e49613786565b600091825260208220600390910201818155600181018290556002015580611e70816137c5565b915050611d47565b600054610100900460ff16611e9f5760405162461bcd60e51b8152600401610ba490613b2a565b611ea76128c2565b611eaf6128c2565b611eb8816128e9565b611ec0612919565b611ec86128c2565b610ce4858585858561173a565b60008282604051602001611eea9291906131e3565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611f5a57506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611f81611fe8565b6001600160a01b0316611f9261147c565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611ff2612950565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b03811661208c5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d078282613a6b565b61097382826122c3565b81518351146121235760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b0384166121495760405162461bcd60e51b8152600401610ba490613c08565b6000612153611fe8565b905061216381878787878761297e565b60005b845181101561224c57600085828151811061218357612183613786565b6020026020010151905060008583815181106121a1576121a1613786565b60209081029190910181015160008481526097835260408082206001600160a01b038e1683529093529190912054909150818110156121f25760405162461bcd60e51b8152600401610ba490613c4d565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906122319084906137b2565b9250508190555050505080612245906137c5565b9050612166565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161229c929190613c97565b60405180910390a4610ed18187878787876129e5565b610c34816122be611fe8565b612b47565b6122cd828261148b565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612306611fe8565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612354828261148b565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916905561238b611fe8565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0384166124905760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b600061249a611fe8565b905060006124a785612ba0565b905060006124b485612ba0565b90506124c58360008985858961297e565b60008681526097602090815260408083206001600160a01b038b168452909152812080548792906124f79084906137b2565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613ef8833981519152910160405180910390a461254583600089898989612beb565b50505050505050565b620f424081111561259e5760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce48282613a6b565b816001600160a01b0316836001600160a01b03160361268d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166127205760405162461bcd60e51b8152600401610ba490613c08565b600061272a611fe8565b9050600061273785612ba0565b9050600061274485612ba0565b905061275483898985858961297e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156127975760405162461bcd60e51b8152600401610ba490613c4d565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906127d69084906137b2565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613ef8833981519152910160405180910390a4612824848a8a8a8a8a612beb565b505050505050505050565b60006001600160a01b03831661289a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613b2a565b600054610100900460ff166129105760405162461bcd60e51b8152600401610ba490613b2a565b610c3481612cad565b600054610100900460ff166129405760405162461bcd60e51b8152600401610ba490613b2a565b610db561294b611fe8565b6123de565b6000601436108015906129675750612967336110ff565b15612979575060131936013560601c90565b503390565b6001600160a01b038516158061299b57506001600160a01b038416155b806129ac57506129ac61046e611fe8565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6129f7846001600160a01b03166123cf565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612a309089908990889088908890600401613cc5565b6020604051808303816000875af1925050508015612a6b575060408051601f3d908101601f19168201909252612a6891810190613d03565b60015b612b1757612a77613d20565b806308c379a003612ab05750612a8b613d3b565b80612a965750612ab2565b8060405162461bcd60e51b8152600401610ba49190612f47565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b612b51828261148b565b61097357612b5e81612cb9565b612b69836020612ccb565b604051602001612b7a929190613e0c565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f47565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612bda57612bda613786565b602090810291909101015292915050565b612bfd846001600160a01b03166123cf565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c369089908990889088908890600401613e7b565b6020604051808303816000875af1925050508015612c71575060408051601f3d908101601f19168201909252612c6e91810190613d03565b60015b612c7d57612a77613d20565b6001600160e01b0319811663f23a6e6160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b60996109738282613a6b565b60606107b36001600160a01b03831660145b60606000612cda8360026138d1565b612ce59060026137b2565b6001600160401b03811115612cfc57612cfc612f95565b6040519080825280601f01601f191660200182016040528015612d26576020820181803683370190505b509050600360fc1b81600081518110612d4157612d41613786565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7057612d70613786565b60200101906001600160f81b031916908160001a9053506000612d948460026138d1565b612d9f9060016137b2565b90505b6001811115612e17576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612dd357612dd3613786565b1a60f81b828281518110612de957612de9613786565b60200101906001600160f81b031916908160001a90535060049490941c93612e1081613ec0565b9050612da2565b5083156118e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e8e57600080fd5b8235612e9981612e66565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612ecf57600080fd5b81356118e681612ea7565b600060208284031215612eec57600080fd5b81356118e681612e66565b60005b83811015612f12578181015183820152602001612efa565b50506000910152565b60008151808452612f33816020860160208601612ef7565b601f01601f19169290920160200192915050565b6020815260006118e66020830184612f1b565b600060208284031215612f6c57600080fd5b5035919050565b60008060408385031215612f8657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fd057612fd0612f95565b6040525050565b600082601f830112612fe857600080fd5b81356001600160401b0381111561300157613001612f95565b604051613018601f8301601f191660200182612fab565b81815284602083860101111561302d57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561306357613063612f95565b5060051b60200190565b600082601f83011261307e57600080fd5b8135602061308b8261304a565b6040516130988282612fab565b83815260059390931b85018201928281019150868411156130b857600080fd5b8286015b848110156130dc5780356130cf81612e66565b83529183019183016130bc565b509695505050505050565b600080600080608085870312156130fd57600080fd5b84356001600160401b038082111561311457600080fd5b61312088838901612fd7565b9550602087013591508082111561313657600080fd5b61314288838901612fd7565b9450604087013591508082111561315857600080fd5b61316488838901612fd7565b9350606087013591508082111561317a57600080fd5b506131878782880161306d565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131ba57600080fd5b8235915060208301356001600160401b038111156131d757600080fd5b610c8385828601612fd7565b6001600160a01b03929092168252602082015260400190565b600082601f83011261320d57600080fd5b8135602061321a8261304a565b6040516132278282612fab565b83815260059390931b850182019282810191508684111561324757600080fd5b8286015b848110156130dc578035835291830191830161324b565b600080600080600060a0868803121561327a57600080fd5b853561328581612e66565b9450602086013561329581612e66565b935060408601356001600160401b03808211156132b157600080fd5b6132bd89838a016131fc565b945060608801359150808211156132d357600080fd5b6132df89838a016131fc565b935060808801359150808211156132f557600080fd5b5061330288828901612fd7565b9150509295509295909350565b6000806040838503121561332257600080fd5b82359150602083013561333481612e66565b809150509250929050565b600080600080600060a0868803121561335757600080fd5b853561336281612e66565b9450602086013561337281612e66565b935060408601356001600160401b038082111561338e57600080fd5b61339a89838a01612fd7565b945060608801359150808211156133b057600080fd5b6132df89838a01612fd7565b84151581528360208201528260408201526080606082015260006133e36080830184612f1b565b9695505050505050565b6000806040838503121561340057600080fd5b82356001600160401b038082111561341757600080fd5b6134238683870161306d565b9350602085013591508082111561343957600080fd5b50610c83858286016131fc565b600081518084526020808501945080840160005b838110156134765781518752958201959082019060010161345a565b509495945050505050565b6020815260006118e66020830184613446565b6000602082840312156134a657600080fd5b81356001600160401b038111156134bc57600080fd5b6134c8848285016131fc565b949350505050565b600080600080608085870312156134e657600080fd5b84356134f181612e66565b9350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b61318787828801612fd7565b60008060006060848603121561353b57600080fd5b83359250602084013561354d81612e66565b929592945050506040919091013590565b6000806000806080858703121561357457600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b8015158114610c3457600080fd5b600080604083850312156135c057600080fd5b82356135cb81612e66565b915060208301356133348161359f565b600080600080600060a086880312156135f357600080fd5b85356135fe81612e66565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b61330288828901612fd7565b60006020828403121561364c57600080fd5b81356001600160401b0381111561366257600080fd5b6134c884828501612fd7565b6000806040838503121561368157600080fd5b823561368c81612e66565b9150602083013561333481612e66565b602080825282518282018190526000919060409081850190868401855b828110156136e857815180518552868101518786015285015185850152606090930192908501906001016136b9565b5091979650505050505050565b600080600080600060a0868803121561370d57600080fd5b853561371881612e66565b9450602086013561372881612e66565b9350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b60008060006060848603121561376657600080fd5b833561377181612e66565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b361379c565b6000600182016137d7576137d761379c565b5060010190565b600181811c908216806137f257607f821691505b60208210810361381257634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061384490830186612f1b565b82810360608401526138568186612f1b565b9050828103608084015261386a8185612f1b565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b361379c565b60008261390557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561396a57600080fd5b81516118e681612e66565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613975565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613975565b600060208284031215613a1a57600080fd5b81516118e68161359f565b601f821115610d0757600081815260208120601f850160051c81016020861015613a4c5750805b601f850160051c820191505b81811015610ed157828155600101613a58565b81516001600160401b03811115613a8457613a84612f95565b613a9881613a9284546137de565b84613a25565b602080601f831160018114613acd5760008415613ab55750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613afc57888601518255948401946001909101908401613add565b5085821015613b1a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b361379c565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613b88565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613b88565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613caa6040830185613446565b8281036020840152613cbc8185613446565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090613cf190830186613446565b82810360608401526138568186613446565b600060208284031215613d1557600080fd5b81516118e681612ea7565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d495790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d7857505050505090565b8285019150815181811115613d905750505050505090565b843d8701016020828501011115613daa5750505050505090565b613db960208286010187612fab565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e3e816017850160208801612ef7565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e6f816028840160208801612ef7565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613eb590830184612f1b565b979650505050505050565b600081613ecf57613ecf61379c565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220acddfb70104e79f1ac2b78e25c39a2d66eeec2fe68b7ba2188c38257a7cfd96264736f6c63430008110033", + "linkReferences": {}, + "deployedLinkReferences": {} +} From f97aa61c4328a7bc8ea1f14f584b3664876970db Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:12:43 +0200 Subject: [PATCH 053/151] feat: subscription by credits api --- integration/nevermined/Credits.e2e.test.ts | 315 ++++++++++++++++++ .../api/nfts/SubscriptionCreditsNFTApi.ts | 41 +++ 2 files changed, 356 insertions(+) create mode 100644 integration/nevermined/Credits.e2e.test.ts create mode 100644 src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts new file mode 100644 index 000000000..aa8bdcab2 --- /dev/null +++ b/integration/nevermined/Credits.e2e.test.ts @@ -0,0 +1,315 @@ +import chai, { assert } from 'chai' +import chaiAsPromised from 'chai-as-promised' + +import { decodeJwt, JWTPayload } from 'jose' +import { Account, DDO, MetaData, Nevermined, AssetPrice, NFTAttributes } from '../../src' +import { EscrowPaymentCondition, Token, TransferNFTCondition } from '../../src/keeper' +import { config } from '../config' +import { getMetadata } from '../utils' +import TestContractHandler from '../../test/keeper/TestContractHandler' +import { ethers } from 'ethers' +import { didZeroX } from '../../src/utils' +import { EventOptions } from '../../src/events' +import { + getRoyaltyAttributes, + RoyaltyAttributes, + RoyaltyKind, + SubscriptionCreditsNFTApi, + NFT1155Api, +} from '../../src/nevermined' + +chai.use(chaiAsPromised) + +describe('Subscriptions using NFT ERC-1155 End-to-End', () => { + let editor: Account + let subscriber: Account + let reseller: Account + + let nevermined: Nevermined + let token: Token + let escrowPaymentCondition: EscrowPaymentCondition + let transferNftCondition: TransferNFTCondition + let subscriptionDDO: DDO + let assetDDO: DDO + + let agreementId: string + + // Configuration of First Sale: + // Editor -> Subscriber, the Reseller get a cut (25%) + let subscriptionPrice = 20n + let amounts = [15n, 5n] + let receivers: string[] + let assetPrice1: AssetPrice + let royaltyAttributes: RoyaltyAttributes + + let subscriptionMetadata: MetaData + let assetMetadata: MetaData + + const preMint = false + const royalties = 0 + const nftTransfer = false + const subscriptionDuration = 1000 // in blocks + + // This is the number of credits that the subscriber will get when purchase the subscription + // In the DDO this will be added in the `_numberNFTs` value of the `nft-sales` service of the subscription + const subscriptionCredits = 5n + + // This is the number of credits that cost get access to the service attached to the subscription + // In the DDO this will be added in the `_numberNFTs` value of the `nft-access` service of the asset associated to the subscription + const accessCostInCredits = 2n + + let initialBalances: any + let scale: bigint + + // let nft: ethers.Contract + let subscriptionNFT: NFT1155Api + let neverminedNodeAddress + + let payload: JWTPayload + + before(async () => { + TestContractHandler.setConfig(config) + + nevermined = await Nevermined.getInstance(config) + ;[, editor, subscriber, , reseller] = await nevermined.accounts.list() + + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(editor) + + await nevermined.services.marketplace.login(clientAssertion) + payload = decodeJwt(config.marketplaceAuthToken) + + assetMetadata = getMetadata() + subscriptionMetadata = getMetadata(undefined, 'Subscription NFT1155') + subscriptionMetadata.main.type = 'subscription' + + assetMetadata.userId = payload.sub + neverminedNodeAddress = await nevermined.services.node.getProviderAddress() + + // conditions + ;({ escrowPaymentCondition, transferNftCondition } = nevermined.keeper.conditions) + + // components + ;({ token } = nevermined.keeper) + + scale = 10n ** BigInt(await token.decimals()) + + subscriptionPrice = subscriptionPrice * scale + amounts = amounts.map((v) => v * scale) + receivers = [editor.getId(), reseller.getId()] + assetPrice1 = new AssetPrice( + new Map([ + [receivers[0], amounts[0]], + [receivers[1], amounts[1]], + ]), + ).setTokenAddress(token.address) + + royaltyAttributes = getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, royalties) + + initialBalances = { + editor: await token.balanceOf(editor.getId()), + subscriber: await token.balanceOf(subscriber.getId()), + reseller: await token.balanceOf(reseller.getId()), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), + } + }) + + describe('As an editor I want to register new content and provide a subscriptions to my content', () => { + it('I want to register a subscriptions NFT that gives access to exclusive contents to the holders', async () => { + console.log(`Running first test`) + // Deploy NFT + TestContractHandler.setConfig(config) + + const contractABI = await TestContractHandler.getABI( + 'NFT1155SubscriptionUpgradeable', + './test/resources/artifacts/', + ) + subscriptionNFT = await SubscriptionCreditsNFTApi.deployInstance( + config, + contractABI, + editor, + [ + editor.getId(), + nevermined.keeper.didRegistry.address, + 'Credits Subscription NFT', + 'CRED', + '', + ], + ) + + await nevermined.contracts.loadNft1155Api(subscriptionNFT) + + await subscriptionNFT.grantOperatorRole(transferNftCondition.address, editor) + + const nftAttributes = NFTAttributes.getSubscriptionInstance({ + metadata: subscriptionMetadata, + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + nft: { duration: subscriptionDuration, amount: subscriptionCredits, nftTransfer }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + subscriptionDDO = await nevermined.nfts1155.create(nftAttributes, editor) + + assert.equal(await subscriptionNFT.balance(subscriptionDDO.id, editor.getId()), 0n) + assert.isDefined(subscriptionDDO) + console.log(`Subscription DID: ${subscriptionDDO.id}`) + }) + + it('should grant Nevermined the operator role', async () => { + assert.isTrue( + await nevermined.nfts1155.isOperator( + subscriptionDDO.id, + nevermined.keeper.conditions.transferNftCondition.address, + ), + ) + }) + + it('I want to register a new asset and tokenize (via NFT)', async () => { + const nftAttributes = NFTAttributes.getSubscriptionInstance({ + metadata: assetMetadata, + services: [ + { + serviceType: 'nft-access', + nft: { duration: subscriptionDuration, amount: accessCostInCredits, nftTransfer }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + assetDDO = await nevermined.nfts1155.create(nftAttributes, editor) + assert.isDefined(assetDDO) + console.log(`Asset DID: ${assetDDO.id}`) + }) + }) + + describe('As a subscriber I want to get access to some contents', () => { + it('I check the details of the subscription NFT', async () => { + const details = await nevermined.nfts1155.details(subscriptionDDO.id) + assert.equal(details.owner, editor.getId()) + }) + + it('I am ordering the subscription NFT', async () => { + await subscriber.requestTokens(subscriptionPrice / scale) + + const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) + assert.equal(subscriberBalanceBefore, initialBalances.subscriber + subscriptionPrice) + + agreementId = await nevermined.nfts1155.order( + subscriptionDDO.id, + subscriptionCredits, + subscriber, + ) + + assert.isDefined(agreementId) + + const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) + + assert.equal(subscriberBalanceAfter, initialBalances.subscriber) + }) + + it('The seller can check the payment and transfer the NFT to the subscriber', async () => { + // Let's use the Node to mint the subscription and release the payments + + const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance Before: ${balanceBefore}`) + assert.equal(balanceBefore, 0n) + + const receipt = await nevermined.nfts1155.claim( + agreementId, + editor.getId(), + subscriber.getId(), + subscriptionCredits, + subscriptionDDO.id, + ) + assert.isTrue(receipt) + + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After: ${balanceAfter}`) + assert.equal(balanceAfter, subscriptionCredits) + + const minted = await subscriptionNFT.getContract.getMintedEntries( + subscriber.getId(), + subscriptionDDO.shortId(), + ) + console.log(`Minted: ${JSON.stringify(minted)}`) + }) + + it('the editor and reseller can receive their payment', async () => { + const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) + const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) + + assert.equal(receiver0Balance, initialBalances.editor + assetPrice1.getAmounts()[0]) + assert.equal(receiver1Balance, initialBalances.reseller + assetPrice1.getAmounts()[1]) + }) + + it('the subscription can be checked on chain', async () => { + const eventOptions: EventOptions = { + eventName: 'Fulfilled', + filterSubgraph: { + where: { + _did: didZeroX(subscriptionDDO.id), + _receiver: subscriber.getId(), + }, + }, + filterJsonRpc: { + _did: didZeroX(subscriptionDDO.id), + _receiver: subscriber.getId(), + }, + result: { + _agreementId: true, + _did: true, + _receiver: true, + }, + } + // wait for the event to be picked by the subgraph + await nevermined.keeper.conditions.transferNftCondition.events.once((e) => e, eventOptions) + const [event] = await nevermined.keeper.conditions.transferNftCondition.events.getPastEvents( + eventOptions, + ) + + // subgraph event or json-rpc event? + const eventValues = event.args || event + + assert.equal(eventValues._agreementId, agreementId) + assert.equal(eventValues._did, didZeroX(subscriptionDDO.id)) + + // thegraph stores the addresses in lower case + assert.equal(ethers.getAddress(eventValues._receiver), subscriber.getId()) + }) + }) + + describe('As subscriber I want to get access to assets include as part of my subscription', () => { + it('The Subscriber should have an NFT balance', async () => { + assert.equal( + await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()), + subscriptionCredits, + ) + }) + + it('The collector access the files', async () => { + const result = await nevermined.nfts1155.access( + assetDDO.id, + subscriber, + '/tmp/', + undefined, + agreementId, + ) + assert.isTrue(result) + }) + + it('The balance of the subscriber should be lower because credits got used', async () => { + assert.equal( + await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()), + subscriptionCredits - accessCostInCredits, + ) + }) + }) +}) diff --git a/src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts b/src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts new file mode 100644 index 000000000..1cff783e7 --- /dev/null +++ b/src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts @@ -0,0 +1,41 @@ +import { NeverminedOptions } from '../../../models' +import { InstantiableConfig } from '../../../Instantiable.abstract' +import { ContractHandler, Nft1155Contract } from '../../../keeper' +import { NFT1155Api } from './NFT1155Api' +import { Nevermined } from '../../Nevermined' +import { Account } from '../../Account' + +export class SubscriptionCreditsNFTApi extends NFT1155Api { + public static async getInstanceUsingABI( + config: InstantiableConfig, + nftContractAddress: string, + solidityABI: any, + ): Promise { + const instance = new SubscriptionCreditsNFTApi() + instance.servicePlugin = SubscriptionCreditsNFTApi.getServicePlugin(config) + instance.setInstanceConfig(config) + + instance.nftContract = await Nft1155Contract.getInstanceUsingABI( + config, + nftContractAddress, + solidityABI, + ) + return instance + } + + public static async deployInstance( + config: NeverminedOptions, + contractABI: any, + from: Account, + args = [], + ): Promise { + const { instanceConfig } = (await Nevermined.getInstance(config)) as any + const contractHandler = new ContractHandler(instanceConfig) + const nftContract = await contractHandler.deployAbi(contractABI, from, args) + return SubscriptionCreditsNFTApi.getInstanceUsingABI( + instanceConfig, + await nftContract.getAddress(), + contractABI, + ) + } +} From 2adf213a328ed53d511a57143fe84268a4749cb4 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:00:59 +0200 Subject: [PATCH 054/151] test: using mocha rc because opts is deprecated --- aave_integration/.mocharc.json | 6 ++++++ integration/.mocharc.json | 6 ++++++ integration/mocha.opts | 6 ------ package.json | 20 ++++++++++---------- test/.mocharc.json | 6 ++++++ test/mocha.opts | 8 -------- 6 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 aave_integration/.mocharc.json create mode 100644 integration/.mocharc.json delete mode 100644 integration/mocha.opts create mode 100644 test/.mocharc.json delete mode 100644 test/mocha.opts diff --git a/aave_integration/.mocharc.json b/aave_integration/.mocharc.json new file mode 100644 index 000000000..860f598d7 --- /dev/null +++ b/aave_integration/.mocharc.json @@ -0,0 +1,6 @@ +{ + "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "full-trace": true, + "exit": true, + "timeout": "300000" +} diff --git a/integration/.mocharc.json b/integration/.mocharc.json new file mode 100644 index 000000000..860f598d7 --- /dev/null +++ b/integration/.mocharc.json @@ -0,0 +1,6 @@ +{ + "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "full-trace": true, + "exit": true, + "timeout": "300000" +} diff --git a/integration/mocha.opts b/integration/mocha.opts deleted file mode 100644 index d8310c34a..000000000 --- a/integration/mocha.opts +++ /dev/null @@ -1,6 +0,0 @@ ---require ts-node/register ---require source-map-support/register ---require mock-local-storage ---full-trace ---exit ---timeout 300000 diff --git a/package.json b/package.json index 74c957c53..7c9acb7e5 100644 --- a/package.json +++ b/package.json @@ -12,21 +12,21 @@ "build:metadata": "./scripts/get-metadata.js > src/metadata.json", "build:dist": "cross-env NODE_ENV=production webpack", "build:watch": "tsc -w", - "test": "mocha --opts test/mocha.opts ./test/**/*.test.ts", + "test": "mocha --config test/.mocharc.json ./test/**/*.test.ts", "test:watch": "mocha -w --watch-extensions js,ts,json", - "test:cover": "nyc --report-dir coverage/unit mocha --opts test/mocha.opts ./test/**/*.test.ts", - "integration": "mocha --opts integration/mocha.opts ./integration/nevermined/*.test.ts", - "integration:subgraph": "mocha --opts integration/mocha.opts ./integration/**/*.test.subgraph.ts", + "test:cover": "nyc --report-dir coverage/unit mocha --config test/.mocharc.json ./test/**/*.test.ts", + "integration": "mocha --config integration/.mocharc.json ", + "integration:subgraph": "mocha --config integration/.mocharc.json ./integration/**/*.test.subgraph.ts", "integration:production": "export NETWORK_NAME=production; yarn integration", "integration:staging": "export NETWORK_NAME=staging; yarn integration", "integration:integration": "export NETWORK_NAME=integration; yarn integration", - "integration:watch": "mocha -w --watch-extensions js,ts,json --opts integration/mocha.opts ./integration/**/*.test.ts", - "integration:cover": "nyc --report-dir coverage/integration mocha --opts integration/mocha.opts ./integration/nevermined/*.test.ts", - "integration:aave": "mocha --opts aave_integration/mocha.opts ./aave_integration/**/*.test.ts", - "integration:e2e": "mocha --opts integration/mocha.opts ./integration/nevermined/NFT1155Api.e2e.test.ts", + "integration:watch": "mocha -w --watch-extensions js,ts,json --config integration/.mocharc.json ./integration/**/*.test.ts", + "integration:cover": "nyc --report-dir coverage/integration mocha --config integration/.mocharc.json ./integration/nevermined/*.test.ts", + "integration:aave": "mocha --config aave_integration/.mocharc.json ./aave_integration/**/*.test.ts", + "integration:e2e": "mocha --config integration/.mocharc.json ./integration/nevermined/NFT1155Api.e2e.test.ts", "integration:e2e:mumbai": "export NETWORK_NAME=mumbai; yarn integration:e2e", - "integration:compute": "mocha --opts integration/mocha.opts ./integration/compute/Compute*.test.ts", - "integration:external": "mocha --opts integration/mocha.opts ./integration/external/*.test.ts", + "integration:compute": "mocha --config integration/.mocharc.json ./integration/compute/Compute*.test.ts", + "integration:external": "mocha --config integration/.mocharc.json ./integration/external/*.test.ts", "clean": "rm -rf ./dist/ ./doc/ ./.nyc_output", "lint": "eslint ./", "lint:fix": "eslint ./ --fix", diff --git a/test/.mocharc.json b/test/.mocharc.json new file mode 100644 index 000000000..4ad2aa2ba --- /dev/null +++ b/test/.mocharc.json @@ -0,0 +1,6 @@ +{ + "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "full-trace": true, + "exit": true, + "timeout": "60000" +} diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 01bce8675..000000000 --- a/test/mocha.opts +++ /dev/null @@ -1,8 +0,0 @@ ---require ts-node/register ---require source-map-support/register ---require mock-local-storage ---full-trace ---exit ---timeout 60000 -test/config.ts -test/**/*.test.ts From 4c840bdca75da9605f7b222681cd023aa07302eb Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 27 Jul 2023 11:14:39 +0200 Subject: [PATCH 055/151] feat: mocha and chai to latest version --- aave_integration/.mocharc.json | 3 ++- integration/.mocharc.json | 3 ++- package.json | 12 ++++++------ test/.mocharc.json | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/aave_integration/.mocharc.json b/aave_integration/.mocharc.json index 860f598d7..e8702edc5 100644 --- a/aave_integration/.mocharc.json +++ b/aave_integration/.mocharc.json @@ -2,5 +2,6 @@ "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], "full-trace": true, "exit": true, - "timeout": "300000" + "timeout": "300000", + "diff": true } diff --git a/integration/.mocharc.json b/integration/.mocharc.json index 860f598d7..e8702edc5 100644 --- a/integration/.mocharc.json +++ b/integration/.mocharc.json @@ -2,5 +2,6 @@ "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], "full-trace": true, "exit": true, - "timeout": "300000" + "timeout": "300000", + "diff": true } diff --git a/package.json b/package.json index 7c9acb7e5..38c4b4ba1 100644 --- a/package.json +++ b/package.json @@ -89,20 +89,20 @@ "@faker-js/faker": "^6.3.1", "@opengsn/provider": "^3.0.0-beta.8", "@release-it/bumper": "^1.4.1", - "@types/chai": "^4.2.12", + "@types/chai": "^4.3.5", "@types/chai-as-promised": "^7.1.3", "@types/chai-spies": "^1.0.1", "@types/lodash": "^4.14.195", - "@types/mocha": "^5.2.7", + "@types/mocha": "^10.0.1", "@types/node": "^20.1.0", "@types/node-fetch": "^2.5.7", - "@types/tar": "^6.1.5", "@types/pluralize": "^0.0.29", + "@types/tar": "^6.1.5", "@types/temp": "^0.9.1", "@typescript-eslint/eslint-plugin": "^5.30.5", "@typescript-eslint/parser": "^5.30.5", "auto-changelog": "^2.4.0", - "chai": "^4.2.0", + "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "chai-exclude": "^2.1.0", "chai-spies": "^1.0.0", @@ -121,8 +121,8 @@ "husky": "^8.0.3", "lcov-result-merger": "^3.1.0", "lint-staged": "^13.0.4", - "mocha": "^7.2.0", - "mock-local-storage": "^1.1.15", + "mocha": "^10.2.0", + "mock-local-storage": "^1.1.24", "nyc": "^14.1.1", "ora": "^6.3.1", "prettier": "^2.7.1", diff --git a/test/.mocharc.json b/test/.mocharc.json index 4ad2aa2ba..4a7326a5c 100644 --- a/test/.mocharc.json +++ b/test/.mocharc.json @@ -2,5 +2,6 @@ "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], "full-trace": true, "exit": true, - "timeout": "60000" + "timeout": "60000", + "diff": true } From d0f6c11d6a67c30fe27ba6a79e27eb05a3243755 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 27 Jul 2023 14:34:20 +0200 Subject: [PATCH 056/151] chore: check CI number of cpus --- .github/workflows/testing.yml | 6 ++++++ CHANGELOG.md | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 807f01852..d1d9f23f9 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -40,6 +40,12 @@ jobs: LOG_LEVEL: 1 # If LOG_LEVEL is >1 it will print the logger.debug calls run: yarn run integration:cover + cpu-info: + runs-on: ubuntu-latest + steps: + - name: Cpu info + run: cat /proc/cpuinfo + unit-tests: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index d4669ffe1..8f0fa014e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1096,7 +1096,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1359,7 +1359,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1865,7 +1865,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1904,7 +1904,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 91c7c8ffc39948f4f36041ab8fbd821d6528d7ba Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 27 Jul 2023 14:39:54 +0200 Subject: [PATCH 057/151] Revert "chore: check CI number of cpus" This reverts commit d0f6c11d6a67c30fe27ba6a79e27eb05a3243755. --- .github/workflows/testing.yml | 6 ------ CHANGELOG.md | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d1d9f23f9..807f01852 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -40,12 +40,6 @@ jobs: LOG_LEVEL: 1 # If LOG_LEVEL is >1 it will print the logger.debug calls run: yarn run integration:cover - cpu-info: - runs-on: ubuntu-latest - steps: - - name: Cpu info - run: cat /proc/cpuinfo - unit-tests: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f0fa014e..d4669ffe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1096,7 +1096,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1359,7 +1359,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1865,7 +1865,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1904,7 +1904,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 1babae3fd7fb2d0e1f6a14468ca2327c3fc754af Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 27 Jul 2023 16:00:00 +0200 Subject: [PATCH 058/151] feat: use latest contracts and develop node --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 807f01852..cd776c0e0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,7 +16,7 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' - contracts-version: 'v3.2.1' + node-version: 'develop' - name: Install dependencies run: | From a133315c8b217cec7d41e6f863277dfe94fce98a Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 27 Jul 2023 17:01:31 +0200 Subject: [PATCH 059/151] chore: adapting nft 1155 to duration and transfer params --- integration/.mocharc.json | 2 ++ integration/nevermined/Credits.e2e.test.ts | 36 ++++++++++++------- .../conditions/Condition.abstract.ts | 1 - .../NFTs/TransferNFT721Condition.ts | 22 ++++++------ .../conditions/NFTs/TransferNFTCondition.ts | 21 +++++++---- .../contracts/templates/ConditionTemplates.ts | 10 ++++++ .../contracts/templates/NFTSalesTemplate.ts | 7 ++-- src/nevermined/api/nfts/NFT1155Api.ts | 12 ++++++- src/nevermined/api/nfts/NFT721Api.ts | 4 ++- src/nevermined/api/nfts/NFTsBaseApi.ts | 16 ++++++--- src/services/node/NeverminedNode.ts | 26 ++++++++------ 11 files changed, 108 insertions(+), 49 deletions(-) diff --git a/integration/.mocharc.json b/integration/.mocharc.json index 860f598d7..aa8af1052 100644 --- a/integration/.mocharc.json +++ b/integration/.mocharc.json @@ -1,6 +1,8 @@ { "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "diff": true, "full-trace": true, "exit": true, + "allow-uncaught": true, "timeout": "300000" } diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index aa8bdcab2..9a240c440 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -44,6 +44,7 @@ describe('Subscriptions using NFT ERC-1155 End-to-End', () => { let subscriptionMetadata: MetaData let assetMetadata: MetaData + let subsSalesService const preMint = false const royalties = 0 @@ -140,7 +141,7 @@ describe('Subscriptions using NFT ERC-1155 End-to-End', () => { await subscriptionNFT.grantOperatorRole(transferNftCondition.address, editor) - const nftAttributes = NFTAttributes.getSubscriptionInstance({ + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ metadata: subscriptionMetadata, services: [ { @@ -171,7 +172,7 @@ describe('Subscriptions using NFT ERC-1155 End-to-End', () => { }) it('I want to register a new asset and tokenize (via NFT)', async () => { - const nftAttributes = NFTAttributes.getSubscriptionInstance({ + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ metadata: assetMetadata, services: [ { @@ -202,10 +203,12 @@ describe('Subscriptions using NFT ERC-1155 End-to-End', () => { const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) assert.equal(subscriberBalanceBefore, initialBalances.subscriber + subscriptionPrice) + subsSalesService = subscriptionDDO.findServiceByType('nft-sales') agreementId = await nevermined.nfts1155.order( subscriptionDDO.id, subscriptionCredits, subscriber, + subsSalesService.index, ) assert.isDefined(agreementId) @@ -215,21 +218,30 @@ describe('Subscriptions using NFT ERC-1155 End-to-End', () => { assert.equal(subscriberBalanceAfter, initialBalances.subscriber) }) - it('The seller can check the payment and transfer the NFT to the subscriber', async () => { + it('The credits seller can check the payment and transfer the NFT to the subscriber', async () => { // Let's use the Node to mint the subscription and release the payments const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) console.log(`Balance Before: ${balanceBefore}`) + console.log(`Balance Before (JSON): ${JSON.stringify(balanceBefore.toString())}`) assert.equal(balanceBefore, 0n) - const receipt = await nevermined.nfts1155.claim( - agreementId, - editor.getId(), - subscriber.getId(), - subscriptionCredits, - subscriptionDDO.id, - ) - assert.isTrue(receipt) + try { + const receipt = await nevermined.nfts1155.claim( + agreementId, + editor.getId(), + subscriber.getId(), + subscriptionCredits, + subscriptionDDO.id, + subsSalesService.index, + ) + assert.isTrue(receipt) + } catch (e) { + console.error(e.message) + assert.fail(e.message) + } + + console.log(`Got the receipt`) const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) console.log(`Balance After: ${balanceAfter}`) @@ -239,7 +251,7 @@ describe('Subscriptions using NFT ERC-1155 End-to-End', () => { subscriber.getId(), subscriptionDDO.shortId(), ) - console.log(`Minted: ${JSON.stringify(minted)}`) + console.log(`Minted: ${minted.length}`) }) it('the editor and reseller can receive their payment', async () => { diff --git a/src/keeper/contracts/conditions/Condition.abstract.ts b/src/keeper/contracts/conditions/Condition.abstract.ts index a34c8209f..964223b48 100644 --- a/src/keeper/contracts/conditions/Condition.abstract.ts +++ b/src/keeper/contracts/conditions/Condition.abstract.ts @@ -20,7 +20,6 @@ export interface ConditionContext { service: Service price: AssetPrice creator: string - // serviceReference?: number } export interface ConditionParameters { diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts index 20fc336bb..b3ce9bc00 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts @@ -31,7 +31,9 @@ export class TransferNFT721Condition extends ProviderCondition> { @@ -58,7 +61,7 @@ export class TransferNFT721Condition extends ProviderCondition p.name === '_contractAddress') .value as string const nftHolder = transfer.parameters.find((p) => p.name === '_nftHolder').value as string @@ -98,6 +103,7 @@ export class TransferNFT721Condition extends ProviderCondition p.name === '_contractAddress') .value as string const nftHolder = transfer.parameters.find((p) => p.name === '_nftHolder').value as string @@ -122,6 +130,7 @@ export class TransferNFT721Condition extends ProviderCondition> { return { list: [ @@ -89,13 +91,17 @@ export class TransferNFTCondition extends ProviderCondition p.name === '_nftHolder').value as string) + + const nftTransferString = transfer.parameters.find((p) => p.name === '_nftTransfer') + .value as string return this.params( ddo.shortId(), nftHolder, @@ -103,7 +109,8 @@ export class TransferNFTCondition extends ProviderCondition ({ type: 'bytes32', value: '', }, + { + name: '_nftTransfer', + type: 'boolean', + value: '', + }, + { + name: '_duration', + type: 'uint256', + value: '0', + }, ], events: [ { diff --git a/src/keeper/contracts/templates/NFTSalesTemplate.ts b/src/keeper/contracts/templates/NFTSalesTemplate.ts index f2e3cfac8..c3f73edab 100644 --- a/src/keeper/contracts/templates/NFTSalesTemplate.ts +++ b/src/keeper/contracts/templates/NFTSalesTemplate.ts @@ -15,6 +15,7 @@ export interface NFTSalesTemplateParams { consumerId: string providerId: string nftAmount: bigint + expiration: number } export class NFTSalesTemplate extends BaseTemplate { @@ -36,16 +37,18 @@ export class NFTSalesTemplate extends BaseTemplate { - return this.params(consumer_address, nft_amount) + return this.params(consumer_address, nft_amount, expiration) } public lockConditionIndex(): number { diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index f6ebd0868..eed5be608 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -259,6 +259,7 @@ export class NFT1155Api extends NFTsBaseApi { * @param nftReceiver - The address where the NFT should be transferred. * @param numberEditions - The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 * @param did - The Decentralized Identifier of the asset. + * @param serviceIndex - The index of the service in the DDO that will be claimed * * @returns true if the transfer was successful. */ @@ -268,8 +269,17 @@ export class NFT1155Api extends NFTsBaseApi { nftReceiver: string, numberEditions = 1n, did?: string, + serviceIndex?: number, ): Promise { - return await this.claimNFT(agreementId, nftHolder, nftReceiver, numberEditions, 1155, did) + return await this.claimNFT( + agreementId, + nftHolder, + nftReceiver, + numberEditions, + 1155, + did, + serviceIndex, + ) } /** diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index 4c833309c..a4863c40c 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -180,6 +180,7 @@ export class NFT721Api extends NFTsBaseApi { * @param nftHolder - The address of the current owner of the NFT. * @param nftReceiver - The address where the NFT should be transferred. * @param did - The Decentralized Identifier of the asset. + * @param serviceIndex - The index of the service in the DDO that will be claimed * * @returns true if the transfer was successful. */ @@ -188,8 +189,9 @@ export class NFT721Api extends NFTsBaseApi { nftHolder: string, nftReceiver: string, did?: string, + serviceIndex?, ): Promise { - return await this.claimNFT(agreementId, nftHolder, nftReceiver, 1n, 721, did) + return await this.claimNFT(agreementId, nftHolder, nftReceiver, 1n, 721, did, serviceIndex) } /** diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 19beb0de3..47f5bc324 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -41,6 +41,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { * @param numberEditions - The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 * @param ercType - The Type of the NFT ERC (1155 or 721). * @param did - The DID of the asset. + * @param serviceIndex - The index of the service in the DDO that will be claimed * * @throws {@link NFTError} if Nevermined is not an operator for this NFT * @returns true if the transfer was successful. @@ -52,6 +53,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { numberEditions = 1n, ercType: ERCType = 1155, did?: string, + serviceIndex?: number, ): Promise { if (did) { // check if transferNFT condition has the operator role @@ -65,7 +67,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { throw new NFTError('Nevermined does not have operator role') } } - + console.log(`REMOVE: Just before node.claimNFT`) return await this.nevermined.services.node.claimNFT( agreementId, nftHolder, @@ -73,6 +75,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { numberEditions, ercType, did, + serviceIndex, ) } @@ -183,14 +186,17 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { * ``` * * @param ddo - The DDO of the asset. - * @param serviceType - The service type to look for the contract address + * @param serviceReference - The service type to look for the contract address * * @returns The NFT contract address. */ - public static getNFTContractAddress(ddo: DDO, serviceType: ServiceType = 'nft-access') { - const service = ddo.findServiceByType(serviceType) + public static getNFTContractAddress( + ddo: DDO, + serviceReference: number | ServiceType = 'nft-access', + ) { + const service = ddo.findServiceByReference(serviceReference) if (service) { - const conditionName = serviceType == 'nft-access' ? 'nftHolder' : 'transferNFT' + const conditionName = serviceReference == 'nft-access' ? 'nftHolder' : 'transferNFT' const cond = service.attributes.serviceAgreementTemplate.conditions.find( (c) => c.name === conditionName, ) diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index 722dc3de1..b7b922c70 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -378,19 +378,23 @@ export class NeverminedNode extends Instantiable { nftAmount: bigint, ercType: ERCType = 1155, did?: string, + serviceIndex?: number, ): Promise { try { - const response = await this.nevermined.utils.fetch.post( - this.getClaimNftEndpoint(), - JSON.stringify({ - agreementId, - did, - nftHolder, - nftReceiver, - nftAmount: nftAmount.toString(), - nftType: ercType, - }), - ) + console.log(`REMOVE: Just before fetch.post`) + const claimBody = JSON.stringify({ + agreementId, + did, + nftHolder, + nftReceiver, + nftAmount: nftAmount.toString(), + nftType: ercType, + serviceIndex: serviceIndex && serviceIndex >= 0 ? serviceIndex : -1, + }) + console.log(`REMOVE: Claim body: ${claimBody}`) + + const response = await this.nevermined.utils.fetch.post(this.getClaimNftEndpoint(), claimBody) + console.log(`REMOVE: we claimed`) if (!response.ok) { throw new HttpError(`${response.statusText} ${response.url}`, response.status) } From a06d31f4e8aab596f146ef077d56f5a13939bb8f Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 27 Jul 2023 17:10:42 +0200 Subject: [PATCH 060/151] chore: bumping to v2.0.0-rc3 --- CHANGELOG.md | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4669ffe1..8f0fa014e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1096,7 +1096,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1359,7 +1359,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1865,7 +1865,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1904,7 +1904,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) diff --git a/package.json b/package.json index 7c9acb7e5..a581a193e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc2", + "version": "2.0.0-rc3", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 4d125f2f39e7387488bf107966e9d5c2ef9b88d8 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 27 Jul 2023 17:11:28 +0200 Subject: [PATCH 061/151] chore: adding v2.0.0-rc3 Changelog updates --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f0fa014e..b3da92b1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc3](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc2...v2.0.0-rc3) + +> 27 July 2023 + +- feat: reduce number of calls to chainId [`#560`](https://github.com/nevermined-io/sdk-js/pull/560) +- test: e2e tests for credit subscriptions [`5070f31`](https://github.com/nevermined-io/sdk-js/commit/5070f319baaa7fa361e103c6e1a4ffac2548012f) +- feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) +- chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) + #### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc1...v2.0.0-rc2) > 26 July 2023 @@ -357,7 +366,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384) - linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4) -### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) +#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) > 14 February 2023 From c61cb5a851aa610d42756bad868eb57cef72909e Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 31 Jul 2023 09:37:58 +0200 Subject: [PATCH 062/151] chore: fixing nft tests --- integration/nevermined/Credits.e2e.test.ts | 2 +- integration/nevermined/NFT.test.ts | 34 +++++++++++++------ integration/nevermined/NFT1155Api.e2e.test.ts | 13 ++++--- .../nevermined/NFT721Templates.test.ts | 10 ++++++ integration/nevermined/NFTTemplates.test.ts | 4 +-- .../NFTsWithMultipleServices.test.ts | 20 +++++------ .../nevermined/SecondaryMarket.test.ts | 6 +++- src/common/helpers.ts | 5 +++ src/ddo/DDO.ts | 20 +++++++++++ src/keeper/contracts/ContractBase.ts | 4 ++- .../conditions/Condition.abstract.ts | 2 ++ .../NFTs/TransferNFT721Condition.ts | 21 ++++++------ .../conditions/NFTs/TransferNFTCondition.ts | 10 +++--- .../contracts/templates/NFTSalesTemplate.ts | 8 +++-- src/nevermined/api/ConditionsApi.ts | 8 ++++- src/nevermined/api/RegistryBaseApi.ts | 2 -- src/nevermined/api/nfts/NFTsBaseApi.ts | 2 ++ src/utils/DDOHelpers.ts | 2 +- 18 files changed, 118 insertions(+), 55 deletions(-) diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index 9a240c440..3087a8e33 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -20,7 +20,7 @@ import { chai.use(chaiAsPromised) -describe('Subscriptions using NFT ERC-1155 End-to-End', () => { +describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { let editor: Account let subscriber: Account let reseller: Account diff --git a/integration/nevermined/NFT.test.ts b/integration/nevermined/NFT.test.ts index 8177e281c..60d4f24e2 100644 --- a/integration/nevermined/NFT.test.ts +++ b/integration/nevermined/NFT.test.ts @@ -35,10 +35,14 @@ describe('Nfts operations', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ metadata, - services: [{ serviceType: 'nft-sales' }, { serviceType: 'nft-access' }], + services: [ + { serviceType: 'nft-sales', nft: { amount: 2n, nftTransfer: true } }, + { serviceType: 'nft-access' }, + ], nftContractAddress: nevermined.nfts1155.nftContract.address, cap: 10n, royaltyAttributes, + preMint: true, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) }) @@ -50,16 +54,19 @@ describe('Nfts operations', () => { ) }) - it('should mint 10 nft tokens', async () => { - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 10n) + it('artist should have balance because are pre-minted', async () => { + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, artist)) === 10n) }) it('should transfer 2 nft tokens with default token', async () => { const agreementId = await nevermined.nfts1155.order(ddo.id, 2n, collector) + await nevermined.nfts1155.transfer(agreementId, ddo.id, 2n, artist) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 8n) - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, collector), 2n) + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, artist)) === 8n) + console.log(`After Assert Balance`) + + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, collector)) === 2n) }) it('should the operation be approved', async () => { @@ -73,7 +80,7 @@ describe('Nfts operations', () => { it('should burn nft tokens', async () => { await nevermined.nfts1155.burn(ddo.id, 6n, artist) - assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 2n) + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, artist)) === 2n) }) }) @@ -84,16 +91,20 @@ describe('Nfts operations', () => { const nftAttributes = NFTAttributes.getNFT1155Instance({ metadata, - services: [{ serviceType: 'nft-sales' }, { serviceType: 'nft-access' }], + services: [ + { serviceType: 'nft-sales', nft: { nftTransfer: true } }, + { serviceType: 'nft-access' }, + ], nftContractAddress: nevermined.nfts1155.nftContract.address, cap: 10n, + preMint: true, royaltyAttributes, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) }) it('should mint 10 nft tokens', async () => { - assert.deepEqual(await nevermined.nfts1155.balance(ddo.id, artist), 10n) + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, artist)) === 10n) }) it('should transfer 2 nft tokens with custom token', async () => { @@ -121,6 +132,7 @@ describe('Nfts operations', () => { { serviceType: 'nft-sales', price: new AssetPrice(artist.getId(), parseEther('0.1')).setTokenAddress(ZeroAddress), + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', @@ -141,14 +153,14 @@ describe('Nfts operations', () => { const agreementId = await nevermined.nfts1155.order(ddo.id, 2n, collector) await nevermined.nfts1155.transfer(agreementId, ddo.id, 2n, artist) - assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 8n) - assert.equal(await nevermined.nfts1155.balance(ddo.id, collector), 2n) + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, artist)) === 8n) + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, collector)) === 2n) }) it('should burn nft tokens', async () => { await nevermined.nfts1155.burn(ddo.id, 6n, artist) - assert.equal(await nevermined.nfts1155.balance(ddo.id, artist), 2n) + assert.isTrue((await nevermined.nfts1155.balance(ddo.id, artist)) === 2n) }) }) }) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index bd9d8764c..55253b8be 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -25,7 +25,7 @@ import { sleep } from '../utils/utils' chai.use(chaiAsPromised) -const DELAY = 20000 +const DELAY = 3000 function makeTest(isCustom) { describe(`NFTs 1155 Api End-to-End (${isCustom ? 'custom' : 'builtin'} token)`, () => { @@ -156,7 +156,7 @@ function makeTest(isCustom) { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberEditions }, + nft: { amount: numberEditions, nftTransfer: true }, }, { serviceType: 'nft-access', @@ -177,7 +177,7 @@ function makeTest(isCustom) { assert.isDefined(ddo) const balance = await nevermined.nfts1155.balance(ddo.id, artist.getId()) - assert.deepEqual(balance, 5n) + assert.isTrue(balance === 5n) }) it('should give Nevermined the operator role', async () => { @@ -204,7 +204,7 @@ function makeTest(isCustom) { assert.equal(details.royaltyScheme, RoyaltyKind.Standard) assert.equal(details.royalties, 100000) assert.equal(details.owner, artist.getId()) - assert.equal(details.mintCap, 5n) + assert.isTrue(details.mintCap === 5n) assert.equal(details.nftSupply, 5n) }) @@ -329,6 +329,7 @@ function makeTest(isCustom) { { serviceType: 'nft-sales', price: assetPrice1, + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', @@ -340,13 +341,14 @@ function makeTest(isCustom) { nftContractAddress: nevermined.nfts1155.nftContract.address, cap: cappedAmount, royaltyAttributes, + preMint: true, }) ddo = await nevermined.nfts1155.create(nftAttributes, artist) assert.isDefined(ddo) const balance = await nevermined.nfts1155.balance(ddo.id, artist) - assert.equal(balance, 5n) + assert.isTrue(balance === 5n) await nevermined.nfts1155.setApprovalForAll(config.neverminedNodeAddress, true, artist) }) @@ -405,6 +407,7 @@ function makeTest(isCustom) { { serviceType: 'nft-sales', price: assetPrice1, + nft: { nftTransfer: true }, }, { serviceType: 'nft-access', diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 313560fe8..755c9c3c6 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -303,6 +303,16 @@ describe('NFT721Templates E2E', () => { it('The artist can check the payment and transfer the NFT to the collector', async () => { await nft.setApprovalForAll(transferNft721Condition.address, true, artist) + const params = { + agreementId, + did: ddo.shortId(), + nftReceiver: collector1.getId(), + lockPaymentCondition: conditionIdLockPayment[1], + nftTokenAddress: nft.address, + willBeTransferred: true, + } + console.log(JSON.stringify(params)) + await transferNft721Condition.fulfill( agreementId, ddo.shortId(), diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index e79974aee..0f288cd10 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -627,7 +627,7 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberNFTs }, + nft: { amount: numberNFTs, nftTransfer: true }, }, { serviceType: 'nft-access', @@ -938,7 +938,7 @@ describe('NFTTemplates E2E', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberNFTs }, + nft: { amount: numberNFTs, nftTransfer: true }, }, { serviceType: 'nft-access', diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index a63aa6736..76287366f 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -13,7 +13,6 @@ import { Nft721Contract, NFTAttributes, ConditionState, - NFTServiceAttributes, } from '../../src' import { ethers } from 'ethers' import { repeat } from '../utils/utils' @@ -99,12 +98,12 @@ describe('E2E Flow for NFTs with multiple services', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { ...NFTServiceAttributes.defaultValues, nftTransfer: true }, + nft: { nftTransfer: true }, }, { serviceType: 'nft-sales', price: assetPrice2, - nft: { nftTransfer: false, amount: 2n }, + nft: { nftTransfer: false }, }, { serviceType: 'nft-access', @@ -126,23 +125,22 @@ describe('E2E Flow for NFTs with multiple services', () => { assert.equal(accessServices.length, 1) assert.equal( - salesServices[0].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], + DDO.getParameterFromCondition(salesServices[0], 'lockPayment', '_amounts')[0], totalAmount1, ) + assert.equal( - salesServices[0].attributes.serviceAgreementTemplate.conditions[1].parameters[2] - .value as string, - '1', + DDO.getParameterFromCondition(salesServices[0], 'transferNFT', '_nftTransfer'), + 'true', ) assert.equal( - salesServices[1].attributes.serviceAgreementTemplate.conditions[0].parameters[3].value[0], + DDO.getParameterFromCondition(salesServices[1], 'lockPayment', '_amounts')[0], totalAmount2, ) assert.equal( - salesServices[1].attributes.serviceAgreementTemplate.conditions[1].parameters[2] - .value as string, - '2', + DDO.getParameterFromCondition(salesServices[1], 'transferNFT', '_nftTransfer'), + 'false', ) assert.isDefined(ddo.findServiceByType('metadata')) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index 5ae9ccf5f..3749657c7 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -71,6 +71,7 @@ describe('Secondary Markets', () => { // Configuration of Sale in secondary market: // Collector1 -> Collector2, the artist get 10% royalties const numberNFTs2 = 1n + const nftTransfer = true let nftPrice2 = 100n let amounts2 = [90n, 10n] let receivers2: string[] @@ -179,7 +180,7 @@ describe('Secondary Markets', () => { { serviceType: 'nft-sales', price: assetPrice1, - nft: { amount: numberNFTs }, + nft: { amount: numberNFTs, nftTransfer }, }, { serviceType: 'nft-access', @@ -361,6 +362,7 @@ describe('Secondary Markets', () => { undefined, collector1.getId(), numberNFTs2, + true, ) nftSalesServiceAgreement = { @@ -382,6 +384,7 @@ describe('Secondary Markets', () => { }, } + console.log('nftSalesServiceAgreement', JSON.stringify(nftSalesServiceAgreement)) // This Service agreement is stored on elasticsearch through the metadata api }) @@ -563,6 +566,7 @@ describe('Secondary Markets', () => { ddo, assetPrice3, numberNFTs2, + nftTransfer, collector2.getId(), token, collector2, diff --git a/src/common/helpers.ts b/src/common/helpers.ts index 843d1d68b..b3db4c78e 100644 --- a/src/common/helpers.ts +++ b/src/common/helpers.ts @@ -27,3 +27,8 @@ export const getCircularReplacer = () => { return value } } + +export const jsonReplacer = (key, value) => { + // Modify the value or return undefined to exclude the property + return typeof value === 'bigint' ? value.toString() : value +} diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index e0f1fc534..d34221dd6 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -451,6 +451,26 @@ export class DDO { return BigInt(DDO.getParameterFromCondition(service, 'transferNFT', '_numberNfts').toString()) } + /** + * Gets the nftTransfer parameter in the transferNFT condition of the service + * @param service the service to search in + * @returns if condition will do a nft transfer or a mint + */ + public static getNFTTransferFromService(service: Service): boolean { + return ( + DDO.getParameterFromCondition(service, 'transferNFT', '_nftTransfer').toString() === 'true' + ) + } + + /** + * Gets the duration parameter in the transferNFT condition of the service + * @param service the service to search in + * @returns the duration of the subscription + */ + public static getDurationFromService(service: Service): number { + return Number(DDO.getParameterFromCondition(service, 'transferNFT', '_duration').toString()) + } + /** * Given a service, condition and param name it returns the value * @param service The service where the condition is diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 460095c49..822bd43f1 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -105,7 +105,8 @@ export abstract class ContractBase extends Instantiable { progress: (data: any) => void, ): Promise { // Uncomment to debug contract calls - //console.debug(`Making contract call ....: ${name} - ${from} - ${JSON.stringify(args)}`) + // console.debug(`Making contract call ....: ${name} - ${from}`) + // console.debug(`With args - ${JSON.stringify(args)}`) const methodSignature = this.getSignatureOfMethod(name, args) const { gasLimit, value } = txparams // make the call @@ -141,6 +142,7 @@ export abstract class ContractBase extends Instantiable { } const transactionReceipt: ContractTransactionReceipt = await transactionResponse.wait() + if (progress) { progress({ stage: 'receipt', diff --git a/src/keeper/contracts/conditions/Condition.abstract.ts b/src/keeper/contracts/conditions/Condition.abstract.ts index 964223b48..9113df0ca 100644 --- a/src/keeper/contracts/conditions/Condition.abstract.ts +++ b/src/keeper/contracts/conditions/Condition.abstract.ts @@ -154,6 +154,8 @@ export abstract class Condition< txParams?: TxParameters, method: ConditionMethod = 'fulfill', ) { + const _params = await cond.params(method, additionalParams) + return this.sendFrom( method, [zeroX(cond.agreementId), ...(await cond.params(method, additionalParams))], diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts index b3ce9bc00..a520bbdbf 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts @@ -31,7 +31,6 @@ export class TransferNFT721Condition extends ProviderCondition> { @@ -61,7 +59,7 @@ export class TransferNFT721Condition extends ProviderCondition p.name === '_contractAddress') .value as string const nftHolder = transfer.parameters.find((p) => p.name === '_nftHolder').value as string @@ -103,7 +99,6 @@ export class TransferNFT721Condition extends ProviderCondition p.name === '_contractAddress') .value as string const nftHolder = transfer.parameters.find((p) => p.name === '_nftHolder').value as string @@ -130,7 +123,6 @@ export class TransferNFT721Condition extends ProviderCondition { @@ -39,8 +40,9 @@ export class NFTSalesTemplate extends BaseTemplate> { const { transferNftCondition, lockPaymentCondition, escrowPaymentCondition } = this.nevermined.keeper.conditions const agreementId = await this.agreementId(agreementIdSeed, creator) const ctx = { - ...this.standardContext(ddo, creator, serviceReference), + ...this.standardContext(ddo, creator, serviceIndex), ...parameters, } diff --git a/src/nevermined/api/ConditionsApi.ts b/src/nevermined/api/ConditionsApi.ts index 724ba4c3b..0c8c9eddd 100644 --- a/src/nevermined/api/ConditionsApi.ts +++ b/src/nevermined/api/ConditionsApi.ts @@ -429,11 +429,17 @@ export class ConditionsApi extends Instantiable { const { accessConsumer } = await template.getAgreementData(agreementId) const { agreementIdSeed, creator } = await this.nevermined.keeper.agreementStoreManager.getAgreement(agreementId) + const service = ddo.findServiceByIndex(serviceIndex) + + const nftTranfer = DDO.getNFTTransferFromService(service) + const duration = DDO.getDurationFromService(service) + const params = template.params(accessConsumer, nftAmount, duration, undefined, nftTranfer) + const instance = await template.instanceFromDDO( agreementIdSeed, ddo, creator, - template.params(accessConsumer, nftAmount), + params, serviceIndex, ) diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 6312f486e..03f5d301f 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -189,8 +189,6 @@ export abstract class RegistryBaseApi extends Instantiable { }, } as Service) - // console.log(`--- DDO After: \n${JSON.stringify(ddo)}`) - this.logger.log('Files encrypted') observer.next(CreateProgressStep.FilesEncrypted) diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 47f5bc324..dc48969d1 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -235,6 +235,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { ddo: DDO, assetPrice: AssetPrice, nftAmount: bigint, + nftTransfer: boolean, provider: string, token: Token, owner: Account, @@ -254,6 +255,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { undefined, provider || owner.getId(), nftAmount, + nftTransfer, ) const nftSalesServiceAgreement: ServiceSecondary = { diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 336a17b38..f9eb44490 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -96,7 +96,7 @@ function getParameter( case 'rewardAddress': return owner case 'numberNfts': - return nftAmount && nftAmount >= 1 ? String(nftAmount) : '1' + return nftAmount && nftAmount >= 1 ? nftAmount.toString() : '1' case 'tokenAddress': return erc20TokenContract case 'contract': From bd17944285e34a775adf83352ecd07766cf42bc4 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:49:28 +0200 Subject: [PATCH 063/151] chore: tests --- integration/nevermined/Credits.e2e.test.ts | 20 ++++++++++---------- integration/resources/ddo-nft.json | 8 ++++++++ package.json | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index 3087a8e33..8d56bcb8f 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -224,7 +224,7 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) console.log(`Balance Before: ${balanceBefore}`) console.log(`Balance Before (JSON): ${JSON.stringify(balanceBefore.toString())}`) - assert.equal(balanceBefore, 0n) + assert.isTrue(balanceBefore === 0n) try { const receipt = await nevermined.nfts1155.claim( @@ -245,7 +245,7 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) console.log(`Balance After: ${balanceAfter}`) - assert.equal(balanceAfter, subscriptionCredits) + assert.isTrue(balanceAfter === subscriptionCredits) const minted = await subscriptionNFT.getContract.getMintedEntries( subscriber.getId(), @@ -258,8 +258,8 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) - assert.equal(receiver0Balance, initialBalances.editor + assetPrice1.getAmounts()[0]) - assert.equal(receiver1Balance, initialBalances.reseller + assetPrice1.getAmounts()[1]) + assert.isTrue(receiver0Balance === initialBalances.editor + assetPrice1.getAmounts()[0]) + assert.isTrue(receiver1Balance === initialBalances.reseller + assetPrice1.getAmounts()[1]) }) it('the subscription can be checked on chain', async () => { @@ -300,9 +300,9 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { describe('As subscriber I want to get access to assets include as part of my subscription', () => { it('The Subscriber should have an NFT balance', async () => { - assert.equal( - await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()), - subscriptionCredits, + assert.isTrue( + (await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId())) === + subscriptionCredits, ) }) @@ -318,9 +318,9 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { }) it('The balance of the subscriber should be lower because credits got used', async () => { - assert.equal( - await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()), - subscriptionCredits - accessCostInCredits, + assert.isTrue( + (await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId())) === + subscriptionCredits - accessCostInCredits, ) }) }) diff --git a/integration/resources/ddo-nft.json b/integration/resources/ddo-nft.json index 4beb8f821..f0d7a94a2 100644 --- a/integration/resources/ddo-nft.json +++ b/integration/resources/ddo-nft.json @@ -184,6 +184,14 @@ "name": "_conditionId", "type": "bytes32", "value": "" + }, + { + "name": "_nftTransfer", + "type": "boolean" + }, + { + "name": "_duration", + "type": "uint256" } ], "events": [ diff --git a/package.json b/package.json index a581a193e..9b96d014b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc3", + "version": "2.0.0-rc4", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 7a1c711d9f5f969e3ae054909b17ccb297740586 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:49:57 +0200 Subject: [PATCH 064/151] chore: adding v2.0.0-rc4 Changelog updates --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3da92b1f..be21480f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc4](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc3...v2.0.0-rc4) + +> 31 July 2023 + +- chore: fixing nft tests [`c61cb5a`](https://github.com/nevermined-io/sdk-js/commit/c61cb5a851aa610d42756bad868eb57cef72909e) +- chore: tests [`bd17944`](https://github.com/nevermined-io/sdk-js/commit/bd17944285e34a775adf83352ecd07766cf42bc4) +- chore: adding v2.0.0-rc3 Changelog updates [`4d125f2`](https://github.com/nevermined-io/sdk-js/commit/4d125f2f39e7387488bf107966e9d5c2ef9b88d8) + #### [v2.0.0-rc3](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc2...v2.0.0-rc3) > 27 July 2023 From 2c0c86364c0df5e7fc51a39bd39d1044c207f27d Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 2 Aug 2023 09:49:21 +0200 Subject: [PATCH 065/151] chore: testing with rc5 --- integration/nevermined/Credits.e2e.test.ts | 47 ++++++++++++++----- package.json | 2 +- src/ddo/DDO.ts | 9 ++++ src/ddo/types.ts | 3 ++ src/keeper/contracts/NFTContractsBase.ts | 5 +- .../contracts/templates/AccessTemplate.ts | 3 ++ .../templates/BaseTemplate.abstract.ts | 16 ++++++- .../contracts/templates/ConditionTemplates.ts | 10 ++++ .../templates/NFT721AccessTemplate.ts | 10 +++- .../contracts/templates/NFTAccessTemplate.ts | 31 ++++++++---- src/models/NFTAttributes.ts | 7 +++ src/nevermined/AccessService.ts | 13 +++++ src/nevermined/api/RegistryBaseApi.ts | 1 - src/nevermined/api/nfts/NFTsBaseApi.ts | 12 +++-- src/nevermined/utils/JwtUtils.ts | 6 ++- src/services/node/NeverminedNode.ts | 6 +-- src/utils/DDOHelpers.ts | 5 ++ .../NFT1155SubscriptionUpgradeable.json | 6 +-- 18 files changed, 153 insertions(+), 39 deletions(-) diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index 8d56bcb8f..7de6808c8 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -2,7 +2,15 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' import { decodeJwt, JWTPayload } from 'jose' -import { Account, DDO, MetaData, Nevermined, AssetPrice, NFTAttributes } from '../../src' +import { + Account, + DDO, + MetaData, + Nevermined, + AssetPrice, + NFTAttributes, + jsonReplacer, +} from '../../src' import { EscrowPaymentCondition, Token, TransferNFTCondition } from '../../src/keeper' import { config } from '../config' import { getMetadata } from '../utils' @@ -137,10 +145,14 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { ], ) + console.debug(`Deployed ERC-1155 Subscription NFT on address: ${subscriptionNFT.address}`) + await nevermined.contracts.loadNft1155Api(subscriptionNFT) await subscriptionNFT.grantOperatorRole(transferNftCondition.address, editor) + assert.equal(nevermined.nfts1155.getContract.address, subscriptionNFT.address) + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ metadata: subscriptionMetadata, services: [ @@ -177,7 +189,12 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { services: [ { serviceType: 'nft-access', - nft: { duration: subscriptionDuration, amount: accessCostInCredits, nftTransfer }, + nft: { + tokenId: subscriptionDDO.shortId(), + duration: subscriptionDuration, + amount: accessCostInCredits, + nftTransfer, + }, }, ], providers: [neverminedNodeAddress], @@ -188,6 +205,10 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { assetDDO = await nevermined.nfts1155.create(nftAttributes, editor) assert.isDefined(assetDDO) console.log(`Asset DID: ${assetDDO.id}`) + + const accessService = assetDDO.findServiceByType('nft-access') + const tokenId = DDO.getTokenIdFromService(accessService) + assert.equal(tokenId, subscriptionDDO.shortId()) }) }) @@ -243,10 +264,6 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { console.log(`Got the receipt`) - const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) - console.log(`Balance After: ${balanceAfter}`) - assert.isTrue(balanceAfter === subscriptionCredits) - const minted = await subscriptionNFT.getContract.getMintedEntries( subscriber.getId(), subscriptionDDO.shortId(), @@ -290,22 +307,28 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { // subgraph event or json-rpc event? const eventValues = event.args || event + console.debug(`EVENTS: ${JSON.stringify(eventValues, jsonReplacer)}`) + assert.equal(eventValues._agreementId, agreementId) assert.equal(eventValues._did, didZeroX(subscriptionDDO.id)) // thegraph stores the addresses in lower case assert.equal(ethers.getAddress(eventValues._receiver), subscriber.getId()) }) - }) - describe('As subscriber I want to get access to assets include as part of my subscription', () => { - it('The Subscriber should have an NFT balance', async () => { - assert.isTrue( - (await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId())) === - subscriptionCredits, + it('the subscriber can check the balance with the new NFTs received', async () => { + console.log( + `Checking the balance of DID [${ + subscriptionDDO.id + }] of the subscriber ${subscriber.getId()}`, ) + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After: ${balanceAfter}`) + assert.isTrue(balanceAfter === subscriptionCredits) }) + }) + describe('As subscriber I want to get access to assets include as part of my subscription', () => { it('The collector access the files', async () => { const result = await nevermined.nfts1155.access( assetDDO.id, diff --git a/package.json b/package.json index 9b96d014b..e262aa247 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc4", + "version": "2.0.0-rc5", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index d34221dd6..ab44ad6ad 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -442,6 +442,15 @@ export class DDO { return DDO.getParameterFromCondition(service, 'transferNFT', '_nftHolder') as string } + /** + * Gets the NFT TokenId in the nftHolder condition of the service + * @param service the service to search in + * @returns the NFT Token Id + */ + public static getTokenIdFromService(service: Service): string { + return DDO.getParameterFromCondition(service, 'nftHolder', '_tokenId') as string + } + /** * Gets the number of NFTs in the transferNFT condition of the service * @param service the service to search in diff --git a/src/ddo/types.ts b/src/ddo/types.ts index 72312d8b2..b50c92744 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -722,6 +722,7 @@ export type Service = T extends ' export interface ValidationParams { agreement_id: string did: string + service_index?: number consumer_address?: string buyer?: string babysig?: Babysig @@ -742,6 +743,8 @@ export interface ServicePlugin { process(params: ValidationParams, from: Account, txparams?: TxParameters): Promise // Check if service can be granted without agreement accept(params: ValidationParams): Promise + // It registers the usage of a service + track(params: ValidationParams): Promise } export interface ServiceAgreementTemplateParameter { diff --git a/src/keeper/contracts/NFTContractsBase.ts b/src/keeper/contracts/NFTContractsBase.ts index 6d38cb814..9c4feaeed 100644 --- a/src/keeper/contracts/NFTContractsBase.ts +++ b/src/keeper/contracts/NFTContractsBase.ts @@ -120,7 +120,10 @@ export class NFTContractsBase extends ContractBase { * @returns An array of `MintedEntry` objects */ public async getMintedEntries(owner: string, did?: string): Promise { - const minted: string[][] = await this.call('getMintedEntries', did ? [owner, did] : [owner]) + const minted: string[][] = await this.call( + 'getMintedEntries', + did ? [owner, didZeroX(did)] : [owner], + ) const entries: MintedEntry[] = [] for (let i = 0; i < minted.length; i++) { diff --git a/src/keeper/contracts/templates/AccessTemplate.ts b/src/keeper/contracts/templates/AccessTemplate.ts index 40469d680..75a55ce54 100644 --- a/src/keeper/contracts/templates/AccessTemplate.ts +++ b/src/keeper/contracts/templates/AccessTemplate.ts @@ -101,4 +101,7 @@ export class AccessTemplate extends BaseTemplate { + return true + } } diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 1583cc005..82db418d4 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -9,7 +9,7 @@ import { ServiceType, ValidationParams, } from '../../../ddo' -import { Account, Condition, MetaData, NFTAttributes } from '../../../sdk' +import { Account, Condition, MetaData, NFTAttributes, jsonReplacer } from '../../../sdk' import { TxParameters } from '../ContractBase' import { ConditionInstance, ConditionState } from '../conditions' import { isAddress } from 'ethers' @@ -60,6 +60,7 @@ export abstract class BaseTemplate serviceAttributes?.nft?.duration, nftAttributes?.fulfillAccessTimeout, nftAttributes?.fulfillAccessTimelock, + serviceAttributes?.nft?.tokenId, ) serviceAgreementTemplate.conditions = _conds @@ -98,6 +99,11 @@ export abstract class BaseTemplate return false } + public async track(params: ValidationParams): Promise { + console.debug(`*** Register Usage: ${JSON.stringify(params, jsonReplacer)}`) + return true + } + public async process( params: ValidationParams, from: Account, @@ -134,17 +140,23 @@ export abstract class BaseTemplate `Agreement doesn't match ${agreement_id} should be ${agreementData.agreementId}`, ) } + for (const a of this.conditions()) { const condInstance = agreementData.instances.find( (c) => c.condition === a.contractName, ) as ConditionInstance + // console.debug(`Fulfilling with Node ${JSON.stringify(condInstance, jsonReplacer)}`) + await a.fulfillWithNode(condInstance, extra, from, txparams) const lock_state = await this.nevermined.keeper.conditionStoreManager.getCondition( condInstance.id, ) + + // console.debug(`LockState === ${JSON.stringify(lock_state, jsonReplacer)}`) + if (lock_state.state !== ConditionState.Fulfilled) { throw new Error( - `In agreement ${agreement_id}, condition ${condInstance.id} is not fulfilled`, + `In agreement ${agreement_id}, condition [${a.contractName}] ${condInstance.id} is not fulfilled`, ) } } diff --git a/src/keeper/contracts/templates/ConditionTemplates.ts b/src/keeper/contracts/templates/ConditionTemplates.ts index d8ae79185..01af41bc1 100644 --- a/src/keeper/contracts/templates/ConditionTemplates.ts +++ b/src/keeper/contracts/templates/ConditionTemplates.ts @@ -247,6 +247,11 @@ export const nft721HolderTemplate = () => ({ type: 'address', value: '', }, + { + name: '_tokenId', + type: 'bytes32', + value: '', + }, ], events: [ { @@ -328,6 +333,11 @@ export const nftHolderTemplate = () => ({ type: 'address', value: '', }, + { + name: '_tokenId', + type: 'bytes32', + value: '', + }, ], events: [ { diff --git a/src/keeper/contracts/templates/NFT721AccessTemplate.ts b/src/keeper/contracts/templates/NFT721AccessTemplate.ts index 2908028dd..1a223998f 100644 --- a/src/keeper/contracts/templates/NFT721AccessTemplate.ts +++ b/src/keeper/contracts/templates/NFT721AccessTemplate.ts @@ -89,11 +89,19 @@ export class NFT721AccessTemplate extends BaseTemplate< return true } const ddo = await this.nevermined.assets.resolve(params.did) - const service = ddo.findServiceByType(this.service()) + const service = + params.service_index && params.service_index > 0 + ? ddo.findServiceByIndex(params.service_index) + : ddo.findServiceByType(this.service()) + const contractAddress = this.nevermined.keeper.conditions.nft721HolderCondition.nftContractFromService(service) const nftContract = await this.nevermined.contracts.loadNft721(contractAddress) return (await nftContract.balanceOf(new Account(params.consumer_address))) > 0n } + + public async track(_params: ValidationParams): Promise { + return true + } } diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index 1f9def22e..004e75c4c 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -5,7 +5,7 @@ import { ValidationParams, } from '../../../ddo' import { InstantiableConfig } from '../../../Instantiable.abstract' -import { DDO, Nft1155Contract } from '../../../sdk' +import { DDO, jsonReplacer, zeroX } from '../../../sdk' import { AgreementInstance, AgreementTemplate } from './AgreementTemplate.abstract' import { BaseTemplate } from './BaseTemplate.abstract' import { nftAccessTemplateServiceAgreementTemplate } from './NFTAccessTemplate.serviceAgreementTemplate' @@ -73,6 +73,7 @@ export class NFTAccessTemplate extends BaseTemplate { + console.debug(`-- Calling accept with params: ${JSON.stringify(params, jsonReplacer)}`) if ( await this.nevermined.keeper.conditions.nftAccessCondition.checkPermissions( params.consumer_address, @@ -81,16 +82,28 @@ export class NFTAccessTemplate extends BaseTemplate 0 + ? ddo.findServiceByIndex(params.service_index) + : ddo.findServiceByType(this.service()) + + const contractAddress = DDO.getNftContractAddressFromService(service as ServiceNFTAccess) const limit = this.nevermined.keeper.conditions.nftHolderCondition.amountFromService(service) - const contractAddress = - this.nevermined.keeper.conditions.nftHolderCondition.nftContractFromService(service) - const nftContract = await Nft1155Contract.getInstance( - (this.nevermined.keeper as any).instanceConfig, - contractAddress, - ) - const balance = await nftContract.balance(params.consumer_address, params.did) + + const serviceTokenId = DDO.getTokenIdFromService(service) + const tokenId = serviceTokenId && serviceTokenId.length > 0 ? zeroX(serviceTokenId) : params.did + + const nftContract = await this.nevermined.contracts.loadNft1155(contractAddress) + + const balance = await nftContract.balance(tokenId, params.consumer_address) + return balance >= limit } + + public async track(_params: ValidationParams): Promise { + console.debug(`-- Calling track( with params`) + return true + } } diff --git a/src/models/NFTAttributes.ts b/src/models/NFTAttributes.ts index 028b8d917..f4f8ce7a9 100644 --- a/src/models/NFTAttributes.ts +++ b/src/models/NFTAttributes.ts @@ -24,12 +24,19 @@ export class NFTServiceAttributes { */ amount?: bigint + /** + * The tokenId of the NFT related with the Service. + * For example if is a NFT Access service requiring holding a NFT, this is the tokenId of the NFT + */ + tokenId?: string + static defaultValues = { serviceType: 'nft-access' as ServiceType, nftTransfer: true, // The NFT will use transfers isSubscription: false, // By default the asset doesn't represent a subscription duration: 0, // Because it's not a subscription it doesn't have a duration amount: 1n, // By default just one edition + tokenId: '', // By default no tokenId } public static getDefaultNFTServiceAttributes(): Required { diff --git a/src/nevermined/AccessService.ts b/src/nevermined/AccessService.ts index 3b021e795..46e5556cc 100644 --- a/src/nevermined/AccessService.ts +++ b/src/nevermined/AccessService.ts @@ -62,6 +62,9 @@ export class AccessService extends Instantiable implements ServicePlugin { return this.normal.accept(params) } + public async track(params: ValidationParams): Promise { + return this.normal.track(params) + } } export class NFTAccessService extends Instantiable implements ServicePlugin { @@ -110,6 +113,11 @@ export class NFTAccessService extends Instantiable implements ServicePlugin { + const ddo = await this.nevermined.assets.resolve(params.did) + const metadata = ddo.findServiceByType('metadata').attributes.main + return this.select(metadata).track(params) + } } export class NFTSalesService extends Instantiable implements ServicePlugin { @@ -158,4 +166,9 @@ export class NFTSalesService extends Instantiable implements ServicePlugin { + const ddo = await this.nevermined.assets.resolve(params.did) + const metadata = ddo.findServiceByType('metadata').attributes.main + return this.select(metadata).track(params) + } } diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 03f5d301f..d3fbb346a 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -108,7 +108,6 @@ export abstract class RegistryBaseApi extends Instantiable { nftAttributes, pricedData, ) - ddo.addService(serviceCreated) } } diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index dc48969d1..f7da25917 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -67,7 +67,6 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { throw new NFTError('Nevermined does not have operator role') } } - console.log(`REMOVE: Just before node.claimNFT`) return await this.nevermined.services.node.claimNFT( agreementId, nftHolder, @@ -383,28 +382,33 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { * @param did - The Decentralized Identifier of the NFT asset. * @param consumer - The NFT holder account. * @param destination - The download destination for the files. - * @param index - The index of the file. If unset will download all the files in the asset. + * @param fileIndex - The index of the file. If unset will download all the files in the asset. * @param agreementId - The NFT sales agreement id. * @param buyer - Key which represent the buyer * @param babySig - An elliptic curve signature + * @param serviceReference - The service reference to use. By default is nft-access. * @returns true if the access was successful or file if isToDownload is false. */ public async access( did: string, consumer: Account, destination?: string, - index?: number, + fileIndex?: number, agreementId = '0x', buyer?: string, babysig?: Babysig, + serviceReference: number | ServiceType = 'nft-access', ) { const ddo = await this.nevermined.assets.resolve(did) const { attributes } = ddo.findServiceByType('metadata') const { files } = attributes.main + const accessService = ddo.findServiceByReference(serviceReference) + const accessToken = await this.nevermined.utils.jwt.getNftAccessGrantToken( agreementId, ddo.id, + accessService.index, consumer, buyer, babysig, @@ -418,7 +422,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { const result = await this.nevermined.services.node.downloadService( files, destination, - index, + fileIndex, headers, ) diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index 708da900c..48ca9ea53 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -293,6 +293,7 @@ export class JwtUtils extends Instantiable { public async generateNftAccessGrantToken( agreementId: string, did: string, + serviceIndex: number, account: Account, buyer?: string, babysig?: Babysig, @@ -308,6 +309,7 @@ export class JwtUtils extends Instantiable { eths: 'personal', buyer, babysig, + service_index: serviceIndex, } return new EthSignJWT(params) @@ -320,6 +322,7 @@ export class JwtUtils extends Instantiable { public async getNftAccessGrantToken( agreementId: string, did: string, + serviceIndex: number, account: Account, buyer?: string, babysig?: Babysig, @@ -330,11 +333,12 @@ export class JwtUtils extends Instantiable { const grantToken = await this.generateNftAccessGrantToken( agreementId, did, + serviceIndex, account, buyer, babysig, ) - const accessToken = await this.nevermined.services.node.fetchToken(grantToken) + const accessToken = await this.nevermined.services.node.fetchToken(grantToken, 1) this.tokenCache.set(cacheKey, accessToken) return accessToken diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index b7b922c70..5ac46c87a 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -381,7 +381,6 @@ export class NeverminedNode extends Instantiable { serviceIndex?: number, ): Promise { try { - console.log(`REMOVE: Just before fetch.post`) const claimBody = JSON.stringify({ agreementId, did, @@ -394,7 +393,6 @@ export class NeverminedNode extends Instantiable { console.log(`REMOVE: Claim body: ${claimBody}`) const response = await this.nevermined.utils.fetch.post(this.getClaimNftEndpoint(), claimBody) - console.log(`REMOVE: we claimed`) if (!response.ok) { throw new HttpError(`${response.statusText} ${response.url}`, response.status) } @@ -404,11 +402,11 @@ export class NeverminedNode extends Instantiable { } } - public async fetchToken(grantToken: string): Promise { + public async fetchToken(grantToken: string, numberTries = 3): Promise { const response = await this.nevermined.utils.fetch.fetchToken( this.getFetchTokenEndpoint(), grantToken, - 5, + numberTries, ) if (!response.ok) { diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index f9eb44490..97bdbad2d 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -36,6 +36,7 @@ export function getConditionsByParams( duration = 0, fulfillAccessTimeout = 0, fulfillAccessTimelock = 0, + tokenId = '', ): ServiceAgreementTemplateCondition[] { return conditions .map((condition) => { @@ -62,6 +63,7 @@ export function getConditionsByParams( nftAmount, nftTransfer, duration, + tokenId, ), })), })) @@ -78,6 +80,7 @@ function getParameter( nftAmount = 1n, nftTransfer = false, duration = 0, + tokenId?: string, ): ServiceAgreementTemplateParameter { const getValue = (name) => { switch (name) { @@ -108,6 +111,8 @@ function getParameter( return String(nftTransfer) case 'duration': return String(duration) + case 'tokenId': + return tokenId ? tokenId : '' } return '' diff --git a/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json index d9037a2b3..ac2f54b0b 100644 --- a/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json +++ b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json @@ -867,7 +867,7 @@ }, { "internalType": "uint256", - "name": "id", + "name": "tokenId", "type": "uint256" }, { @@ -1331,8 +1331,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50613f4d806100206000396000f3fe608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e7b565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ebd565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612eda565b6107f3565b005b6102d161081d565b6040516102889190612f47565b6102d16102ec366004612f5a565b6108ac565b6102a46102ff366004612eda565b3b151590565b6102c7610313366004612f73565b610951565b61032b6103263660046130e7565b610977565b6040516102889190613193565b6102c76103463660046131a7565b610b7d565b61027e610359366004612f5a565b610bb7565b6102c761036c366004612eda565b610bcc565b61038461037f366004612f73565b610c37565b6040516102889291906131e3565b6102c76103a0366004613262565b610c8d565b6102c76103b336600461330f565b610ceb565b6102c76103c636600461330f565b610d0c565b6102c7610d96565b6102c76103e136600461333f565b610db7565b6103f96103f4366004612f5a565b610ed9565b60405161028894939291906133bc565b61041c6104173660046133ed565b610fd6565b6040516102889190613481565b6102a4610437366004612eda565b6110ff565b61032b61044a366004612f5a565b90565b61027e61045b366004613494565b611124565b6102a461046e366004612eda565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134d0565b61119f565b61027e6104c9366004612eda565b6001600160a01b031690565b61027e600080516020613ed883398151915281565b61032b61147c565b6102a461050036600461330f565b61148b565b6102d16114b6565b6102c761051b366004613526565b6114c4565b6102c761052e36600461355e565b6114f6565b61027e600081565b6102c76105493660046135ad565b611529565b61032b61153b565b6102c7610564366004612eda565b61154a565b6102c7610577366004612f73565b6115b2565b6102c761058a3660046135db565b6115c4565b61032b611637565b6102c76105a536600461363a565b6116c2565b6102c76105b836600461330f565b61171e565b6102c76105cb36600461333f565b61173a565b6102d161181a565b6102a46105e636600461366e565b6118ac565b60ff5461032b906001600160a01b031681565b61061161060c366004612e7b565b6118ed565b604051610288919061369c565b61041c61062c366004612e7b565b611988565b6102c761063f3660046136f5565b611a69565b6102c7610652366004612eda565b611ac0565b6102c7610665366004613751565b611b36565b6102c761067836600461333f565b611e78565b60008061068a8484611ed5565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613786565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613786565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613786565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613786565b9060005260206000209060030201600001548261079991906137b2565b91505b806107a6816137c5565b915050610690565b509150505b92915050565b60006107c482611f08565b806107d357506107d382611f29565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611f79565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137de565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137de565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137de565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611fe8565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611ff7565b9050806001600160a01b038116633f2f5ee26109d2611fe8565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613818565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613786565b60200260200101516040518263ffffffff1660e01b8152600401610a8a9190613193565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137c5565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611fe8565b610bad5760405162461bcd60e51b8152600401610ba490613876565b60405180910390fd5b6109738282612091565b600090815260c9602052604090206001015490565b610bd4611fe8565b6001600160a01b0316610be561147c565b6001600160a01b03161480610c005750610c0061046e611fe8565b610c1c5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed8833981519152826120b7565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138d1565b610c8391906138e8565b9150509250929050565b610c95611fe8565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611fe8565b610cd75760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856120c1565b5050505050565b610cf482610bb7565b610cfd816122b2565b610d0783836122c3565b505050565b610d14611fe8565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b610973828261234a565b610db5600080516020613ed8833981519152610db0611fe8565b61234a565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de6306123cf565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611e78565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137de565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612f95565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613786565b60200260200101518583815181106110bd576110bd613786565b602002602001015161067d565b8282815181106110dc576110dc613786565b60209081029190910101526110f0816137c5565b9050611085565b509392505050565b6000611109611637565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613786565b60200260200101518261115891906137b2565b915080611164816137c5565b91505061112a565b5092915050565b60006107b3600080516020613ed88339815191528361148b565b611195611f79565b610db560006123de565b6111aa61046e611fe8565b806111cd57506111b861147c565b6001600160a01b0316846001600160a01b0316145b8061125d575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa15801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190613958565b6001600160a01b0316611252611fe8565b6001600160a01b0316145b6112a25760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff166112f65760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc60205260409020600201541561136e57600083815260fc6020526040902060028101546001909101546113319084906137b2565b111561136e5760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc60205260408120600101805484929061138f9084906137b2565b9091555050610102546001600160a01b031663bb794d92846113af611fe8565b85436040516020016113c4949392919061398c565b604051602081830303815290604052805190602001208560001b6113e6611fe8565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161142694939291906139c8565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114699190613a08565b5061147684848484612430565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137de565b6114cf61046e611fe8565b6114eb5760405162461bcd60e51b8152600401610ba490613876565b610d0783838361254e565b61150161046e611fe8565b61151d5760405162461bcd60e51b8152600401610ba490613876565b611476848484846125e6565b610973611534611fe8565b838361261a565b60ff546001600160a01b031690565b611552611fe8565b6001600160a01b031661156361147c565b6001600160a01b0316148061157e575061157e61046e611fe8565b61159a5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed88339815191528261234a565b6109736115bd611fe8565b8383611b36565b6115d08585858461119f565b60006115dc8686611ed5565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b60008061164261153b565b90506001600160a01b03811661165a57600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc9190613958565b91505090565b6116ca611fe8565b6001600160a01b03166116db61147c565b6001600160a01b031614806116f657506116f661046e611fe8565b6117125760405162461bcd60e51b8152600401610ba4906138a1565b60fe6109738282613a6b565b61172782610bb7565b611730816122b2565b610d07838361234a565b600054610100900460ff166117615760405162461bcd60e51b8152600401610ba490613b2a565b611780600080516020613ed883398151915261177b611fe8565b6120b7565b611798600080516020613ed8833981519152856120b7565b6117b0600080516020613ed8833981519152866120b7565b6117b9816116c2565b6101006117c68482613a6b565b506101016117d48382613a6b565b5061010280546001600160a01b0319166001600160a01b0386161790556117f9611fe8565b6001600160a01b0316856001600160a01b031614610ce457610ce485611ac0565b606060fe8054611829906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054611855906137de565b80156118a25780601f10611877576101008083540402835291602001916118a2565b820191906000526020600020905b81548152906001019060200180831161188557829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff16806118e657506118e682611173565b9392505050565b606061010360006118fe8585611ed5565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561197c578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508152602001906001019061192c565b50505050905092915050565b606060006119968484611ed5565b60008181526101036020526040812054919250906001600160401b038111156119c1576119c1612f95565b6040519080825280602002602001820160405280156119ea578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae57600083815261010360205260409020805482908110611a2857611a28613786565b906000526020600020906003020160020154828281518110611a4c57611a4c613786565b602090810291909101015280611a61816137c5565b9150506119f0565b611a71611fe8565b6001600160a01b0316856001600160a01b03161480611a975750611a97856105e6611fe8565b611ab35760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856126fa565b611ac8611f79565b6001600160a01b038116611b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c34816123de565b80611b41848461282f565b1015611b9b5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b611ba661046e611fe8565b80611bc95750611bb4611fe8565b6001600160a01b0316836001600160a01b0316145b80611bdb5750611bdb836105e6611fe8565b611c395760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611c5a908490613b75565b9091555050610102546001600160a01b031663bb794d9283611c7a611fe8565b8443604051602001611c8f9493929190613b9f565b604051602081830303815290604052805190602001208460001b611cb1611fe8565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611cf19493929190613bc8565b6020604051808303816000875af1158015611d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d349190613a08565b506000611d418484611ed5565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611d7f57611d7f613786565b9060005260206000209060030201600001548211611de657600083815261010360205260409020805483919083908110611dbb57611dbb613786565b90600052602060002090600302016000016000828254611ddb9190613b75565b90915550610ed19050565b600083815261010360205260409020805482908110611e0757611e07613786565b90600052602060002090600302016000015482611e249190613b75565b60008481526101036020526040902080549193509082908110611e4957611e49613786565b600091825260208220600390910201818155600181018290556002015580611e70816137c5565b915050611d47565b600054610100900460ff16611e9f5760405162461bcd60e51b8152600401610ba490613b2a565b611ea76128c2565b611eaf6128c2565b611eb8816128e9565b611ec0612919565b611ec86128c2565b610ce4858585858561173a565b60008282604051602001611eea9291906131e3565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611f5a57506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611f81611fe8565b6001600160a01b0316611f9261147c565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611ff2612950565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b03811661208c5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d078282613a6b565b61097382826122c3565b81518351146121235760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b0384166121495760405162461bcd60e51b8152600401610ba490613c08565b6000612153611fe8565b905061216381878787878761297e565b60005b845181101561224c57600085828151811061218357612183613786565b6020026020010151905060008583815181106121a1576121a1613786565b60209081029190910181015160008481526097835260408082206001600160a01b038e1683529093529190912054909150818110156121f25760405162461bcd60e51b8152600401610ba490613c4d565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906122319084906137b2565b9250508190555050505080612245906137c5565b9050612166565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161229c929190613c97565b60405180910390a4610ed18187878787876129e5565b610c34816122be611fe8565b612b47565b6122cd828261148b565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612306611fe8565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612354828261148b565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916905561238b611fe8565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0384166124905760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b600061249a611fe8565b905060006124a785612ba0565b905060006124b485612ba0565b90506124c58360008985858961297e565b60008681526097602090815260408083206001600160a01b038b168452909152812080548792906124f79084906137b2565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613ef8833981519152910160405180910390a461254583600089898989612beb565b50505050505050565b620f424081111561259e5760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce48282613a6b565b816001600160a01b0316836001600160a01b03160361268d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166127205760405162461bcd60e51b8152600401610ba490613c08565b600061272a611fe8565b9050600061273785612ba0565b9050600061274485612ba0565b905061275483898985858961297e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156127975760405162461bcd60e51b8152600401610ba490613c4d565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906127d69084906137b2565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613ef8833981519152910160405180910390a4612824848a8a8a8a8a612beb565b505050505050505050565b60006001600160a01b03831661289a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613b2a565b600054610100900460ff166129105760405162461bcd60e51b8152600401610ba490613b2a565b610c3481612cad565b600054610100900460ff166129405760405162461bcd60e51b8152600401610ba490613b2a565b610db561294b611fe8565b6123de565b6000601436108015906129675750612967336110ff565b15612979575060131936013560601c90565b503390565b6001600160a01b038516158061299b57506001600160a01b038416155b806129ac57506129ac61046e611fe8565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6129f7846001600160a01b03166123cf565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612a309089908990889088908890600401613cc5565b6020604051808303816000875af1925050508015612a6b575060408051601f3d908101601f19168201909252612a6891810190613d03565b60015b612b1757612a77613d20565b806308c379a003612ab05750612a8b613d3b565b80612a965750612ab2565b8060405162461bcd60e51b8152600401610ba49190612f47565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b612b51828261148b565b61097357612b5e81612cb9565b612b69836020612ccb565b604051602001612b7a929190613e0c565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f47565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612bda57612bda613786565b602090810291909101015292915050565b612bfd846001600160a01b03166123cf565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c369089908990889088908890600401613e7b565b6020604051808303816000875af1925050508015612c71575060408051601f3d908101601f19168201909252612c6e91810190613d03565b60015b612c7d57612a77613d20565b6001600160e01b0319811663f23a6e6160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b60996109738282613a6b565b60606107b36001600160a01b03831660145b60606000612cda8360026138d1565b612ce59060026137b2565b6001600160401b03811115612cfc57612cfc612f95565b6040519080825280601f01601f191660200182016040528015612d26576020820181803683370190505b509050600360fc1b81600081518110612d4157612d41613786565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7057612d70613786565b60200101906001600160f81b031916908160001a9053506000612d948460026138d1565b612d9f9060016137b2565b90505b6001811115612e17576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612dd357612dd3613786565b1a60f81b828281518110612de957612de9613786565b60200101906001600160f81b031916908160001a90535060049490941c93612e1081613ec0565b9050612da2565b5083156118e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e8e57600080fd5b8235612e9981612e66565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612ecf57600080fd5b81356118e681612ea7565b600060208284031215612eec57600080fd5b81356118e681612e66565b60005b83811015612f12578181015183820152602001612efa565b50506000910152565b60008151808452612f33816020860160208601612ef7565b601f01601f19169290920160200192915050565b6020815260006118e66020830184612f1b565b600060208284031215612f6c57600080fd5b5035919050565b60008060408385031215612f8657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fd057612fd0612f95565b6040525050565b600082601f830112612fe857600080fd5b81356001600160401b0381111561300157613001612f95565b604051613018601f8301601f191660200182612fab565b81815284602083860101111561302d57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561306357613063612f95565b5060051b60200190565b600082601f83011261307e57600080fd5b8135602061308b8261304a565b6040516130988282612fab565b83815260059390931b85018201928281019150868411156130b857600080fd5b8286015b848110156130dc5780356130cf81612e66565b83529183019183016130bc565b509695505050505050565b600080600080608085870312156130fd57600080fd5b84356001600160401b038082111561311457600080fd5b61312088838901612fd7565b9550602087013591508082111561313657600080fd5b61314288838901612fd7565b9450604087013591508082111561315857600080fd5b61316488838901612fd7565b9350606087013591508082111561317a57600080fd5b506131878782880161306d565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131ba57600080fd5b8235915060208301356001600160401b038111156131d757600080fd5b610c8385828601612fd7565b6001600160a01b03929092168252602082015260400190565b600082601f83011261320d57600080fd5b8135602061321a8261304a565b6040516132278282612fab565b83815260059390931b850182019282810191508684111561324757600080fd5b8286015b848110156130dc578035835291830191830161324b565b600080600080600060a0868803121561327a57600080fd5b853561328581612e66565b9450602086013561329581612e66565b935060408601356001600160401b03808211156132b157600080fd5b6132bd89838a016131fc565b945060608801359150808211156132d357600080fd5b6132df89838a016131fc565b935060808801359150808211156132f557600080fd5b5061330288828901612fd7565b9150509295509295909350565b6000806040838503121561332257600080fd5b82359150602083013561333481612e66565b809150509250929050565b600080600080600060a0868803121561335757600080fd5b853561336281612e66565b9450602086013561337281612e66565b935060408601356001600160401b038082111561338e57600080fd5b61339a89838a01612fd7565b945060608801359150808211156133b057600080fd5b6132df89838a01612fd7565b84151581528360208201528260408201526080606082015260006133e36080830184612f1b565b9695505050505050565b6000806040838503121561340057600080fd5b82356001600160401b038082111561341757600080fd5b6134238683870161306d565b9350602085013591508082111561343957600080fd5b50610c83858286016131fc565b600081518084526020808501945080840160005b838110156134765781518752958201959082019060010161345a565b509495945050505050565b6020815260006118e66020830184613446565b6000602082840312156134a657600080fd5b81356001600160401b038111156134bc57600080fd5b6134c8848285016131fc565b949350505050565b600080600080608085870312156134e657600080fd5b84356134f181612e66565b9350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b61318787828801612fd7565b60008060006060848603121561353b57600080fd5b83359250602084013561354d81612e66565b929592945050506040919091013590565b6000806000806080858703121561357457600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b8015158114610c3457600080fd5b600080604083850312156135c057600080fd5b82356135cb81612e66565b915060208301356133348161359f565b600080600080600060a086880312156135f357600080fd5b85356135fe81612e66565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b61330288828901612fd7565b60006020828403121561364c57600080fd5b81356001600160401b0381111561366257600080fd5b6134c884828501612fd7565b6000806040838503121561368157600080fd5b823561368c81612e66565b9150602083013561333481612e66565b602080825282518282018190526000919060409081850190868401855b828110156136e857815180518552868101518786015285015185850152606090930192908501906001016136b9565b5091979650505050505050565b600080600080600060a0868803121561370d57600080fd5b853561371881612e66565b9450602086013561372881612e66565b9350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b60008060006060848603121561376657600080fd5b833561377181612e66565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b361379c565b6000600182016137d7576137d761379c565b5060010190565b600181811c908216806137f257607f821691505b60208210810361381257634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061384490830186612f1b565b82810360608401526138568186612f1b565b9050828103608084015261386a8185612f1b565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b361379c565b60008261390557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561396a57600080fd5b81516118e681612e66565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613975565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613975565b600060208284031215613a1a57600080fd5b81516118e68161359f565b601f821115610d0757600081815260208120601f850160051c81016020861015613a4c5750805b601f850160051c820191505b81811015610ed157828155600101613a58565b81516001600160401b03811115613a8457613a84612f95565b613a9881613a9284546137de565b84613a25565b602080601f831160018114613acd5760008415613ab55750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613afc57888601518255948401946001909101908401613add565b5085821015613b1a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b361379c565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613b88565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613b88565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613caa6040830185613446565b8281036020840152613cbc8185613446565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090613cf190830186613446565b82810360608401526138568186613446565b600060208284031215613d1557600080fd5b81516118e681612ea7565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d495790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d7857505050505090565b8285019150815181811115613d905750505050505090565b843d8701016020828501011115613daa5750505050505090565b613db960208286010187612fab565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e3e816017850160208801612ef7565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e6f816028840160208801612ef7565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613eb590830184612f1b565b979650505050505050565b600081613ecf57613ecf61379c565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220acddfb70104e79f1ac2b78e25c39a2d66eeec2fe68b7ba2188c38257a7cfd96264736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e7b565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ebd565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612eda565b6107f3565b005b6102d161081d565b6040516102889190612f47565b6102d16102ec366004612f5a565b6108ac565b6102a46102ff366004612eda565b3b151590565b6102c7610313366004612f73565b610951565b61032b6103263660046130e7565b610977565b6040516102889190613193565b6102c76103463660046131a7565b610b7d565b61027e610359366004612f5a565b610bb7565b6102c761036c366004612eda565b610bcc565b61038461037f366004612f73565b610c37565b6040516102889291906131e3565b6102c76103a0366004613262565b610c8d565b6102c76103b336600461330f565b610ceb565b6102c76103c636600461330f565b610d0c565b6102c7610d96565b6102c76103e136600461333f565b610db7565b6103f96103f4366004612f5a565b610ed9565b60405161028894939291906133bc565b61041c6104173660046133ed565b610fd6565b6040516102889190613481565b6102a4610437366004612eda565b6110ff565b61032b61044a366004612f5a565b90565b61027e61045b366004613494565b611124565b6102a461046e366004612eda565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134d0565b61119f565b61027e6104c9366004612eda565b6001600160a01b031690565b61027e600080516020613ed883398151915281565b61032b61147c565b6102a461050036600461330f565b61148b565b6102d16114b6565b6102c761051b366004613526565b6114c4565b6102c761052e36600461355e565b6114f6565b61027e600081565b6102c76105493660046135ad565b611529565b61032b61153b565b6102c7610564366004612eda565b61154a565b6102c7610577366004612f73565b6115b2565b6102c761058a3660046135db565b6115c4565b61032b611637565b6102c76105a536600461363a565b6116c2565b6102c76105b836600461330f565b61171e565b6102c76105cb36600461333f565b61173a565b6102d161181a565b6102a46105e636600461366e565b6118ac565b60ff5461032b906001600160a01b031681565b61061161060c366004612e7b565b6118ed565b604051610288919061369c565b61041c61062c366004612e7b565b611988565b6102c761063f3660046136f5565b611a69565b6102c7610652366004612eda565b611ac0565b6102c7610665366004613751565b611b36565b6102c761067836600461333f565b611e78565b60008061068a8484611ed5565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613786565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613786565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613786565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613786565b9060005260206000209060030201600001548261079991906137b2565b91505b806107a6816137c5565b915050610690565b509150505b92915050565b60006107c482611f08565b806107d357506107d382611f29565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611f79565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137de565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137de565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137de565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611fe8565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611ff7565b9050806001600160a01b038116633f2f5ee26109d2611fe8565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613818565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613786565b60200260200101516040518263ffffffff1660e01b8152600401610a8a9190613193565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137c5565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611fe8565b610bad5760405162461bcd60e51b8152600401610ba490613876565b60405180910390fd5b6109738282612091565b600090815260c9602052604090206001015490565b610bd4611fe8565b6001600160a01b0316610be561147c565b6001600160a01b03161480610c005750610c0061046e611fe8565b610c1c5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed8833981519152826120b7565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138d1565b610c8391906138e8565b9150509250929050565b610c95611fe8565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611fe8565b610cd75760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856120c1565b5050505050565b610cf482610bb7565b610cfd816122b2565b610d0783836122c3565b505050565b610d14611fe8565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b610973828261234a565b610db5600080516020613ed8833981519152610db0611fe8565b61234a565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de6306123cf565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611e78565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137de565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612f95565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613786565b60200260200101518583815181106110bd576110bd613786565b602002602001015161067d565b8282815181106110dc576110dc613786565b60209081029190910101526110f0816137c5565b9050611085565b509392505050565b6000611109611637565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613786565b60200260200101518261115891906137b2565b915080611164816137c5565b91505061112a565b5092915050565b60006107b3600080516020613ed88339815191528361148b565b611195611f79565b610db560006123de565b6111aa61046e611fe8565b806111cd57506111b861147c565b6001600160a01b0316846001600160a01b0316145b8061125d575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa15801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190613958565b6001600160a01b0316611252611fe8565b6001600160a01b0316145b6112a25760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff166112f65760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc60205260409020600201541561136e57600083815260fc6020526040902060028101546001909101546113319084906137b2565b111561136e5760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc60205260408120600101805484929061138f9084906137b2565b9091555050610102546001600160a01b031663bb794d92846113af611fe8565b85436040516020016113c4949392919061398c565b604051602081830303815290604052805190602001208560001b6113e6611fe8565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161142694939291906139c8565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114699190613a08565b5061147684848484612430565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137de565b6114cf61046e611fe8565b6114eb5760405162461bcd60e51b8152600401610ba490613876565b610d0783838361254e565b61150161046e611fe8565b61151d5760405162461bcd60e51b8152600401610ba490613876565b611476848484846125e6565b610973611534611fe8565b838361261a565b60ff546001600160a01b031690565b611552611fe8565b6001600160a01b031661156361147c565b6001600160a01b0316148061157e575061157e61046e611fe8565b61159a5760405162461bcd60e51b8152600401610ba4906138a1565b610c34600080516020613ed88339815191528261234a565b6109736115bd611fe8565b8383611b36565b6115d08585858461119f565b60006115dc8686611ed5565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b60008061164261153b565b90506001600160a01b03811661165a57600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc9190613958565b91505090565b6116ca611fe8565b6001600160a01b03166116db61147c565b6001600160a01b031614806116f657506116f661046e611fe8565b6117125760405162461bcd60e51b8152600401610ba4906138a1565b60fe6109738282613a6b565b61172782610bb7565b611730816122b2565b610d07838361234a565b600054610100900460ff166117615760405162461bcd60e51b8152600401610ba490613b2a565b611780600080516020613ed883398151915261177b611fe8565b6120b7565b611798600080516020613ed8833981519152856120b7565b6117b0600080516020613ed8833981519152866120b7565b6117b9816116c2565b6101006117c68482613a6b565b506101016117d48382613a6b565b5061010280546001600160a01b0319166001600160a01b0386161790556117f9611fe8565b6001600160a01b0316856001600160a01b031614610ce457610ce485611ac0565b606060fe8054611829906137de565b80601f0160208091040260200160405190810160405280929190818152602001828054611855906137de565b80156118a25780601f10611877576101008083540402835291602001916118a2565b820191906000526020600020905b81548152906001019060200180831161188557829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff16806118e657506118e682611173565b9392505050565b606061010360006118fe8585611ed5565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561197c578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508152602001906001019061192c565b50505050905092915050565b606060006119968484611ed5565b60008181526101036020526040812054919250906001600160401b038111156119c1576119c1612f95565b6040519080825280602002602001820160405280156119ea578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae57600083815261010360205260409020805482908110611a2857611a28613786565b906000526020600020906003020160020154828281518110611a4c57611a4c613786565b602090810291909101015280611a61816137c5565b9150506119f0565b611a71611fe8565b6001600160a01b0316856001600160a01b03161480611a975750611a97856105e6611fe8565b611ab35760405162461bcd60e51b8152600401610ba49061390a565b610ce485858585856126fa565b611ac8611f79565b6001600160a01b038116611b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c34816123de565b80611b41848461282f565b1015611b9b5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b611ba661046e611fe8565b80611bc95750611bb4611fe8565b6001600160a01b0316836001600160a01b0316145b80611bdb5750611bdb836105e6611fe8565b611c395760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611c5a908490613b75565b9091555050610102546001600160a01b031663bb794d9283611c7a611fe8565b8443604051602001611c8f9493929190613b9f565b604051602081830303815290604052805190602001208460001b611cb1611fe8565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611cf19493929190613bc8565b6020604051808303816000875af1158015611d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d349190613a08565b506000611d418484611ed5565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611d7f57611d7f613786565b9060005260206000209060030201600001548211611de657600083815261010360205260409020805483919083908110611dbb57611dbb613786565b90600052602060002090600302016000016000828254611ddb9190613b75565b90915550610ed19050565b600083815261010360205260409020805482908110611e0757611e07613786565b90600052602060002090600302016000015482611e249190613b75565b60008481526101036020526040902080549193509082908110611e4957611e49613786565b600091825260208220600390910201818155600181018290556002015580611e70816137c5565b915050611d47565b600054610100900460ff16611e9f5760405162461bcd60e51b8152600401610ba490613b2a565b611ea76128c2565b611eaf6128c2565b611eb8816128e9565b611ec0612919565b611ec86128c2565b610ce4858585858561173a565b60008282604051602001611eea9291906131e3565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611f5a57506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611f81611fe8565b6001600160a01b0316611f9261147c565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611ff2612950565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b03811661208c5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d078282613a6b565b61097382826122c3565b81518351146121235760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b0384166121495760405162461bcd60e51b8152600401610ba490613c08565b6000612153611fe8565b905061216381878787878761297e565b60005b845181101561224c57600085828151811061218357612183613786565b6020026020010151905060008583815181106121a1576121a1613786565b60209081029190910181015160008481526097835260408082206001600160a01b038e1683529093529190912054909150818110156121f25760405162461bcd60e51b8152600401610ba490613c4d565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906122319084906137b2565b9250508190555050505080612245906137c5565b9050612166565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161229c929190613c97565b60405180910390a4610ed18187878787876129e5565b610c34816122be611fe8565b612b47565b6122cd828261148b565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612306611fe8565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612354828261148b565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916905561238b611fe8565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0384166124905760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b600061249a611fe8565b905060006124a785612ba0565b905060006124b485612ba0565b90506124c58360008985858961297e565b60008681526097602090815260408083206001600160a01b038b168452909152812080548792906124f79084906137b2565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613ef8833981519152910160405180910390a461254583600089898989612beb565b50505050505050565b620f424081111561259e5760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce48282613a6b565b816001600160a01b0316836001600160a01b03160361268d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166127205760405162461bcd60e51b8152600401610ba490613c08565b600061272a611fe8565b9050600061273785612ba0565b9050600061274485612ba0565b905061275483898985858961297e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156127975760405162461bcd60e51b8152600401610ba490613c4d565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906127d69084906137b2565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613ef8833981519152910160405180910390a4612824848a8a8a8a8a612beb565b505050505050505050565b60006001600160a01b03831661289a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613b2a565b600054610100900460ff166129105760405162461bcd60e51b8152600401610ba490613b2a565b610c3481612cad565b600054610100900460ff166129405760405162461bcd60e51b8152600401610ba490613b2a565b610db561294b611fe8565b6123de565b6000601436108015906129675750612967336110ff565b15612979575060131936013560601c90565b503390565b6001600160a01b038516158061299b57506001600160a01b038416155b806129ac57506129ac61046e611fe8565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6129f7846001600160a01b03166123cf565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612a309089908990889088908890600401613cc5565b6020604051808303816000875af1925050508015612a6b575060408051601f3d908101601f19168201909252612a6891810190613d03565b60015b612b1757612a77613d20565b806308c379a003612ab05750612a8b613d3b565b80612a965750612ab2565b8060405162461bcd60e51b8152600401610ba49190612f47565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b612b51828261148b565b61097357612b5e81612cb9565b612b69836020612ccb565b604051602001612b7a929190613e0c565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f47565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612bda57612bda613786565b602090810291909101015292915050565b612bfd846001600160a01b03166123cf565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c369089908990889088908890600401613e7b565b6020604051808303816000875af1925050508015612c71575060408051601f3d908101601f19168201909252612c6e91810190613d03565b60015b612c7d57612a77613d20565b6001600160e01b0319811663f23a6e6160e01b146125455760405162461bcd60e51b8152600401610ba490613dc4565b60996109738282613a6b565b60606107b36001600160a01b03831660145b60606000612cda8360026138d1565b612ce59060026137b2565b6001600160401b03811115612cfc57612cfc612f95565b6040519080825280601f01601f191660200182016040528015612d26576020820181803683370190505b509050600360fc1b81600081518110612d4157612d41613786565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7057612d70613786565b60200101906001600160f81b031916908160001a9053506000612d948460026138d1565b612d9f9060016137b2565b90505b6001811115612e17576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612dd357612dd3613786565b1a60f81b828281518110612de957612de9613786565b60200101906001600160f81b031916908160001a90535060049490941c93612e1081613ec0565b9050612da2565b5083156118e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e8e57600080fd5b8235612e9981612e66565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612ecf57600080fd5b81356118e681612ea7565b600060208284031215612eec57600080fd5b81356118e681612e66565b60005b83811015612f12578181015183820152602001612efa565b50506000910152565b60008151808452612f33816020860160208601612ef7565b601f01601f19169290920160200192915050565b6020815260006118e66020830184612f1b565b600060208284031215612f6c57600080fd5b5035919050565b60008060408385031215612f8657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fd057612fd0612f95565b6040525050565b600082601f830112612fe857600080fd5b81356001600160401b0381111561300157613001612f95565b604051613018601f8301601f191660200182612fab565b81815284602083860101111561302d57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561306357613063612f95565b5060051b60200190565b600082601f83011261307e57600080fd5b8135602061308b8261304a565b6040516130988282612fab565b83815260059390931b85018201928281019150868411156130b857600080fd5b8286015b848110156130dc5780356130cf81612e66565b83529183019183016130bc565b509695505050505050565b600080600080608085870312156130fd57600080fd5b84356001600160401b038082111561311457600080fd5b61312088838901612fd7565b9550602087013591508082111561313657600080fd5b61314288838901612fd7565b9450604087013591508082111561315857600080fd5b61316488838901612fd7565b9350606087013591508082111561317a57600080fd5b506131878782880161306d565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131ba57600080fd5b8235915060208301356001600160401b038111156131d757600080fd5b610c8385828601612fd7565b6001600160a01b03929092168252602082015260400190565b600082601f83011261320d57600080fd5b8135602061321a8261304a565b6040516132278282612fab565b83815260059390931b850182019282810191508684111561324757600080fd5b8286015b848110156130dc578035835291830191830161324b565b600080600080600060a0868803121561327a57600080fd5b853561328581612e66565b9450602086013561329581612e66565b935060408601356001600160401b03808211156132b157600080fd5b6132bd89838a016131fc565b945060608801359150808211156132d357600080fd5b6132df89838a016131fc565b935060808801359150808211156132f557600080fd5b5061330288828901612fd7565b9150509295509295909350565b6000806040838503121561332257600080fd5b82359150602083013561333481612e66565b809150509250929050565b600080600080600060a0868803121561335757600080fd5b853561336281612e66565b9450602086013561337281612e66565b935060408601356001600160401b038082111561338e57600080fd5b61339a89838a01612fd7565b945060608801359150808211156133b057600080fd5b6132df89838a01612fd7565b84151581528360208201528260408201526080606082015260006133e36080830184612f1b565b9695505050505050565b6000806040838503121561340057600080fd5b82356001600160401b038082111561341757600080fd5b6134238683870161306d565b9350602085013591508082111561343957600080fd5b50610c83858286016131fc565b600081518084526020808501945080840160005b838110156134765781518752958201959082019060010161345a565b509495945050505050565b6020815260006118e66020830184613446565b6000602082840312156134a657600080fd5b81356001600160401b038111156134bc57600080fd5b6134c8848285016131fc565b949350505050565b600080600080608085870312156134e657600080fd5b84356134f181612e66565b9350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b61318787828801612fd7565b60008060006060848603121561353b57600080fd5b83359250602084013561354d81612e66565b929592945050506040919091013590565b6000806000806080858703121561357457600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561351a57600080fd5b8015158114610c3457600080fd5b600080604083850312156135c057600080fd5b82356135cb81612e66565b915060208301356133348161359f565b600080600080600060a086880312156135f357600080fd5b85356135fe81612e66565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b61330288828901612fd7565b60006020828403121561364c57600080fd5b81356001600160401b0381111561366257600080fd5b6134c884828501612fd7565b6000806040838503121561368157600080fd5b823561368c81612e66565b9150602083013561333481612e66565b602080825282518282018190526000919060409081850190868401855b828110156136e857815180518552868101518786015285015185850152606090930192908501906001016136b9565b5091979650505050505050565b600080600080600060a0868803121561370d57600080fd5b853561371881612e66565b9450602086013561372881612e66565b9350604086013592506060860135915060808601356001600160401b0381111561362e57600080fd5b60008060006060848603121561376657600080fd5b833561377181612e66565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b361379c565b6000600182016137d7576137d761379c565b5060010190565b600181811c908216806137f257607f821691505b60208210810361381257634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061384490830186612f1b565b82810360608401526138568186612f1b565b9050828103608084015261386a8185612f1b565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b361379c565b60008261390557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561396a57600080fd5b81516118e681612e66565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613975565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613975565b600060208284031215613a1a57600080fd5b81516118e68161359f565b601f821115610d0757600081815260208120601f850160051c81016020861015613a4c5750805b601f850160051c820191505b81811015610ed157828155600101613a58565b81516001600160401b03811115613a8457613a84612f95565b613a9881613a9284546137de565b84613a25565b602080601f831160018114613acd5760008415613ab55750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613afc57888601518255948401946001909101908401613add565b5085821015613b1a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b361379c565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906139b5908301613b88565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133e360e08301613b88565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613caa6040830185613446565b8281036020840152613cbc8185613446565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090613cf190830186613446565b82810360608401526138568186613446565b600060208284031215613d1557600080fd5b81516118e681612ea7565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d495790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d7857505050505090565b8285019150815181811115613d905750505050505090565b843d8701016020828501011115613daa5750505050505090565b613db960208286010187612fab565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e3e816017850160208801612ef7565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e6f816028840160208801612ef7565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613eb590830184612f1b565b979650505050505050565b600081613ecf57613ecf61379c565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220acddfb70104e79f1ac2b78e25c39a2d66eeec2fe68b7ba2188c38257a7cfd96264736f6c63430008110033", + "bytecode": "0x608060405234801561001057600080fd5b50613f5b806100206000396000f3fe608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e89565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ecb565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612ee8565b6107f3565b005b6102d161081d565b6040516102889190612f55565b6102d16102ec366004612f68565b6108ac565b6102a46102ff366004612ee8565b3b151590565b6102c7610313366004612f81565b610951565b61032b6103263660046130f5565b610977565b60405161028891906131a1565b6102c76103463660046131b5565b610b7d565b61027e610359366004612f68565b610bb7565b6102c761036c366004612ee8565b610bcc565b61038461037f366004612f81565b610c37565b6040516102889291906131f1565b6102c76103a0366004613270565b610c8d565b6102c76103b336600461331d565b610ceb565b6102c76103c636600461331d565b610d0c565b6102c7610d96565b6102c76103e136600461334d565b610db7565b6103f96103f4366004612f68565b610ed9565b60405161028894939291906133ca565b61041c6104173660046133fb565b610fd6565b604051610288919061348f565b6102a4610437366004612ee8565b6110ff565b61032b61044a366004612f68565b90565b61027e61045b3660046134a2565b611124565b6102a461046e366004612ee8565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134de565b61119f565b61027e6104c9366004612ee8565b6001600160a01b031690565b61027e600080516020613ee683398151915281565b61032b6111b3565b6102a461050036600461331d565b6111c2565b6102d16111ed565b6102c761051b366004613534565b6111fb565b6102c761052e36600461356c565b61122d565b61027e600081565b6102c76105493660046135bb565b611260565b61032b611272565b6102c7610564366004612ee8565b611281565b6102c7610577366004612f81565b6112e9565b6102c761058a3660046135e9565b6112fb565b61032b61136e565b6102c76105a5366004613648565b6113f9565b6102c76105b836600461331d565b611455565b6102c76105cb36600461334d565b611471565b6102d1611551565b6102a46105e636600461367c565b6115e3565b60ff5461032b906001600160a01b031681565b61061161060c366004612e89565b611624565b60405161028891906136aa565b61041c61062c366004612e89565b6116bf565b6102c761063f366004613703565b6117a0565b6102c7610652366004612ee8565b6117f7565b6102c761066536600461375f565b61186d565b6102c761067836600461334d565b611baf565b60008061068a8484611c0c565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613794565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613794565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613794565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613794565b9060005260206000209060030201600001548261079991906137c0565b91505b806107a6816137d3565b915050610690565b509150505b92915050565b60006107c482611c3f565b806107d357506107d382611c60565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611cb0565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137ec565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137ec565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137ec565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611d1f565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611d2e565b9050806001600160a01b038116633f2f5ee26109d2611d1f565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613826565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613794565b60200260200101516040518263ffffffff1660e01b8152600401610a8a91906131a1565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137d3565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611d1f565b610bad5760405162461bcd60e51b8152600401610ba490613884565b60405180910390fd5b6109738282611dc8565b600090815260c9602052604090206001015490565b610bd4611d1f565b6001600160a01b0316610be56111b3565b6001600160a01b03161480610c005750610c0061046e611d1f565b610c1c5760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282611dee565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138df565b610c8391906138f6565b9150509250929050565b610c95611d1f565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611d1f565b610cd75760405162461bcd60e51b8152600401610ba490613918565b610ce48585858585611df8565b5050505050565b610cf482610bb7565b610cfd81611fe9565b610d078383611ffa565b505050565b610d14611d1f565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b6109738282612081565b610db5600080516020613ee6833981519152610db0611d1f565b612081565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de630612106565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611baf565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137ec565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612fa3565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613794565b60200260200101518583815181106110bd576110bd613794565b602002602001015161067d565b8282815181106110dc576110dc613794565b60209081029190910101526110f0816137d3565b9050611085565b509392505050565b600061110961136e565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613794565b60200260200101518261115891906137c0565b915080611164816137d3565b91505061112a565b5092915050565b60006107b3600080516020613ee6833981519152836111c2565b611195611cb0565b610db56000612115565b6111ad8484846000856112fb565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137ec565b61120661046e611d1f565b6112225760405162461bcd60e51b8152600401610ba490613884565b610d07838383612167565b61123861046e611d1f565b6112545760405162461bcd60e51b8152600401610ba490613884565b6111ad848484846121ff565b61097361126b611d1f565b8383612233565b60ff546001600160a01b031690565b611289611d1f565b6001600160a01b031661129a6111b3565b6001600160a01b031614806112b557506112b561046e611d1f565b6112d15760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282612081565b6109736112f4611d1f565b838361186d565b61130785858584612313565b60006113138686611c0c565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b600080611379611272565b90506001600160a01b03811661139157600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f39190613966565b91505090565b611401611d1f565b6001600160a01b03166114126111b3565b6001600160a01b0316148061142d575061142d61046e611d1f565b6114495760405162461bcd60e51b8152600401610ba4906138af565b60fe61097382826139c9565b61145e82610bb7565b61146781611fe9565b610d078383612081565b600054610100900460ff166114985760405162461bcd60e51b8152600401610ba490613a88565b6114b7600080516020613ee68339815191526114b2611d1f565b611dee565b6114cf600080516020613ee683398151915285611dee565b6114e7600080516020613ee683398151915286611dee565b6114f0816113f9565b6101006114fd84826139c9565b5061010161150b83826139c9565b5061010280546001600160a01b0319166001600160a01b038616179055611530611d1f565b6001600160a01b0316856001600160a01b031614610ce457610ce4856117f7565b606060fe8054611560906137ec565b80601f016020809104026020016040519081016040528092919081815260200182805461158c906137ec565b80156115d95780601f106115ae576101008083540402835291602001916115d9565b820191906000526020600020905b8154815290600101906020018083116115bc57829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff168061161d575061161d82611173565b9392505050565b606061010360006116358585611c0c565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156116b35783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611663565b50505050905092915050565b606060006116cd8484611c0c565b60008181526101036020526040812054919250906001600160401b038111156116f8576116f8612fa3565b604051908082528060200260200182016040528015611721578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae5760008381526101036020526040902080548290811061175f5761175f613794565b90600052602060002090600302016002015482828151811061178357611783613794565b602090810291909101015280611798816137d3565b915050611727565b6117a8611d1f565b6001600160a01b0316856001600160a01b031614806117ce57506117ce856105e6611d1f565b6117ea5760405162461bcd60e51b8152600401610ba490613918565b610ce485858585856125ea565b6117ff611cb0565b6001600160a01b0381166118645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c3481612115565b80611878848461271f565b10156118d25760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b6118dd61046e611d1f565b8061190057506118eb611d1f565b6001600160a01b0316836001600160a01b0316145b806119125750611912836105e6611d1f565b6119705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611991908490613ad3565b9091555050610102546001600160a01b031663bb794d92836119b1611d1f565b84436040516020016119c69493929190613afd565b604051602081830303815290604052805190602001208460001b6119e8611d1f565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611a289493929190613b39565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613b79565b506000611a788484611c0c565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611ab657611ab6613794565b9060005260206000209060030201600001548211611b1d57600083815261010360205260409020805483919083908110611af257611af2613794565b90600052602060002090600302016000016000828254611b129190613ad3565b90915550610ed19050565b600083815261010360205260409020805482908110611b3e57611b3e613794565b90600052602060002090600302016000015482611b5b9190613ad3565b60008481526101036020526040902080549193509082908110611b8057611b80613794565b600091825260208220600390910201818155600181018290556002015580611ba7816137d3565b915050611a7e565b600054610100900460ff16611bd65760405162461bcd60e51b8152600401610ba490613a88565b611bde6127b2565b611be66127b2565b611bef816127d9565b611bf7612809565b611bff6127b2565b610ce48585858585611471565b60008282604051602001611c219291906131f1565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611c9157506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611cb8611d1f565b6001600160a01b0316611cc96111b3565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611d29612840565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611dc35760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d0782826139c9565b6109738282611ffa565b8151835114611e5a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b038416611e805760405162461bcd60e51b8152600401610ba490613b96565b6000611e8a611d1f565b9050611e9a81878787878761286e565b60005b8451811015611f83576000858281518110611eba57611eba613794565b602002602001015190506000858381518110611ed857611ed8613794565b60209081029190910181015160008481526097835260408082206001600160a01b038e168352909352919091205490915081811015611f295760405162461bcd60e51b8152600401610ba490613bdb565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611f689084906137c0565b9250508190555050505080611f7c906137d3565b9050611e9d565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611fd3929190613c25565b60405180910390a4610ed18187878787876128d5565b610c3481611ff5611d1f565b612a40565b61200482826111c2565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561203d611d1f565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61208b82826111c2565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556120c2611d1f565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156121b75760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce482826139c9565b816001600160a01b0316836001600160a01b0316036122a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61231e61046e611d1f565b80612341575061232c6111b3565b6001600160a01b0316846001600160a01b0316145b806123d1575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa158015612391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b59190613966565b6001600160a01b03166123c6611d1f565b6001600160a01b0316145b6124165760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff1661246a5760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc6020526040902060020154156124e257600083815260fc6020526040902060028101546001909101546124a59084906137c0565b11156124e25760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc6020526040812060010180548492906125039084906137c0565b9091555050610102546001600160a01b031663bb794d9284612523611d1f565b85436040516020016125389493929190613c6a565b604051602081830303815290604052805190602001208560001b61255a611d1f565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161259a9493929190613c93565b6020604051808303816000875af11580156125b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125dd9190613b79565b506111ad84848484612a99565b6001600160a01b0384166126105760405162461bcd60e51b8152600401610ba490613b96565b600061261a611d1f565b9050600061262785612bae565b9050600061263485612bae565b905061264483898985858961286e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156126875760405162461bcd60e51b8152600401610ba490613bdb565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126c69084906137c0565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613f06833981519152910160405180910390a4612714848a8a8a8a8a612bf9565b505050505050505050565b60006001600160a01b03831661278a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613a88565b600054610100900460ff166128005760405162461bcd60e51b8152600401610ba490613a88565b610c3481612cbb565b600054610100900460ff166128305760405162461bcd60e51b8152600401610ba490613a88565b610db561283b611d1f565b612115565b6000601436108015906128575750612857336110ff565b15612869575060131936013560601c90565b503390565b6001600160a01b038516158061288b57506001600160a01b038416155b8061289c575061289c61046e611d1f565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6128e7846001600160a01b0316612106565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906129209089908990889088908890600401613cd3565b6020604051808303816000875af192505050801561295b575060408051601f3d908101601f1916820190925261295891810190613d11565b60015b612a0757612967613d2e565b806308c379a0036129a0575061297b613d49565b8061298657506129a2565b8060405162461bcd60e51b8152600401610ba49190612f55565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b50505050505050565b612a4a82826111c2565b61097357612a5781612cc7565b612a62836020612cd9565b604051602001612a73929190613e1a565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f55565b6001600160a01b038416612af95760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b6000612b03611d1f565b90506000612b1085612bae565b90506000612b1d85612bae565b9050612b2e8360008985858961286e565b60008681526097602090815260408083206001600160a01b038b16845290915281208054879290612b609084906137c0565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613f06833981519152910160405180910390a4612a3783600089898989612bf9565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612be857612be8613794565b602090810291909101015292915050565b612c0b846001600160a01b0316612106565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c449089908990889088908890600401613e89565b6020604051808303816000875af1925050508015612c7f575060408051601f3d908101601f19168201909252612c7c91810190613d11565b60015b612c8b57612967613d2e565b6001600160e01b0319811663f23a6e6160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b609961097382826139c9565b60606107b36001600160a01b03831660145b60606000612ce88360026138df565b612cf39060026137c0565b6001600160401b03811115612d0a57612d0a612fa3565b6040519080825280601f01601f191660200182016040528015612d34576020820181803683370190505b509050600360fc1b81600081518110612d4f57612d4f613794565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7e57612d7e613794565b60200101906001600160f81b031916908160001a9053506000612da28460026138df565b612dad9060016137c0565b90505b6001811115612e25576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612de157612de1613794565b1a60f81b828281518110612df757612df7613794565b60200101906001600160f81b031916908160001a90535060049490941c93612e1e81613ece565b9050612db0565b50831561161d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e9c57600080fd5b8235612ea781612e74565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612edd57600080fd5b813561161d81612eb5565b600060208284031215612efa57600080fd5b813561161d81612e74565b60005b83811015612f20578181015183820152602001612f08565b50506000910152565b60008151808452612f41816020860160208601612f05565b601f01601f19169290920160200192915050565b60208152600061161d6020830184612f29565b600060208284031215612f7a57600080fd5b5035919050565b60008060408385031215612f9457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fde57612fde612fa3565b6040525050565b600082601f830112612ff657600080fd5b81356001600160401b0381111561300f5761300f612fa3565b604051613026601f8301601f191660200182612fb9565b81815284602083860101111561303b57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561307157613071612fa3565b5060051b60200190565b600082601f83011261308c57600080fd5b8135602061309982613058565b6040516130a68282612fb9565b83815260059390931b85018201928281019150868411156130c657600080fd5b8286015b848110156130ea5780356130dd81612e74565b83529183019183016130ca565b509695505050505050565b6000806000806080858703121561310b57600080fd5b84356001600160401b038082111561312257600080fd5b61312e88838901612fe5565b9550602087013591508082111561314457600080fd5b61315088838901612fe5565b9450604087013591508082111561316657600080fd5b61317288838901612fe5565b9350606087013591508082111561318857600080fd5b506131958782880161307b565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131c857600080fd5b8235915060208301356001600160401b038111156131e557600080fd5b610c8385828601612fe5565b6001600160a01b03929092168252602082015260400190565b600082601f83011261321b57600080fd5b8135602061322882613058565b6040516132358282612fb9565b83815260059390931b850182019282810191508684111561325557600080fd5b8286015b848110156130ea5780358352918301918301613259565b600080600080600060a0868803121561328857600080fd5b853561329381612e74565b945060208601356132a381612e74565b935060408601356001600160401b03808211156132bf57600080fd5b6132cb89838a0161320a565b945060608801359150808211156132e157600080fd5b6132ed89838a0161320a565b9350608088013591508082111561330357600080fd5b5061331088828901612fe5565b9150509295509295909350565b6000806040838503121561333057600080fd5b82359150602083013561334281612e74565b809150509250929050565b600080600080600060a0868803121561336557600080fd5b853561337081612e74565b9450602086013561338081612e74565b935060408601356001600160401b038082111561339c57600080fd5b6133a889838a01612fe5565b945060608801359150808211156133be57600080fd5b6132ed89838a01612fe5565b84151581528360208201528260408201526080606082015260006133f16080830184612f29565b9695505050505050565b6000806040838503121561340e57600080fd5b82356001600160401b038082111561342557600080fd5b6134318683870161307b565b9350602085013591508082111561344757600080fd5b50610c838582860161320a565b600081518084526020808501945080840160005b8381101561348457815187529582019590820190600101613468565b509495945050505050565b60208152600061161d6020830184613454565b6000602082840312156134b457600080fd5b81356001600160401b038111156134ca57600080fd5b6134d68482850161320a565b949350505050565b600080600080608085870312156134f457600080fd5b84356134ff81612e74565b9350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b61319587828801612fe5565b60008060006060848603121561354957600080fd5b83359250602084013561355b81612e74565b929592945050506040919091013590565b6000806000806080858703121561358257600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b8015158114610c3457600080fd5b600080604083850312156135ce57600080fd5b82356135d981612e74565b91506020830135613342816135ad565b600080600080600060a0868803121561360157600080fd5b853561360c81612e74565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b61331088828901612fe5565b60006020828403121561365a57600080fd5b81356001600160401b0381111561367057600080fd5b6134d684828501612fe5565b6000806040838503121561368f57600080fd5b823561369a81612e74565b9150602083013561334281612e74565b602080825282518282018190526000919060409081850190868401855b828110156136f657815180518552868101518786015285015185850152606090930192908501906001016136c7565b5091979650505050505050565b600080600080600060a0868803121561371b57600080fd5b853561372681612e74565b9450602086013561373681612e74565b9350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b60008060006060848603121561377457600080fd5b833561377f81612e74565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b36137aa565b6000600182016137e5576137e56137aa565b5060010190565b600181811c9082168061380057607f821691505b60208210810361382057634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061385290830186612f29565b82810360608401526138648186612f29565b905082810360808401526138788185612f29565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b36137aa565b60008261391357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561397857600080fd5b815161161d81612e74565b601f821115610d0757600081815260208120601f850160051c810160208610156139aa5750805b601f850160051c820191505b81811015610ed1578281556001016139b6565b81516001600160401b038111156139e2576139e2612fa3565b6139f6816139f084546137ec565b84613983565b602080601f831160018114613a2b5760008415613a135750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613a5a57888601518255948401946001909101908401613a3b565b5085821015613a785787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b36137aa565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613ae6565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613ae6565b600060208284031215613b8b57600080fd5b815161161d816135ad565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613c386040830185613454565b8281036020840152613c4a8185613454565b95945050505050565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613c53565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613c53565b6001600160a01b0386811682528516602082015260a060408201819052600090613cff90830186613454565b82810360608401526138648186613454565b600060208284031215613d2357600080fd5b815161161d81612eb5565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d575790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d8657505050505090565b8285019150815181811115613d9e5750505050505090565b843d8701016020828501011115613db85750505050505090565b613dc760208286010187612fb9565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e4c816017850160208801612f05565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e7d816028840160208801612f05565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ec390830184612f29565b979650505050505050565b600081613edd57613edd6137aa565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220edbfbd9cc36d0fc29f921a0c11f618778549fd5e870483e010354e8e9f57524a64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e89565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ecb565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612ee8565b6107f3565b005b6102d161081d565b6040516102889190612f55565b6102d16102ec366004612f68565b6108ac565b6102a46102ff366004612ee8565b3b151590565b6102c7610313366004612f81565b610951565b61032b6103263660046130f5565b610977565b60405161028891906131a1565b6102c76103463660046131b5565b610b7d565b61027e610359366004612f68565b610bb7565b6102c761036c366004612ee8565b610bcc565b61038461037f366004612f81565b610c37565b6040516102889291906131f1565b6102c76103a0366004613270565b610c8d565b6102c76103b336600461331d565b610ceb565b6102c76103c636600461331d565b610d0c565b6102c7610d96565b6102c76103e136600461334d565b610db7565b6103f96103f4366004612f68565b610ed9565b60405161028894939291906133ca565b61041c6104173660046133fb565b610fd6565b604051610288919061348f565b6102a4610437366004612ee8565b6110ff565b61032b61044a366004612f68565b90565b61027e61045b3660046134a2565b611124565b6102a461046e366004612ee8565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134de565b61119f565b61027e6104c9366004612ee8565b6001600160a01b031690565b61027e600080516020613ee683398151915281565b61032b6111b3565b6102a461050036600461331d565b6111c2565b6102d16111ed565b6102c761051b366004613534565b6111fb565b6102c761052e36600461356c565b61122d565b61027e600081565b6102c76105493660046135bb565b611260565b61032b611272565b6102c7610564366004612ee8565b611281565b6102c7610577366004612f81565b6112e9565b6102c761058a3660046135e9565b6112fb565b61032b61136e565b6102c76105a5366004613648565b6113f9565b6102c76105b836600461331d565b611455565b6102c76105cb36600461334d565b611471565b6102d1611551565b6102a46105e636600461367c565b6115e3565b60ff5461032b906001600160a01b031681565b61061161060c366004612e89565b611624565b60405161028891906136aa565b61041c61062c366004612e89565b6116bf565b6102c761063f366004613703565b6117a0565b6102c7610652366004612ee8565b6117f7565b6102c761066536600461375f565b61186d565b6102c761067836600461334d565b611baf565b60008061068a8484611c0c565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613794565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613794565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613794565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613794565b9060005260206000209060030201600001548261079991906137c0565b91505b806107a6816137d3565b915050610690565b509150505b92915050565b60006107c482611c3f565b806107d357506107d382611c60565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611cb0565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137ec565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137ec565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137ec565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611d1f565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611d2e565b9050806001600160a01b038116633f2f5ee26109d2611d1f565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613826565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613794565b60200260200101516040518263ffffffff1660e01b8152600401610a8a91906131a1565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137d3565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611d1f565b610bad5760405162461bcd60e51b8152600401610ba490613884565b60405180910390fd5b6109738282611dc8565b600090815260c9602052604090206001015490565b610bd4611d1f565b6001600160a01b0316610be56111b3565b6001600160a01b03161480610c005750610c0061046e611d1f565b610c1c5760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282611dee565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138df565b610c8391906138f6565b9150509250929050565b610c95611d1f565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611d1f565b610cd75760405162461bcd60e51b8152600401610ba490613918565b610ce48585858585611df8565b5050505050565b610cf482610bb7565b610cfd81611fe9565b610d078383611ffa565b505050565b610d14611d1f565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b6109738282612081565b610db5600080516020613ee6833981519152610db0611d1f565b612081565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de630612106565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611baf565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137ec565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612fa3565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613794565b60200260200101518583815181106110bd576110bd613794565b602002602001015161067d565b8282815181106110dc576110dc613794565b60209081029190910101526110f0816137d3565b9050611085565b509392505050565b600061110961136e565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613794565b60200260200101518261115891906137c0565b915080611164816137d3565b91505061112a565b5092915050565b60006107b3600080516020613ee6833981519152836111c2565b611195611cb0565b610db56000612115565b6111ad8484846000856112fb565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137ec565b61120661046e611d1f565b6112225760405162461bcd60e51b8152600401610ba490613884565b610d07838383612167565b61123861046e611d1f565b6112545760405162461bcd60e51b8152600401610ba490613884565b6111ad848484846121ff565b61097361126b611d1f565b8383612233565b60ff546001600160a01b031690565b611289611d1f565b6001600160a01b031661129a6111b3565b6001600160a01b031614806112b557506112b561046e611d1f565b6112d15760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282612081565b6109736112f4611d1f565b838361186d565b61130785858584612313565b60006113138686611c0c565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b600080611379611272565b90506001600160a01b03811661139157600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f39190613966565b91505090565b611401611d1f565b6001600160a01b03166114126111b3565b6001600160a01b0316148061142d575061142d61046e611d1f565b6114495760405162461bcd60e51b8152600401610ba4906138af565b60fe61097382826139c9565b61145e82610bb7565b61146781611fe9565b610d078383612081565b600054610100900460ff166114985760405162461bcd60e51b8152600401610ba490613a88565b6114b7600080516020613ee68339815191526114b2611d1f565b611dee565b6114cf600080516020613ee683398151915285611dee565b6114e7600080516020613ee683398151915286611dee565b6114f0816113f9565b6101006114fd84826139c9565b5061010161150b83826139c9565b5061010280546001600160a01b0319166001600160a01b038616179055611530611d1f565b6001600160a01b0316856001600160a01b031614610ce457610ce4856117f7565b606060fe8054611560906137ec565b80601f016020809104026020016040519081016040528092919081815260200182805461158c906137ec565b80156115d95780601f106115ae576101008083540402835291602001916115d9565b820191906000526020600020905b8154815290600101906020018083116115bc57829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff168061161d575061161d82611173565b9392505050565b606061010360006116358585611c0c565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156116b35783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611663565b50505050905092915050565b606060006116cd8484611c0c565b60008181526101036020526040812054919250906001600160401b038111156116f8576116f8612fa3565b604051908082528060200260200182016040528015611721578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae5760008381526101036020526040902080548290811061175f5761175f613794565b90600052602060002090600302016002015482828151811061178357611783613794565b602090810291909101015280611798816137d3565b915050611727565b6117a8611d1f565b6001600160a01b0316856001600160a01b031614806117ce57506117ce856105e6611d1f565b6117ea5760405162461bcd60e51b8152600401610ba490613918565b610ce485858585856125ea565b6117ff611cb0565b6001600160a01b0381166118645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c3481612115565b80611878848461271f565b10156118d25760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b6118dd61046e611d1f565b8061190057506118eb611d1f565b6001600160a01b0316836001600160a01b0316145b806119125750611912836105e6611d1f565b6119705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611991908490613ad3565b9091555050610102546001600160a01b031663bb794d92836119b1611d1f565b84436040516020016119c69493929190613afd565b604051602081830303815290604052805190602001208460001b6119e8611d1f565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611a289493929190613b39565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613b79565b506000611a788484611c0c565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611ab657611ab6613794565b9060005260206000209060030201600001548211611b1d57600083815261010360205260409020805483919083908110611af257611af2613794565b90600052602060002090600302016000016000828254611b129190613ad3565b90915550610ed19050565b600083815261010360205260409020805482908110611b3e57611b3e613794565b90600052602060002090600302016000015482611b5b9190613ad3565b60008481526101036020526040902080549193509082908110611b8057611b80613794565b600091825260208220600390910201818155600181018290556002015580611ba7816137d3565b915050611a7e565b600054610100900460ff16611bd65760405162461bcd60e51b8152600401610ba490613a88565b611bde6127b2565b611be66127b2565b611bef816127d9565b611bf7612809565b611bff6127b2565b610ce48585858585611471565b60008282604051602001611c219291906131f1565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611c9157506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611cb8611d1f565b6001600160a01b0316611cc96111b3565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611d29612840565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611dc35760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d0782826139c9565b6109738282611ffa565b8151835114611e5a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b038416611e805760405162461bcd60e51b8152600401610ba490613b96565b6000611e8a611d1f565b9050611e9a81878787878761286e565b60005b8451811015611f83576000858281518110611eba57611eba613794565b602002602001015190506000858381518110611ed857611ed8613794565b60209081029190910181015160008481526097835260408082206001600160a01b038e168352909352919091205490915081811015611f295760405162461bcd60e51b8152600401610ba490613bdb565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611f689084906137c0565b9250508190555050505080611f7c906137d3565b9050611e9d565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611fd3929190613c25565b60405180910390a4610ed18187878787876128d5565b610c3481611ff5611d1f565b612a40565b61200482826111c2565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561203d611d1f565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61208b82826111c2565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556120c2611d1f565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156121b75760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce482826139c9565b816001600160a01b0316836001600160a01b0316036122a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61231e61046e611d1f565b80612341575061232c6111b3565b6001600160a01b0316846001600160a01b0316145b806123d1575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa158015612391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b59190613966565b6001600160a01b03166123c6611d1f565b6001600160a01b0316145b6124165760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff1661246a5760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc6020526040902060020154156124e257600083815260fc6020526040902060028101546001909101546124a59084906137c0565b11156124e25760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc6020526040812060010180548492906125039084906137c0565b9091555050610102546001600160a01b031663bb794d9284612523611d1f565b85436040516020016125389493929190613c6a565b604051602081830303815290604052805190602001208560001b61255a611d1f565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161259a9493929190613c93565b6020604051808303816000875af11580156125b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125dd9190613b79565b506111ad84848484612a99565b6001600160a01b0384166126105760405162461bcd60e51b8152600401610ba490613b96565b600061261a611d1f565b9050600061262785612bae565b9050600061263485612bae565b905061264483898985858961286e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156126875760405162461bcd60e51b8152600401610ba490613bdb565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126c69084906137c0565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613f06833981519152910160405180910390a4612714848a8a8a8a8a612bf9565b505050505050505050565b60006001600160a01b03831661278a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613a88565b600054610100900460ff166128005760405162461bcd60e51b8152600401610ba490613a88565b610c3481612cbb565b600054610100900460ff166128305760405162461bcd60e51b8152600401610ba490613a88565b610db561283b611d1f565b612115565b6000601436108015906128575750612857336110ff565b15612869575060131936013560601c90565b503390565b6001600160a01b038516158061288b57506001600160a01b038416155b8061289c575061289c61046e611d1f565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6128e7846001600160a01b0316612106565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906129209089908990889088908890600401613cd3565b6020604051808303816000875af192505050801561295b575060408051601f3d908101601f1916820190925261295891810190613d11565b60015b612a0757612967613d2e565b806308c379a0036129a0575061297b613d49565b8061298657506129a2565b8060405162461bcd60e51b8152600401610ba49190612f55565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b50505050505050565b612a4a82826111c2565b61097357612a5781612cc7565b612a62836020612cd9565b604051602001612a73929190613e1a565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f55565b6001600160a01b038416612af95760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b6000612b03611d1f565b90506000612b1085612bae565b90506000612b1d85612bae565b9050612b2e8360008985858961286e565b60008681526097602090815260408083206001600160a01b038b16845290915281208054879290612b609084906137c0565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613f06833981519152910160405180910390a4612a3783600089898989612bf9565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612be857612be8613794565b602090810291909101015292915050565b612c0b846001600160a01b0316612106565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c449089908990889088908890600401613e89565b6020604051808303816000875af1925050508015612c7f575060408051601f3d908101601f19168201909252612c7c91810190613d11565b60015b612c8b57612967613d2e565b6001600160e01b0319811663f23a6e6160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b609961097382826139c9565b60606107b36001600160a01b03831660145b60606000612ce88360026138df565b612cf39060026137c0565b6001600160401b03811115612d0a57612d0a612fa3565b6040519080825280601f01601f191660200182016040528015612d34576020820181803683370190505b509050600360fc1b81600081518110612d4f57612d4f613794565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7e57612d7e613794565b60200101906001600160f81b031916908160001a9053506000612da28460026138df565b612dad9060016137c0565b90505b6001811115612e25576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612de157612de1613794565b1a60f81b828281518110612df757612df7613794565b60200101906001600160f81b031916908160001a90535060049490941c93612e1e81613ece565b9050612db0565b50831561161d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e9c57600080fd5b8235612ea781612e74565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612edd57600080fd5b813561161d81612eb5565b600060208284031215612efa57600080fd5b813561161d81612e74565b60005b83811015612f20578181015183820152602001612f08565b50506000910152565b60008151808452612f41816020860160208601612f05565b601f01601f19169290920160200192915050565b60208152600061161d6020830184612f29565b600060208284031215612f7a57600080fd5b5035919050565b60008060408385031215612f9457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fde57612fde612fa3565b6040525050565b600082601f830112612ff657600080fd5b81356001600160401b0381111561300f5761300f612fa3565b604051613026601f8301601f191660200182612fb9565b81815284602083860101111561303b57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561307157613071612fa3565b5060051b60200190565b600082601f83011261308c57600080fd5b8135602061309982613058565b6040516130a68282612fb9565b83815260059390931b85018201928281019150868411156130c657600080fd5b8286015b848110156130ea5780356130dd81612e74565b83529183019183016130ca565b509695505050505050565b6000806000806080858703121561310b57600080fd5b84356001600160401b038082111561312257600080fd5b61312e88838901612fe5565b9550602087013591508082111561314457600080fd5b61315088838901612fe5565b9450604087013591508082111561316657600080fd5b61317288838901612fe5565b9350606087013591508082111561318857600080fd5b506131958782880161307b565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131c857600080fd5b8235915060208301356001600160401b038111156131e557600080fd5b610c8385828601612fe5565b6001600160a01b03929092168252602082015260400190565b600082601f83011261321b57600080fd5b8135602061322882613058565b6040516132358282612fb9565b83815260059390931b850182019282810191508684111561325557600080fd5b8286015b848110156130ea5780358352918301918301613259565b600080600080600060a0868803121561328857600080fd5b853561329381612e74565b945060208601356132a381612e74565b935060408601356001600160401b03808211156132bf57600080fd5b6132cb89838a0161320a565b945060608801359150808211156132e157600080fd5b6132ed89838a0161320a565b9350608088013591508082111561330357600080fd5b5061331088828901612fe5565b9150509295509295909350565b6000806040838503121561333057600080fd5b82359150602083013561334281612e74565b809150509250929050565b600080600080600060a0868803121561336557600080fd5b853561337081612e74565b9450602086013561338081612e74565b935060408601356001600160401b038082111561339c57600080fd5b6133a889838a01612fe5565b945060608801359150808211156133be57600080fd5b6132ed89838a01612fe5565b84151581528360208201528260408201526080606082015260006133f16080830184612f29565b9695505050505050565b6000806040838503121561340e57600080fd5b82356001600160401b038082111561342557600080fd5b6134318683870161307b565b9350602085013591508082111561344757600080fd5b50610c838582860161320a565b600081518084526020808501945080840160005b8381101561348457815187529582019590820190600101613468565b509495945050505050565b60208152600061161d6020830184613454565b6000602082840312156134b457600080fd5b81356001600160401b038111156134ca57600080fd5b6134d68482850161320a565b949350505050565b600080600080608085870312156134f457600080fd5b84356134ff81612e74565b9350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b61319587828801612fe5565b60008060006060848603121561354957600080fd5b83359250602084013561355b81612e74565b929592945050506040919091013590565b6000806000806080858703121561358257600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b8015158114610c3457600080fd5b600080604083850312156135ce57600080fd5b82356135d981612e74565b91506020830135613342816135ad565b600080600080600060a0868803121561360157600080fd5b853561360c81612e74565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b61331088828901612fe5565b60006020828403121561365a57600080fd5b81356001600160401b0381111561367057600080fd5b6134d684828501612fe5565b6000806040838503121561368f57600080fd5b823561369a81612e74565b9150602083013561334281612e74565b602080825282518282018190526000919060409081850190868401855b828110156136f657815180518552868101518786015285015185850152606090930192908501906001016136c7565b5091979650505050505050565b600080600080600060a0868803121561371b57600080fd5b853561372681612e74565b9450602086013561373681612e74565b9350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b60008060006060848603121561377457600080fd5b833561377f81612e74565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b36137aa565b6000600182016137e5576137e56137aa565b5060010190565b600181811c9082168061380057607f821691505b60208210810361382057634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061385290830186612f29565b82810360608401526138648186612f29565b905082810360808401526138788185612f29565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b36137aa565b60008261391357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561397857600080fd5b815161161d81612e74565b601f821115610d0757600081815260208120601f850160051c810160208610156139aa5750805b601f850160051c820191505b81811015610ed1578281556001016139b6565b81516001600160401b038111156139e2576139e2612fa3565b6139f6816139f084546137ec565b84613983565b602080601f831160018114613a2b5760008415613a135750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613a5a57888601518255948401946001909101908401613a3b565b5085821015613a785787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b36137aa565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613ae6565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613ae6565b600060208284031215613b8b57600080fd5b815161161d816135ad565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613c386040830185613454565b8281036020840152613c4a8185613454565b95945050505050565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613c53565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613c53565b6001600160a01b0386811682528516602082015260a060408201819052600090613cff90830186613454565b82810360608401526138648186613454565b600060208284031215613d2357600080fd5b815161161d81612eb5565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d575790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d8657505050505090565b8285019150815181811115613d9e5750505050505090565b843d8701016020828501011115613db85750505050505090565b613dc760208286010187612fb9565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e4c816017850160208801612f05565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e7d816028840160208801612f05565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ec390830184612f29565b979650505050505050565b600081613edd57613edd6137aa565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220edbfbd9cc36d0fc29f921a0c11f618778549fd5e870483e010354e8e9f57524a64736f6c63430008110033", "linkReferences": {}, "deployedLinkReferences": {} } From 36561aa767dd6877bfb0cfb73ef534fc41b27241 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 2 Aug 2023 09:49:51 +0200 Subject: [PATCH 066/151] chore: adding v2.0.0-rc5 Changelog updates --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be21480f8..e7feecf2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc5](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc4...v2.0.0-rc5) + +> 2 August 2023 + +- chore: testing with rc5 [`2c0c863`](https://github.com/nevermined-io/sdk-js/commit/2c0c86364c0df5e7fc51a39bd39d1044c207f27d) +- chore: adding v2.0.0-rc4 Changelog updates [`7a1c711`](https://github.com/nevermined-io/sdk-js/commit/7a1c711d9f5f969e3ae054909b17ccb297740586) + #### [v2.0.0-rc4](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc3...v2.0.0-rc4) > 31 July 2023 From ee829ac8e1ce75268b0ada75682283aca75b5cb7 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Tue, 8 Aug 2023 18:10:59 +0200 Subject: [PATCH 067/151] feat: remove the need to wait for the marketplace api in the tests - updated nvm-tools in the CI --- .github/workflows/testing-nightly.yml | 2 +- .github/workflows/testing-node.yml | 2 +- .github/workflows/testing.yml | 2 +- CHANGELOG.md | 8 +++---- integration/external/Services.e2e.test.ts | 6 ----- .../nevermined/AgreementStoreManager.test.ts | 1 + integration/nevermined/AssetOwners.test.ts | 1 + integration/nevermined/Assets.test.ts | 22 ++++--------------- .../nevermined/AssetsPriceQuery.test.ts | 4 ---- .../AssetsWithMultipleServices.test.ts | 2 ++ integration/nevermined/Bookmarks.test.ts | 6 ----- integration/nevermined/ConsumeAsset.test.ts | 4 ++-- .../nevermined/ConsumeAssetViaNode.test.ts | 2 +- .../ConsumeExternalDDOAsset.test.ts | 4 ++-- integration/nevermined/ContractEvent.test.ts | 3 +++ integration/nevermined/NFT1155Api.e2e.test.ts | 8 +++++++ integration/nevermined/Permissions.test.ts | 5 ----- integration/nevermined/Profiles.test.ts | 2 -- integration/nevermined/Provenance.test.ts | 5 +++++ integration/nevermined/SearchAsset.test.ts | 4 ---- integration/nevermined/SubgraphEvent.test.ts | 6 +++++ 21 files changed, 42 insertions(+), 57 deletions(-) diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index 962d55589..804f871c0 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -56,7 +56,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - - uses: nevermined-io/nvm-tools-actions@v0.12.0 + - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index b9f99ace6..86dd6e2f3 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -18,7 +18,7 @@ jobs: # TODO: remove this when Node integrated with SDKv2 is integraged ref: develop token: ${{ secrets.API_TOKEN_GITHUB }} - - uses: nevermined-io/nvm-tools-actions@v0.12.0 + - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index cd776c0e0..f8ee80483 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - - uses: nevermined-io/nvm-tools-actions@v0.12.0 + - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' diff --git a/CHANGELOG.md b/CHANGELOG.md index d4669ffe1..8f0fa014e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1096,7 +1096,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1359,7 +1359,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1865,7 +1865,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -1904,7 +1904,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index 313f46381..e1a212f65 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -26,7 +26,6 @@ import { } from '../../src/nevermined' import { RequestInit } from 'node-fetch' import fetch from 'node-fetch' -import { sleep } from '../utils/utils' describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { let publisher: Account @@ -417,11 +416,6 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { }) describe('As a subscriber I want to get an access token for the web service', () => { - before(async () => { - // wait for elasticsearch - await sleep(5000) - }) - it('Nevermined One issues an access token', async () => { const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) accessToken = response.accessToken diff --git a/integration/nevermined/AgreementStoreManager.test.ts b/integration/nevermined/AgreementStoreManager.test.ts index 35284a7cc..ea3adcc1d 100644 --- a/integration/nevermined/AgreementStoreManager.test.ts +++ b/integration/nevermined/AgreementStoreManager.test.ts @@ -58,6 +58,7 @@ describe('Agreement Store Manager', () => { agreementId = await nevermined.assets.order(ddo.id, 'access', account2) // wait for the graph to pickup the event + // TODO: See if we can remove this await sleep(3000) agreements = await nevermined.agreements.getAgreements(ddo.id) diff --git a/integration/nevermined/AssetOwners.test.ts b/integration/nevermined/AssetOwners.test.ts index 208b666dd..8147da361 100644 --- a/integration/nevermined/AssetOwners.test.ts +++ b/integration/nevermined/AssetOwners.test.ts @@ -108,6 +108,7 @@ describe('Asset Owners', () => { await mineBlocks(nevermined, account1, 1) // wait a bit for the subgraph to index the events + // TODO: See if we can remove this await sleep(5000) const result = await nevermined.assets.ownerAssets(account2.getId()) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index cd646ad75..8f8c4b322 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -5,7 +5,6 @@ import { config } from '../config' import { getAssetPrice, getMetadata } from '../utils' import { Nevermined, Account, MetaData, DDO, AssetPrice, AssetAttributes } from '../../src' import { generateId } from '../../src/utils' -import { sleep } from '../utils/utils' import { PublishMetadata, DIDResolvePolicy } from '../../src/nevermined' let nevermined: Nevermined @@ -123,9 +122,6 @@ describe('Assets', () => { PublishMetadata.IPFS, ) - // Waiting to metadata to be updated and propagated - await sleep(3000) - const resolvedDDO = await nevermined.assets.resolve(ddo.id, DIDResolvePolicy.ImmutableFirst) assert.isDefined(resolvedDDO) @@ -146,8 +142,7 @@ describe('Assets', () => { it('unlist and list an asset', async () => { // Unlisting Asset await nevermined.assets.list(ddo.shortId(), false, publisher) - // Waiting to metadata to be updated and propagated - await sleep(3000) + let resolvedDDO = await nevermined.assets.resolve(ddo.id, DIDResolvePolicy.MetadataAPIFirst) assert.isDefined(resolvedDDO) let metadata = resolvedDDO.findServiceByType('metadata') @@ -155,8 +150,7 @@ describe('Assets', () => { // Listing Asset back await nevermined.assets.list(ddo.shortId(), true, publisher) - // Waiting to metadata to be updated and propagated - await sleep(3000) + resolvedDDO = await nevermined.assets.resolve(ddo.id, DIDResolvePolicy.MetadataAPIFirst) assert.isDefined(resolvedDDO) metadata = resolvedDDO.findServiceByType('metadata') @@ -166,8 +160,7 @@ describe('Assets', () => { it('add a vote', async () => { // Adding some votes await nevermined.assets.addRating(ddo.shortId(), 0.5, 1, publisher) - // Waiting to metadata to be updated and propagated - await sleep(5000) + let resolvedDDO = await nevermined.assets.resolve(ddo.id) assert.isDefined(resolvedDDO) let metadata = resolvedDDO.findServiceByType('metadata') @@ -177,8 +170,7 @@ describe('Assets', () => { // More votes await nevermined.assets.addRating(ddo.shortId(), 0.4, 2, publisher) - // Waiting to metadata to be updated and propagated - await sleep(5000) + resolvedDDO = await nevermined.assets.resolve(ddo.id) assert.isDefined(resolvedDDO) metadata = resolvedDDO.findServiceByType('metadata') @@ -221,7 +213,6 @@ describe('Assets', () => { describe('#retire()', () => { it('retire an existing asset', async () => { const deleted = await nevermined.assets.retire(ddo.id) - await sleep(3000) assert.strictEqual(deleted.status, 200) }) }) @@ -259,7 +250,6 @@ describe('Assets', () => { appId: appId1, }) ddoBefore = await neverminedApp1.assets.create(assetAttributes, publisher) - await sleep(2000) // Create 2 assets with appId-test2 const assetAttributes2 = AssetAttributes.getInstance({ @@ -273,7 +263,6 @@ describe('Assets', () => { appId: appId2, }) ddoBefore = await neverminedApp2.assets.create(assetAttributes2, publisher) - await sleep(2000) const assetAttributes22 = AssetAttributes.getInstance({ metadata: metadata22, @@ -286,9 +275,6 @@ describe('Assets', () => { appId: appId2, }) ddoBefore = await neverminedApp2.assets.create(assetAttributes22, publisher) - - // wait for elasticsearch - await sleep(4000) }) it('should query by appId1', async () => { diff --git a/integration/nevermined/AssetsPriceQuery.test.ts b/integration/nevermined/AssetsPriceQuery.test.ts index 8ea5e2c18..011911942 100644 --- a/integration/nevermined/AssetsPriceQuery.test.ts +++ b/integration/nevermined/AssetsPriceQuery.test.ts @@ -6,7 +6,6 @@ import { getRoyaltyAttributes, RoyaltyKind } from '../../src/nevermined' import { generateId, parseUnits } from '../../src/utils' import { config } from '../config' import { getMetadata } from '../utils' -import { sleep } from '../utils/utils' describe('Assets Query by Price', () => { let nevermined: Nevermined @@ -84,9 +83,6 @@ describe('Assets Query by Price', () => { royaltyAttributes, }) ddoNftSales = await nevermined.nfts1155.create(nftAttributes, account) - - // wait for elasticsearch - await sleep(10000) }) it('Should query all services by default', async () => { diff --git a/integration/nevermined/AssetsWithMultipleServices.test.ts b/integration/nevermined/AssetsWithMultipleServices.test.ts index ebcc26bad..62028a647 100644 --- a/integration/nevermined/AssetsWithMultipleServices.test.ts +++ b/integration/nevermined/AssetsWithMultipleServices.test.ts @@ -110,6 +110,8 @@ describe('Assets with multiple services', () => { service = accessServices[0] const price = service.attributes.main.price agreementId = await nevermined.assets.order(ddo.id, service.index, consumer) + + // TODO: See if we can remove this await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) diff --git a/integration/nevermined/Bookmarks.test.ts b/integration/nevermined/Bookmarks.test.ts index 721993acd..30b1beb76 100644 --- a/integration/nevermined/Bookmarks.test.ts +++ b/integration/nevermined/Bookmarks.test.ts @@ -2,7 +2,6 @@ import { assert } from 'chai' import { config } from '../config' import { Nevermined, Account, NewBookmark } from '../../src' import { faker } from '@faker-js/faker' -import { sleep } from '../utils/utils' describe('Bookmarks', () => { let nevermined: Nevermined @@ -20,8 +19,6 @@ describe('Bookmarks', () => { await nevermined.services.marketplace.login(clientAssertion) - await sleep(2000) - const userProfile = await nevermined.services.profiles.findOneByAddress(account1.getId()) newBookmark = { @@ -54,7 +51,6 @@ describe('Bookmarks', () => { }) it('should get bookmarks by userId', async () => { - await sleep(1000) const response = await nevermined.services.bookmarks.findManyByUserId(newBookmark.userId) /* eslint-disable @typescript-eslint/naming-convention */ @@ -84,8 +80,6 @@ describe('Bookmarks', () => { it('should delete a bookmark by id', async () => { await nevermined.services.bookmarks.deleteOneById(id) - await sleep(4000) - const response = await nevermined.services.bookmarks.findManyByUserId(newBookmark.userId) /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/integration/nevermined/ConsumeAsset.test.ts b/integration/nevermined/ConsumeAsset.test.ts index 58501f717..21e0e58aa 100644 --- a/integration/nevermined/ConsumeAsset.test.ts +++ b/integration/nevermined/ConsumeAsset.test.ts @@ -108,7 +108,7 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status not fulfilled', async () => { - // todo change this, a test should never dependent on the previous test because the order might change during runtime + // TODO: change this, a test should never dependent on the previous test because the order might change during runtime await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) @@ -166,7 +166,7 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status fulfilled', async () => { - // todo change this, a test should never dependent on the previous test because the order might change during runtime + // TODO: change this, a test should never dependent on the previous test because the order might change during runtime await sleep(2000) const status = await nevermined.agreements.status(agreementId) diff --git a/integration/nevermined/ConsumeAssetViaNode.test.ts b/integration/nevermined/ConsumeAssetViaNode.test.ts index 0972ad612..b8b83ecb8 100644 --- a/integration/nevermined/ConsumeAssetViaNode.test.ts +++ b/integration/nevermined/ConsumeAssetViaNode.test.ts @@ -96,7 +96,7 @@ describe('Consume Asset (Nevermined Node)', () => { }) it('should get the lockPayment condition fulfilled', async () => { - // todo change this, a test should never dependent on the previous test because the order might change during runtime + // TODO: change this, a test should never dependent on the previous test because the order might change during runtime await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) diff --git a/integration/nevermined/ConsumeExternalDDOAsset.test.ts b/integration/nevermined/ConsumeExternalDDOAsset.test.ts index a027172b6..a5148c78d 100644 --- a/integration/nevermined/ConsumeExternalDDOAsset.test.ts +++ b/integration/nevermined/ConsumeExternalDDOAsset.test.ts @@ -105,7 +105,7 @@ describe('Consume Asset (Documentation example)', () => { }) it('should get the agreement conditions status not fulfilled', async () => { - // todo change this, a test should never dependent on the previous test because the order might change during runtime + // TODO: change this, a test should never dependent on the previous test because the order might change during runtime await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) @@ -156,7 +156,7 @@ describe('Consume Asset (Documentation example)', () => { }) it('should get the agreement conditions status fulfilled', async () => { - // todo change this, a test should never dependent on the previous test because the order might change during runtime + // TODO: change this, a test should never dependent on the previous test because the order might change during runtime await sleep(500) const status = await nevermined.agreements.status(agreementId) diff --git a/integration/nevermined/ContractEvent.test.ts b/integration/nevermined/ContractEvent.test.ts index 4221782f8..1d73390f1 100644 --- a/integration/nevermined/ContractEvent.test.ts +++ b/integration/nevermined/ContractEvent.test.ts @@ -67,6 +67,7 @@ describe('ContractEvent', () => { await Promise.all([executeTransaction()]) + // TODO: See if we can remove this sleep await sleep(2000) validResolve = true @@ -101,6 +102,7 @@ describe('ContractEvent', () => { await executeTransaction() + // TODO: See if we can remove this sleep await sleep(2000) canBeRejected = true @@ -118,6 +120,7 @@ describe('ContractEvent', () => { filterJsonRpc: { to }, }) + // TODO: See if we can remove this sleep await sleep(400) await executeTransaction() diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index bd9d8764c..47bcbac5b 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -217,6 +217,7 @@ function makeTest(isCustom) { ) agreementId = await nevermined.nfts1155.order(ddo.id, numberEditions, collector1) + // TODO: See if we can remove this await sleep(DELAY) assert.isDefined(agreementId) @@ -250,6 +251,8 @@ function makeTest(isCustom) { artist, ) assert.isTrue(receipt) + + // TODO: See if we can remove this await sleep(DELAY) console.debug( @@ -268,9 +271,12 @@ function makeTest(isCustom) { }) it('the artist asks and receives the payment', async () => { + // TODO: See if we can remove this await sleep(DELAY) const escrowPaymentConditionBefore = await token.balanceOf(escrowPaymentCondition.address) const service = ddo.findServiceByReference('nft-sales') + + // TODO: See if we can remove this await sleep(DELAY) const receipt = await nevermined.nfts1155.releaseRewards( agreementId, @@ -279,6 +285,8 @@ function makeTest(isCustom) { numberEditions, artist, ) + + // TODO: See if we can remove this await sleep(DELAY) assert.isTrue(receipt) diff --git a/integration/nevermined/Permissions.test.ts b/integration/nevermined/Permissions.test.ts index 3fe948114..9b8ff04d9 100644 --- a/integration/nevermined/Permissions.test.ts +++ b/integration/nevermined/Permissions.test.ts @@ -1,7 +1,6 @@ import { assert } from 'chai' import { config } from '../config' import { Nevermined, Account, NewPermission, PermissionType } from '../../src' -import { sleep } from '../utils/utils' describe('Permissions', () => { let nevermined: Nevermined @@ -51,7 +50,6 @@ describe('Permissions', () => { }) it('should get permissions by userId', async () => { - await sleep(2000) const response = await nevermined.services.permissions.findManyByUserId(newPermission.userId) /* eslint-disable @typescript-eslint/naming-convention */ @@ -64,7 +62,6 @@ describe('Permissions', () => { }) it('should get permissions by userId and type', async () => { - await sleep(2000) const response = await nevermined.services.permissions.findManyByUserIdAndType( newPermission.userId, PermissionType.Read, @@ -95,8 +92,6 @@ describe('Permissions', () => { it('should delete a permission by id', async () => { await nevermined.services.permissions.deleteOneById(id) - await sleep(2000) - const response = await nevermined.services.permissions.findManyByUserId(newPermission.userId) /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/integration/nevermined/Profiles.test.ts b/integration/nevermined/Profiles.test.ts index cf864518a..cc734f245 100644 --- a/integration/nevermined/Profiles.test.ts +++ b/integration/nevermined/Profiles.test.ts @@ -2,7 +2,6 @@ import { assert } from 'chai' import { config } from '../config' import { Nevermined, Account, Logger, NewProfile, State } from '../../src' import { faker } from '@faker-js/faker' -import { sleep } from '../utils/utils' describe('User Profiles', () => { let nevermined: Nevermined @@ -60,7 +59,6 @@ describe('User Profiles', () => { }) it('should get a profile by address', async () => { - await sleep(2000) const response = await nevermined.services.profiles.findOneByAddress(account3.getId()) assert.deepEqual(response, { diff --git a/integration/nevermined/Provenance.test.ts b/integration/nevermined/Provenance.test.ts index f2f90159e..181cadb0a 100644 --- a/integration/nevermined/Provenance.test.ts +++ b/integration/nevermined/Provenance.test.ts @@ -35,6 +35,8 @@ describe('Provenance', () => { metadata.userId = payload.sub ddo = await nevermined.assets.create(AssetAttributes.getInstance({ metadata }), publisher) + + // TODO: See if we can remove this await sleep(2000) const provenance = await nevermined.provenance.getProvenanceEntry(ddo.shortId()) @@ -119,6 +121,7 @@ describe('Provenance', () => { const pm = ProvenanceMethod // wait for the graph to pickup the event + // TODO: See if we can remove this await sleep(3000) const events = await nevermined.provenance.getDIDProvenanceEvents(ddo.shortId()) @@ -136,7 +139,9 @@ describe('Provenance', () => { }) it('should return the events of an specific method by DID', async () => { + // TODO: See if we can remove this await sleep(2000) + const events = await Promise.all( [ 'WAS_GENERATED_BY', diff --git a/integration/nevermined/SearchAsset.test.ts b/integration/nevermined/SearchAsset.test.ts index 6cbbab507..6141d4e36 100644 --- a/integration/nevermined/SearchAsset.test.ts +++ b/integration/nevermined/SearchAsset.test.ts @@ -3,7 +3,6 @@ import { decodeJwt } from 'jose' import { config } from '../config' import { getMetadata } from '../utils' import { Nevermined, Account, DDO, AssetAttributes } from '../../src' -import { sleep } from '../utils/utils' import { generateId } from '../../src/utils' describe('Search Asset', () => { @@ -40,9 +39,6 @@ describe('Search Asset', () => { metadata = getMetadata(undefined, 'Test3') metadata.userId = userId await nevermined.assets.create(AssetAttributes.getInstance({ metadata, appId }), account) - - // wait for elasticsearch - await sleep(4000) }) it('should search by text', async () => { diff --git a/integration/nevermined/SubgraphEvent.test.ts b/integration/nevermined/SubgraphEvent.test.ts index 32d600c06..d52dcf8d1 100644 --- a/integration/nevermined/SubgraphEvent.test.ts +++ b/integration/nevermined/SubgraphEvent.test.ts @@ -74,6 +74,7 @@ describe('SubgraphEvent', () => { await Promise.all([executeTransaction()]) + // TODO: See if we can remove this await sleep(2000) validResolve = true @@ -113,9 +114,13 @@ describe('SubgraphEvent', () => { }) await executeTransaction() + + // TODO: See if we can remove this await sleep(2000) await executeTransaction() await waitUntilEvent + + // TODO: See if we can remove this await sleep(2000) }) @@ -135,6 +140,7 @@ describe('SubgraphEvent', () => { }, }) + // TODO: See if we can remove this await sleep(400) await executeTransaction() From 648eb19311cf6bb5427c5aca97c900aaa1e9767d Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 9 Aug 2023 10:09:43 +0200 Subject: [PATCH 068/151] feat: improve tests speed --- integration/compute/ComputeAsset.test.ts | 3 ++- .../nevermined/AgreementStoreManager.test.ts | 5 ----- integration/nevermined/AssetOwners.test.ts | 6 +----- .../nevermined/AssetsWithMultipleServices.test.ts | 4 +--- integration/nevermined/ConsumeAsset.test.ts | 6 +----- integration/nevermined/ConsumeAssetViaNode.test.ts | 4 +--- .../nevermined/ConsumeExternalDDOAsset.test.ts | 6 +----- integration/nevermined/ContractEvent.test.ts | 11 +---------- integration/nevermined/NFT1155Api.e2e.test.ts | 14 -------------- integration/nevermined/NFT721Templates.test.ts | 6 ------ integration/nevermined/NFTTemplates.test.ts | 6 ------ .../nevermined/NFTTemplatesWithEther.test.ts | 3 --- integration/nevermined/Provenance.test.ts | 11 ----------- .../nevermined/RegisterAccessTemplate.test.ts | 5 ----- .../RegisterEscrowComputeExecutionTemplate.test.ts | 5 ----- integration/nevermined/SecondaryMarket.test.ts | 6 ------ 16 files changed, 8 insertions(+), 93 deletions(-) diff --git a/integration/compute/ComputeAsset.test.ts b/integration/compute/ComputeAsset.test.ts index 61ba287e6..b059ca79e 100644 --- a/integration/compute/ComputeAsset.test.ts +++ b/integration/compute/ComputeAsset.test.ts @@ -5,6 +5,7 @@ import { config } from '../config' import { workflowMetadatas } from '../utils' import { Nevermined, DDO, Account, AssetPrice, AssetAttributes } from '../../src' +import { sleep } from '../utils/utils' describe('Compute Asset', () => { let nevermined: Nevermined @@ -112,7 +113,7 @@ describe('Compute Asset', () => { console.log('Fetching compute status...') attemp++ - await new Promise((f) => setTimeout(f, wait)) + await sleep(wait) statusObject = await nvm.compute.status(agreementID, argoWorkflowId, account) console.log(statusResponse) diff --git a/integration/nevermined/AgreementStoreManager.test.ts b/integration/nevermined/AgreementStoreManager.test.ts index ea3adcc1d..a91f1fd63 100644 --- a/integration/nevermined/AgreementStoreManager.test.ts +++ b/integration/nevermined/AgreementStoreManager.test.ts @@ -13,7 +13,6 @@ import { import { config } from '../config' import { getMetadata } from '../utils' import { decodeJwt } from 'jose' -import { sleep } from '../utils/utils' chai.use(chaiAsPromised) @@ -57,10 +56,6 @@ describe('Agreement Store Manager', () => { ) agreementId = await nevermined.assets.order(ddo.id, 'access', account2) - // wait for the graph to pickup the event - // TODO: See if we can remove this - await sleep(3000) - agreements = await nevermined.agreements.getAgreements(ddo.id) assert.isNotEmpty(agreements) diff --git a/integration/nevermined/AssetOwners.test.ts b/integration/nevermined/AssetOwners.test.ts index 8147da361..65dfcc939 100644 --- a/integration/nevermined/AssetOwners.test.ts +++ b/integration/nevermined/AssetOwners.test.ts @@ -10,7 +10,7 @@ import { MetaData, } from '../../src' import { decodeJwt } from 'jose' -import { mineBlocks, sleep } from '../utils/utils' +import { mineBlocks } from '../utils/utils' describe('Asset Owners', () => { let nevermined: Nevermined @@ -107,10 +107,6 @@ describe('Asset Owners', () => { await mineBlocks(nevermined, account1, 1) - // wait a bit for the subgraph to index the events - // TODO: See if we can remove this - await sleep(5000) - const result = await nevermined.assets.ownerAssets(account2.getId()) assert.includeMembers(result, [ddo.id]) }) diff --git a/integration/nevermined/AssetsWithMultipleServices.test.ts b/integration/nevermined/AssetsWithMultipleServices.test.ts index 62028a647..392dd393e 100644 --- a/integration/nevermined/AssetsWithMultipleServices.test.ts +++ b/integration/nevermined/AssetsWithMultipleServices.test.ts @@ -12,7 +12,7 @@ import { ConditionState, Token, } from '../../src' -import { repeat, sleep } from '../utils/utils' +import { repeat } from '../utils/utils' let nevermined: Nevermined let publisher: Account @@ -111,8 +111,6 @@ describe('Assets with multiple services', () => { const price = service.attributes.main.price agreementId = await nevermined.assets.order(ddo.id, service.index, consumer) - // TODO: See if we can remove this - await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) assert.deepEqual(status, { diff --git a/integration/nevermined/ConsumeAsset.test.ts b/integration/nevermined/ConsumeAsset.test.ts index 21e0e58aa..e6381833b 100644 --- a/integration/nevermined/ConsumeAsset.test.ts +++ b/integration/nevermined/ConsumeAsset.test.ts @@ -4,7 +4,7 @@ import { decodeJwt } from 'jose' import { config } from '../config' import { getAssetPrice, getMetadata } from '../utils' -import { repeat, sleep } from '../utils/utils' +import { repeat } from '../utils/utils' import { Nevermined, @@ -108,8 +108,6 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status not fulfilled', async () => { - // TODO: change this, a test should never dependent on the previous test because the order might change during runtime - await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) assert.deepEqual(status, { @@ -166,8 +164,6 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status fulfilled', async () => { - // TODO: change this, a test should never dependent on the previous test because the order might change during runtime - await sleep(2000) const status = await nevermined.agreements.status(agreementId) assert.deepEqual(status, { diff --git a/integration/nevermined/ConsumeAssetViaNode.test.ts b/integration/nevermined/ConsumeAssetViaNode.test.ts index b8b83ecb8..2a8926030 100644 --- a/integration/nevermined/ConsumeAssetViaNode.test.ts +++ b/integration/nevermined/ConsumeAssetViaNode.test.ts @@ -15,7 +15,7 @@ import { AssetPrice, AssetAttributes, } from '../../src' -import { repeat, sleep } from '../utils/utils' +import { repeat } from '../utils/utils' import { ethers } from 'ethers' describe('Consume Asset (Nevermined Node)', () => { @@ -96,8 +96,6 @@ describe('Consume Asset (Nevermined Node)', () => { }) it('should get the lockPayment condition fulfilled', async () => { - // TODO: change this, a test should never dependent on the previous test because the order might change during runtime - await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) assert.deepEqual(status, { diff --git a/integration/nevermined/ConsumeExternalDDOAsset.test.ts b/integration/nevermined/ConsumeExternalDDOAsset.test.ts index a5148c78d..388f1639a 100644 --- a/integration/nevermined/ConsumeExternalDDOAsset.test.ts +++ b/integration/nevermined/ConsumeExternalDDOAsset.test.ts @@ -13,7 +13,7 @@ import { AssetAttributes, } from '../../src' import { getMetadata } from '../utils' -import { repeat, sleep } from '../utils/utils' +import { repeat } from '../utils/utils' import { AgreementPrepareResult } from '../../src/nevermined/api/AgreementsApi' describe('Consume Asset (Documentation example)', () => { @@ -105,8 +105,6 @@ describe('Consume Asset (Documentation example)', () => { }) it('should get the agreement conditions status not fulfilled', async () => { - // TODO: change this, a test should never dependent on the previous test because the order might change during runtime - await sleep(3000) const status = await repeat(3, nevermined.agreements.status(agreementId)) assert.deepEqual(status, { @@ -156,8 +154,6 @@ describe('Consume Asset (Documentation example)', () => { }) it('should get the agreement conditions status fulfilled', async () => { - // TODO: change this, a test should never dependent on the previous test because the order might change during runtime - await sleep(500) const status = await nevermined.agreements.status(agreementId) assert.deepEqual(status, { diff --git a/integration/nevermined/ContractEvent.test.ts b/integration/nevermined/ContractEvent.test.ts index 1d73390f1..46f4be74b 100644 --- a/integration/nevermined/ContractEvent.test.ts +++ b/integration/nevermined/ContractEvent.test.ts @@ -3,7 +3,7 @@ import { config } from '../config' import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' import { ContractEvent } from '../../src/events' -import { sleep, mineBlocks, awaitTimeout } from '../utils/utils' +import { mineBlocks, awaitTimeout } from '../utils/utils' import { ethers } from 'ethers' chai.use(chaiAsPromised) @@ -67,8 +67,6 @@ describe('ContractEvent', () => { await Promise.all([executeTransaction()]) - // TODO: See if we can remove this sleep - await sleep(2000) validResolve = true await Promise.all([executeTransaction()]) @@ -101,9 +99,6 @@ describe('ContractEvent', () => { }) await executeTransaction() - - // TODO: See if we can remove this sleep - await sleep(2000) canBeRejected = true await executeTransaction() @@ -119,10 +114,6 @@ describe('ContractEvent', () => { eventName: 'Transfer', filterJsonRpc: { to }, }) - - // TODO: See if we can remove this sleep - await sleep(400) - await executeTransaction() await waitUntilEvent diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 47bcbac5b..5605cd374 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -21,12 +21,9 @@ import '../globals' import { AssetAttributes } from '../../src/models/AssetAttributes' import { NFTAttributes } from '../../src/models/NFTAttributes' import { DIDResolvePolicy } from '../../src/nevermined/api/RegistryBaseApi' -import { sleep } from '../utils/utils' chai.use(chaiAsPromised) -const DELAY = 20000 - function makeTest(isCustom) { describe(`NFTs 1155 Api End-to-End (${isCustom ? 'custom' : 'builtin'} token)`, () => { let artist: Account @@ -217,8 +214,6 @@ function makeTest(isCustom) { ) agreementId = await nevermined.nfts1155.order(ddo.id, numberEditions, collector1) - // TODO: See if we can remove this - await sleep(DELAY) assert.isDefined(agreementId) const collector1BalanceAfter = await token.balanceOf(collector1.getId()) @@ -252,9 +247,6 @@ function makeTest(isCustom) { ) assert.isTrue(receipt) - // TODO: See if we can remove this - await sleep(DELAY) - console.debug( `Contract balance (after) ${await token.balanceOf(escrowPaymentCondition.address)}`, ) @@ -271,13 +263,9 @@ function makeTest(isCustom) { }) it('the artist asks and receives the payment', async () => { - // TODO: See if we can remove this - await sleep(DELAY) const escrowPaymentConditionBefore = await token.balanceOf(escrowPaymentCondition.address) const service = ddo.findServiceByReference('nft-sales') - // TODO: See if we can remove this - await sleep(DELAY) const receipt = await nevermined.nfts1155.releaseRewards( agreementId, ddo.id, @@ -286,8 +274,6 @@ function makeTest(isCustom) { artist, ) - // TODO: See if we can remove this - await sleep(DELAY) assert.isTrue(receipt) const escrowPaymentConditionBalanceAfter = await token.balanceOf( diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index 313560fe8..9eb373655 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -393,9 +393,6 @@ describe('NFT721Templates E2E', () => { }) it('The collector demonstrates it owns the NFT', async function () { - // TODO: Not sure why we need to wait here but without this the - // the fulfillment will fail - await new Promise((r) => setTimeout(r, 10000)) await nft721HolderCondition.fulfill( agreementAccessId, ddo.shortId(), @@ -767,9 +764,6 @@ describe('NFT721Templates E2E', () => { }) it('The collector demonstrates it owns the NFT', async function () { - // TODO: Not sure why we need to wait here but without this the - // the fulfillment will fail - await new Promise((r) => setTimeout(r, 10000)) const result = await nevermined.agreements.conditions.holderNft721( agreementAccessId, ddo, diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index e79974aee..de8c3046e 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -393,9 +393,6 @@ describe('NFTTemplates E2E', () => { }) it('The collector demonstrates it owns the NFT', async function () { - // TODO: Not sure why we need to wait here but without this the - // the fulfillment will fail - await new Promise((r) => setTimeout(r, 10000)) await nftHolderCondition.fulfill( agreementAccessId, ddo.id, @@ -757,9 +754,6 @@ describe('NFTTemplates E2E', () => { }) it('The collector demonstrates it owns the NFT', async function () { - // TODO: Not sure why we need to wait here but without this the - // the fulfillment will fail - await new Promise((r) => setTimeout(r, 10000)) const result = await nevermined.agreements.conditions.holderNft( agreementAccessId, ddo.id, diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index 1166b9cc1..fce837b74 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -378,9 +378,6 @@ describe('NFTTemplates With Ether E2E', async () => { }) it('The collector demonstrates it owns the NFT', async function () { - // TODO: Not sure why we need to wait here but without this the - // the fulfillment will fail - await new Promise((r) => setTimeout(r, 10000)) await nftHolderCondition.fulfill( agreementAccessId, ddo.shortId(), diff --git a/integration/nevermined/Provenance.test.ts b/integration/nevermined/Provenance.test.ts index 181cadb0a..04cbedd1e 100644 --- a/integration/nevermined/Provenance.test.ts +++ b/integration/nevermined/Provenance.test.ts @@ -3,7 +3,6 @@ import { decodeJwt } from 'jose' import { config } from '../config' import { getMetadata } from '../utils' import { Nevermined, Account, DDO, zeroX, generateId, AssetAttributes } from '../../src' -import { sleep } from '../utils/utils' import { ethers } from 'ethers' import { ProvenanceMethod } from '../../src/keeper' @@ -36,8 +35,6 @@ describe('Provenance', () => { ddo = await nevermined.assets.create(AssetAttributes.getInstance({ metadata }), publisher) - // TODO: See if we can remove this - await sleep(2000) const provenance = await nevermined.provenance.getProvenanceEntry(ddo.shortId()) assert.equal(zeroX(provenance.did), zeroX(ddo.shortId())) @@ -119,11 +116,6 @@ describe('Provenance', () => { it('should return the events associated to DID', async () => { const pm = ProvenanceMethod - - // wait for the graph to pickup the event - // TODO: See if we can remove this - await sleep(3000) - const events = await nevermined.provenance.getDIDProvenanceEvents(ddo.shortId()) assert.deepEqual( @@ -139,9 +131,6 @@ describe('Provenance', () => { }) it('should return the events of an specific method by DID', async () => { - // TODO: See if we can remove this - await sleep(2000) - const events = await Promise.all( [ 'WAS_GENERATED_BY', diff --git a/integration/nevermined/RegisterAccessTemplate.test.ts b/integration/nevermined/RegisterAccessTemplate.test.ts index f6bf2472a..06d74498c 100644 --- a/integration/nevermined/RegisterAccessTemplate.test.ts +++ b/integration/nevermined/RegisterAccessTemplate.test.ts @@ -13,7 +13,6 @@ import { } from '../../src/keeper' import { getMetadata } from '../utils' import { generateId } from '../../src/utils' -import { sleep } from '../utils/utils' import { EventLog } from 'ethers' describe('Register Escrow Access Template', () => { @@ -56,8 +55,6 @@ describe('Register Escrow Access Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { await keeper.templateStoreManager.proposeTemplate(accessTemplate.address, consumer, true) - // TODO: Use a event to detect template mined - await sleep(2000) }) it('should approve the template', async () => { @@ -66,8 +63,6 @@ describe('Register Escrow Access Template', () => { templateManagerOwner, true, ) - // TODO: Use a event to detect template mined - await sleep(2000) }) }) diff --git a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts index 6cb8a60c8..a1a4f8302 100644 --- a/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/integration/nevermined/RegisterEscrowComputeExecutionTemplate.test.ts @@ -17,7 +17,6 @@ import { import { Token } from '../../src/keeper' import { getMetadata } from '../utils' import { generateId } from '../../src/utils' -import { sleep } from '../utils/utils' import { EventLog } from 'ethers' describe('Register Escrow Compute Execution Template', () => { @@ -67,8 +66,6 @@ describe('Register Escrow Compute Execution Template', () => { consumer, true, ) - // TODO: Use a event to detect template mined - await sleep(2000) }) it('should approve the template', async () => { @@ -77,8 +74,6 @@ describe('Register Escrow Compute Execution Template', () => { templateManagerOwner, true, ) - // TODO: Use a event to detect template mined - await sleep(2000) }) }) diff --git a/integration/nevermined/SecondaryMarket.test.ts b/integration/nevermined/SecondaryMarket.test.ts index 5ae9ccf5f..e31905333 100644 --- a/integration/nevermined/SecondaryMarket.test.ts +++ b/integration/nevermined/SecondaryMarket.test.ts @@ -309,9 +309,6 @@ describe('Secondary Markets', () => { }) it('The collector demonstrates it owns the NFT', async function () { - // TODO: Not sure why we need to wait here but without this the - // the fulfillment will fail - await new Promise((r) => setTimeout(r, 10000)) const result = await nevermined.agreements.conditions.holderNft( agreementAccessId, ddo.id, @@ -524,9 +521,6 @@ describe('Secondary Markets', () => { }) it('The collector2 demonstrates it owns the NFT', async function () { - // TODO: Not sure why we need to wait here but without this the - // the fulfillment will fail - await new Promise((r) => setTimeout(r, 10000)) const result = await nevermined.agreements.conditions.holderNft( agreementAccessId2, ddo.id, From 5263d36a89922dfa474c931776241d8b4f5d1ed0 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:54:57 +0200 Subject: [PATCH 069/151] feat: burning editions for NFT-1155 Credit subscriptions --- integration/nevermined/Credits.e2e.test.ts | 11 +++-- package.json | 2 +- src/ddo/DDO.ts | 10 +++- src/ddo/types.ts | 2 +- src/keeper/contracts/ContractBase.ts | 4 +- src/keeper/contracts/Nft1155Contract.ts | 26 ++++++++-- .../contracts/templates/AccessTemplate.ts | 3 -- .../templates/BaseTemplate.abstract.ts | 11 +++-- .../templates/NFT721AccessTemplate.ts | 4 -- .../contracts/templates/NFTAccessTemplate.ts | 40 +++++++++++++--- src/nevermined/AccessService.ts | 24 +++++++--- src/nevermined/api/nfts/NFT1155Api.ts | 47 +++++++++++++++++-- 12 files changed, 144 insertions(+), 40 deletions(-) diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index 7de6808c8..9c5984ad4 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -150,6 +150,8 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { await nevermined.contracts.loadNft1155Api(subscriptionNFT) await subscriptionNFT.grantOperatorRole(transferNftCondition.address, editor) + console.debug(`Granting operator role to Nevermined Node Address: ${neverminedNodeAddress}`) + await subscriptionNFT.grantOperatorRole(neverminedNodeAddress, editor) assert.equal(nevermined.nfts1155.getContract.address, subscriptionNFT.address) @@ -323,7 +325,7 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { }] of the subscriber ${subscriber.getId()}`, ) const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) - console.log(`Balance After: ${balanceAfter}`) + console.log(`Balance After Purchase is completed: ${balanceAfter}`) assert.isTrue(balanceAfter === subscriptionCredits) }) }) @@ -341,10 +343,9 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { }) it('The balance of the subscriber should be lower because credits got used', async () => { - assert.isTrue( - (await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId())) === - subscriptionCredits - accessCostInCredits, - ) + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Burn: ${balanceAfter}`) + assert.isTrue(balanceAfter === subscriptionCredits - accessCostInCredits) }) }) }) diff --git a/package.json b/package.json index e262aa247..9028cf7a5 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "ts-node": "^10.9.1", "typedoc": "^0.24.7", "typedoc-plugin-markdown": "^3.13.4", - "typescript": "^5.0.4", + "typescript": "^5.1.6", "url": "^0.11.0", "webpack": "^5.69.1", "webpack-cli": "^5.0.2", diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index ab44ad6ad..81d0f3119 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -448,7 +448,10 @@ export class DDO { * @returns the NFT Token Id */ public static getTokenIdFromService(service: Service): string { - return DDO.getParameterFromCondition(service, 'nftHolder', '_tokenId') as string + const paramName = '_tokenId' + const conditionName = service.type === 'nft-access' ? 'nftHolder' : 'transferNFT' + const nftCondition = DDO.findServiceConditionByName(service, conditionName) + return nftCondition.parameters.find((p) => p.name === paramName).value as string } /** @@ -457,7 +460,10 @@ export class DDO { * @returns the number of NFTs */ public static getNftAmountFromService(service: Service): bigint { - return BigInt(DDO.getParameterFromCondition(service, 'transferNFT', '_numberNfts').toString()) + const paramName = '_numberNfts' + const conditionName = service.type === 'nft-access' ? 'nftHolder' : 'transferNFT' + const nftCondition = DDO.findServiceConditionByName(service, conditionName) + return BigInt(nftCondition.parameters.find((p) => p.name === paramName).value as string) } /** diff --git a/src/ddo/types.ts b/src/ddo/types.ts index b50c92744..033a53406 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -744,7 +744,7 @@ export interface ServicePlugin { // Check if service can be granted without agreement accept(params: ValidationParams): Promise // It registers the usage of a service - track(params: ValidationParams): Promise + track(params: ValidationParams, from: Account, txparams?: TxParameters): Promise } export interface ServiceAgreementTemplateParameter { diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 822bd43f1..9b0a5fe9f 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -8,7 +8,7 @@ import { FunctionFragment, ethers, } from 'ethers' -import { parseUnits } from '../../sdk' +import { jsonReplacer, parseUnits } from '../../sdk' export interface TxParameters { value?: string gasLimit?: bigint @@ -234,7 +234,7 @@ export abstract class ContractBase extends Instantiable { } failed.\n Error: ${err.info.error.message}\n From: ${from}\n - Parameters: ${JSON.stringify(mappedArgs, null, 2)}\n + Parameters: ${JSON.stringify(mappedArgs, jsonReplacer, 2)}\n ${'-'.repeat(40)} `) } diff --git a/src/keeper/contracts/Nft1155Contract.ts b/src/keeper/contracts/Nft1155Contract.ts index 23e173448..bac30d3b4 100644 --- a/src/keeper/contracts/Nft1155Contract.ts +++ b/src/keeper/contracts/Nft1155Contract.ts @@ -163,13 +163,33 @@ export class Nft1155Contract extends NFTContractsBase { * It burns some editions of a NFT (ERC-1155) * * @param from - Account address burning the NFT editions - * @param did - The NFT id to burn + * @param tokenId - The NFT id to burn * @param amount - Number of editions to burn * @param txParams - Transaction additional parameters * @returns Contract Receipt */ - public async burn(from: string, did: string, amount: bigint, txParams?: TxParameters) { - return this.send('burn', from, [from, didZeroX(did), amount], txParams) + public async burn(from: string, tokenId: string, amount: bigint, txParams?: TxParameters) { + return this.send('burn', from, [from, didZeroX(tokenId), amount], txParams) + } + + /** + * It burns some editions of a NFT (ERC-1155) + * + * @param holder - Address of the account holding the NFT editions that are going to be burned + * @param tokenId - The NFT id to burn + * @param amount - Number of editions to burn + * @param from - Account address burning the NFT editions + * @param txParams - Transaction additional parameters + * @returns Contract Receipt + */ + public async burnFromHolder( + holder: string, + tokenId: string, + amount: bigint, + from: string, + txParams?: TxParameters, + ) { + return this.send('burn', from, [holder, didZeroX(tokenId), amount], txParams) } /** diff --git a/src/keeper/contracts/templates/AccessTemplate.ts b/src/keeper/contracts/templates/AccessTemplate.ts index 75a55ce54..40469d680 100644 --- a/src/keeper/contracts/templates/AccessTemplate.ts +++ b/src/keeper/contracts/templates/AccessTemplate.ts @@ -101,7 +101,4 @@ export class AccessTemplate extends BaseTemplate { - return true - } } diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 82db418d4..863572a55 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -9,7 +9,7 @@ import { ServiceType, ValidationParams, } from '../../../ddo' -import { Account, Condition, MetaData, NFTAttributes, jsonReplacer } from '../../../sdk' +import { Account, Condition, MetaData, NFTAttributes } from '../../../sdk' import { TxParameters } from '../ContractBase' import { ConditionInstance, ConditionState } from '../conditions' import { isAddress } from 'ethers' @@ -99,9 +99,12 @@ export abstract class BaseTemplate return false } - public async track(params: ValidationParams): Promise { - console.debug(`*** Register Usage: ${JSON.stringify(params, jsonReplacer)}`) - return true + public async track( + _params: ValidationParams, + _from: Account, + _txparams?: TxParameters, + ): Promise { + return false } public async process( diff --git a/src/keeper/contracts/templates/NFT721AccessTemplate.ts b/src/keeper/contracts/templates/NFT721AccessTemplate.ts index 1a223998f..88b5d26fd 100644 --- a/src/keeper/contracts/templates/NFT721AccessTemplate.ts +++ b/src/keeper/contracts/templates/NFT721AccessTemplate.ts @@ -100,8 +100,4 @@ export class NFT721AccessTemplate extends BaseTemplate< const nftContract = await this.nevermined.contracts.loadNft721(contractAddress) return (await nftContract.balanceOf(new Account(params.consumer_address))) > 0n } - - public async track(_params: ValidationParams): Promise { - return true - } } diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index 004e75c4c..10e669d80 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -5,7 +5,7 @@ import { ValidationParams, } from '../../../ddo' import { InstantiableConfig } from '../../../Instantiable.abstract' -import { DDO, jsonReplacer, zeroX } from '../../../sdk' +import { Account, DDO, NeverminedNFT1155Type, TxParameters } from '../../../sdk' import { AgreementInstance, AgreementTemplate } from './AgreementTemplate.abstract' import { BaseTemplate } from './BaseTemplate.abstract' import { nftAccessTemplateServiceAgreementTemplate } from './NFTAccessTemplate.serviceAgreementTemplate' @@ -73,7 +73,6 @@ export class NFTAccessTemplate extends BaseTemplate { - console.debug(`-- Calling accept with params: ${JSON.stringify(params, jsonReplacer)}`) if ( await this.nevermined.keeper.conditions.nftAccessCondition.checkPermissions( params.consumer_address, @@ -92,8 +91,7 @@ export class NFTAccessTemplate extends BaseTemplate 0 ? zeroX(serviceTokenId) : params.did + const tokenId = DDO.getTokenIdFromService(service) || ddo.id const nftContract = await this.nevermined.contracts.loadNft1155(contractAddress) @@ -102,8 +100,38 @@ export class NFTAccessTemplate extends BaseTemplate= limit } - public async track(_params: ValidationParams): Promise { - console.debug(`-- Calling track( with params`) + public async track( + params: ValidationParams, + from: Account, + txparams?: TxParameters, + ): Promise { + const ddo = await this.nevermined.assets.resolve(params.did) + const metadataService = ddo.findServiceByType('metadata') + + const isNft1155Credit = + metadataService.attributes.main.nftType.toString() === + NeverminedNFT1155Type.nft1155Credit.toString() + if (!isNft1155Credit) { + // Service is not NFT1155Credit, skipping track() + return false + } + + const nftAccessService = + params.service_index && params.service_index > 0 + ? ddo.findServiceByIndex(params.service_index) + : ddo.findServiceByType(this.service()) + + const contractAddress = DDO.getNftContractAddressFromService( + nftAccessService as ServiceNFTAccess, + ) + + const amount = DDO.getNftAmountFromService(nftAccessService) + const tokenId = DDO.getTokenIdFromService(nftAccessService) || ddo.id + + const nftContract = await this.nevermined.contracts.loadNft1155(contractAddress) + + await nftContract.burnFromHolder(params.consumer_address, tokenId, amount, from, txparams) + return true } } diff --git a/src/nevermined/AccessService.ts b/src/nevermined/AccessService.ts index 46e5556cc..7b9f0ab60 100644 --- a/src/nevermined/AccessService.ts +++ b/src/nevermined/AccessService.ts @@ -62,8 +62,12 @@ export class AccessService extends Instantiable implements ServicePlugin { return this.normal.accept(params) } - public async track(params: ValidationParams): Promise { - return this.normal.track(params) + public async track( + params: ValidationParams, + from: Account, + txparams?: TxParameters, + ): Promise { + return this.normal.track(params, from, txparams) } } @@ -113,10 +117,14 @@ export class NFTAccessService extends Instantiable implements ServicePlugin { + public async track( + params: ValidationParams, + from: Account, + txparams?: TxParameters, + ): Promise { const ddo = await this.nevermined.assets.resolve(params.did) const metadata = ddo.findServiceByType('metadata').attributes.main - return this.select(metadata).track(params) + return this.select(metadata).track(params, from, txparams) } } @@ -166,9 +174,13 @@ export class NFTSalesService extends Instantiable implements ServicePlugin { + public async track( + params: ValidationParams, + from: Account, + txparams?: TxParameters, + ): Promise { const ddo = await this.nevermined.assets.resolve(params.did) const metadata = ddo.findServiceByType('metadata').attributes.main - return this.select(metadata).track(params) + return this.select(metadata).track(params, from, txparams) } } diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index eed5be608..bc7105bea 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -168,15 +168,56 @@ export class NFT1155Api extends NFTsBaseApi { * ) * ``` * - * @param did - The Decentralized Identifier of the NFT asset. + * @param tokenId - The Decentralized Identifier of the NFT asset. + * @param nftAmount - The amount of NFTs to burn. + * @param account - The account of the publisher of the NFT. + * @param txParams - Optional transaction parameters. + * + * @returns The {@link ethers.ContractTransactionReceipt} + */ + public async burn(tokenId: string, nftAmount: bigint, account: Account, txParams?: TxParameters) { + return await this.nftContract.burn(account.getId(), tokenId, nftAmount, txParams) + } + + /** + * Burn NFTs associated with an asset of a specific account. + * + * @remarks + * The publisher can only burn NFTs of an account if is an operator. NFTs that were already transferred cannot be burned by the publisher. + * + * @example + * ```ts + * await nevermined.nfts1155.burnTo( + * holder, + * tokenId, + * 2n, + * artist + * ) + * ``` + * + * @param holder - The address of the account that holds the NFTs. + * @param tokenId - The TokenId of the NFT * @param nftAmount - The amount of NFTs to burn. * @param account - The account of the publisher of the NFT. * @param txParams - Optional transaction parameters. * * @returns The {@link ethers.ContractTransactionReceipt} */ - public async burn(did: string, nftAmount: bigint, account: Account, txParams?: TxParameters) { - return await this.nftContract.burn(account.getId(), did, nftAmount, txParams) + public async burnFromHolder( + holder: string, + tokenId: string, + nftAmount: bigint, + account: Account | string, + txParams?: TxParameters, + ) { + const _senderAddress = account instanceof Account ? account.getId() : account + return await this.nftContract.burnFromHolder( + holder, + tokenId, + nftAmount, + _senderAddress, + txParams, + ) } // TODO: We need to improve this to allow for secondary market sales From 139208f655f03a4aa1f3d549cebd397a6dc30953 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:58:52 +0200 Subject: [PATCH 070/151] chore: bumping to rc6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9028cf7a5..e99e8e01b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc5", + "version": "2.0.0-rc6", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 42267664464f04984373de20f0e3fba55d62a156 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 9 Aug 2023 13:27:55 +0200 Subject: [PATCH 071/151] feat: remove code coverage related tooling. not being used --- .github/workflows/testing-nightly.yml | 4 +-- .github/workflows/testing-node.yml | 2 +- .github/workflows/testing.yml | 4 +-- package.json | 36 +++------------------------ 4 files changed, 8 insertions(+), 38 deletions(-) diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index 804f871c0..b3ae79c99 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -46,7 +46,7 @@ jobs: env: ETH_PORT: 18545 run: | - yarn run test:cover + yarn test:all subgraph-integration: runs-on: ubuntu-latest @@ -156,7 +156,7 @@ jobs: IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }} IPFS_PROJECT_SECRET: ${{ secrets.IPFS_PROJECT_SECRET }} LOG_LEVEL: 1 # If LOG_LEVEL is >1 it will print the logger.debug calls - run: yarn run integration:cover + run: yarn integration:all mumbai-integration: runs-on: ubuntu-latest diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 86dd6e2f3..4326821f2 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -59,7 +59,7 @@ jobs: NEVERMINED_NODE_URI: http://localhost:8030 run: | nvm-tools copy-artifacts ./artifacts - yarn run integration:cover + yarn integration:all - name: Upload node logs uses: actions/upload-artifact@v2 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index f8ee80483..7e62483f7 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -38,7 +38,7 @@ jobs: IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }} IPFS_PROJECT_SECRET: ${{ secrets.IPFS_PROJECT_SECRET }} LOG_LEVEL: 1 # If LOG_LEVEL is >1 it will print the logger.debug calls - run: yarn run integration:cover + run: yarn integration:all unit-tests: runs-on: ubuntu-latest @@ -82,4 +82,4 @@ jobs: ETH_PORT: 18545 SEED_WORDS: ${{ secrets.seedWords }} run: | - yarn run test:cover + yarn test:all diff --git a/package.json b/package.json index 38c4b4ba1..e7bcb3772 100644 --- a/package.json +++ b/package.json @@ -6,22 +6,16 @@ "typings": "./dist/node/sdk.d.ts", "unpkg": "./dist/browser/sdk.cjs2.min.js", "scripts": { - "start": "npm link @nevermined-io/contracts && npm run build:watch", "build": "npm run clean && npm run build:tsc && npm run build:dist", "build:tsc": "tsc --sourceMap", "build:metadata": "./scripts/get-metadata.js > src/metadata.json", "build:dist": "cross-env NODE_ENV=production webpack", "build:watch": "tsc -w", - "test": "mocha --config test/.mocharc.json ./test/**/*.test.ts", - "test:watch": "mocha -w --watch-extensions js,ts,json", - "test:cover": "nyc --report-dir coverage/unit mocha --config test/.mocharc.json ./test/**/*.test.ts", + "test": "mocha --config test/.mocharc.json ", + "test:all": "test ./test/**/*.test.ts", "integration": "mocha --config integration/.mocharc.json ", + "integration:all": "mocha --config integration/.mocharc.json ./integration/nevermined/*.test.ts", "integration:subgraph": "mocha --config integration/.mocharc.json ./integration/**/*.test.subgraph.ts", - "integration:production": "export NETWORK_NAME=production; yarn integration", - "integration:staging": "export NETWORK_NAME=staging; yarn integration", - "integration:integration": "export NETWORK_NAME=integration; yarn integration", - "integration:watch": "mocha -w --watch-extensions js,ts,json --config integration/.mocharc.json ./integration/**/*.test.ts", - "integration:cover": "nyc --report-dir coverage/integration mocha --config integration/.mocharc.json ./integration/nevermined/*.test.ts", "integration:aave": "mocha --config aave_integration/.mocharc.json ./aave_integration/**/*.test.ts", "integration:e2e": "mocha --config integration/.mocharc.json ./integration/nevermined/NFT1155Api.e2e.test.ts", "integration:e2e:mumbai": "export NETWORK_NAME=mumbai; yarn integration:e2e", @@ -32,10 +26,6 @@ "lint:fix": "eslint ./ --fix", "format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'", "docs": "typedoc", - "merge-coverages": "npx lcov-result-merger \"coverage/*/lcov.info\" coverage/lcov.info", - "report-coverage": "npm run report-coverage:unit && npm run report-coverage:integration", - "report-coverage:unit": "cat coverage/unit/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", - "report-coverage:integration": "cat coverage/integration/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", "run": "ts-node", "release": "release-it --non-interactive", "changelog": "auto-changelog --commit-limit false && sed -i 's/keyko-io/nevermind-/nevermined-io//' CHANGELOG.md", @@ -119,11 +109,9 @@ "ganache": "^7.9.0", "http-proxy": "^1.18.1", "husky": "^8.0.3", - "lcov-result-merger": "^3.1.0", "lint-staged": "^13.0.4", "mocha": "^10.2.0", "mock-local-storage": "^1.1.24", - "nyc": "^14.1.1", "ora": "^6.3.1", "prettier": "^2.7.1", "prettier-package-json": "^2.7.0", @@ -150,24 +138,6 @@ "yarn run lint" ] }, - "nyc": { - "include": [ - "src/**/*.ts" - ], - "extension": [ - ".ts" - ], - "require": [ - "ts-node/register" - ], - "reporter": [ - "text-summary", - "lcov", - "html" - ], - "sourceMap": true, - "instrument": true - }, "release-it": { "hooks": { "after:bump": "npm run changelog && npm run doc:json" From 647274a22b35ca29a4185301b86be8cf0fdbc120 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 9 Aug 2023 13:34:29 +0200 Subject: [PATCH 072/151] fix: issue in package.json script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7bcb3772..378ae43cc 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build:dist": "cross-env NODE_ENV=production webpack", "build:watch": "tsc -w", "test": "mocha --config test/.mocharc.json ", - "test:all": "test ./test/**/*.test.ts", + "test:all": "mocha --config test/.mocharc.json ./test/**/*.test.ts", "integration": "mocha --config integration/.mocharc.json ", "integration:all": "mocha --config integration/.mocharc.json ./integration/nevermined/*.test.ts", "integration:subgraph": "mocha --config integration/.mocharc.json ./integration/**/*.test.subgraph.ts", From bffa101c71f77f81f9d62614c697555c34c2648f Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:24:41 +0200 Subject: [PATCH 073/151] chore: adding v2.0.0-rc6 Changelog updates --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7feecf2f..ce162f5f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc6](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc5...v2.0.0-rc6) + +> 9 August 2023 + +- feat: burning editions for NFT-1155 Credit subscriptions [`5263d36`](https://github.com/nevermined-io/sdk-js/commit/5263d36a89922dfa474c931776241d8b4f5d1ed0) +- chore: adding v2.0.0-rc5 Changelog updates [`36561aa`](https://github.com/nevermined-io/sdk-js/commit/36561aa767dd6877bfb0cfb73ef534fc41b27241) +- chore: bumping to rc6 [`139208f`](https://github.com/nevermined-io/sdk-js/commit/139208f655f03a4aa1f3d549cebd397a6dc30953) + #### [v2.0.0-rc5](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc4...v2.0.0-rc5) > 2 August 2023 From 87d7beb3eb3897bcf7b5babb510d118f05d36c73 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:33:57 +0200 Subject: [PATCH 074/151] fix: resolving integration problems --- integration/nevermined/Assets.test.ts | 11 +- integration/nevermined/Credits.e2e.test.ts | 49 +++ .../CreditsWithDuration.e2e.test.ts | 387 ++++++++++++++++++ integration/utils/utils.ts | 2 + package.json | 2 +- .../templates/AgreementTemplate.abstract.ts | 1 + .../templates/BaseTemplate.abstract.ts | 6 +- .../contracts/templates/NFTAccessTemplate.ts | 23 +- src/nevermined/utils/JwtUtils.ts | 3 +- src/services/node/NeverminedNode.ts | 2 +- 10 files changed, 474 insertions(+), 12 deletions(-) create mode 100644 integration/nevermined/CreditsWithDuration.e2e.test.ts diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index cd646ad75..5e8335f1d 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -188,7 +188,16 @@ describe('Assets', () => { it('new rating must be between 0 and 1', async () => { // Trying to add a vote with a rating out of range - await assert.isRejected(nevermined.assets.addRating(ddo.shortId(), 2, 1, publisher)) + + nevermined.assets + .addRating(ddo.shortId(), 2, 1, publisher) + .then((res) => { + assert.fail(`It should not be here because rating is wrong: ${res}`) + }) + .catch((err) => { + console.debug(`It should fail with error: ${err}`) + assert.isDefined(err) + }) }) }) diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index 9c5984ad4..d5641ab8f 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -25,6 +25,7 @@ import { SubscriptionCreditsNFTApi, NFT1155Api, } from '../../src/nevermined' +import { sleep } from '../utils/utils' chai.use(chaiAsPromised) @@ -347,5 +348,53 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { console.log(`Balance After Burn: ${balanceAfter}`) assert.isTrue(balanceAfter === subscriptionCredits - accessCostInCredits) }) + + it('The tokens are burned and the subscriber cant get access anymore', async () => { + let balance + try { + for (let i = 0; i < 5; i++) { + await nevermined.nfts1155.access(assetDDO.id, subscriber, '/tmp/', undefined, agreementId) + await sleep(1000) + balance = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Access: ${balance}`) + } + assert.fail('Should not get here') + } catch (error) { + console.log(`User cant get access anymore: ${error.message}`) + } + + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Burn: ${balanceAfter}`) + assert.isTrue(balanceAfter < accessCostInCredits) + }) + + it('The subscriber can top-up', async () => { + await subscriber.requestTokens(subscriptionPrice / scale) + + agreementId = await nevermined.nfts1155.order( + subscriptionDDO.id, + subscriptionCredits, + subscriber, + subsSalesService.index, + ) + assert.isDefined(agreementId) + + const receipt = await nevermined.nfts1155.claim( + agreementId, + editor.getId(), + subscriber.getId(), + subscriptionCredits, + subscriptionDDO.id, + subsSalesService.index, + ) + assert.isTrue(receipt) + + const balanceAfterTopUp = await subscriptionNFT.balance( + subscriptionDDO.id, + subscriber.getId(), + ) + console.log(`Balance After TopUp: ${balanceAfterTopUp}`) + assert.isTrue(balanceAfterTopUp > accessCostInCredits) + }) }) }) diff --git a/integration/nevermined/CreditsWithDuration.e2e.test.ts b/integration/nevermined/CreditsWithDuration.e2e.test.ts new file mode 100644 index 000000000..d7ad69047 --- /dev/null +++ b/integration/nevermined/CreditsWithDuration.e2e.test.ts @@ -0,0 +1,387 @@ +import chai, { assert } from 'chai' +import chaiAsPromised from 'chai-as-promised' + +import { decodeJwt, JWTPayload } from 'jose' +import { Account, DDO, MetaData, Nevermined, AssetPrice, NFTAttributes } from '../../src' +import { EscrowPaymentCondition, Token, TransferNFTCondition } from '../../src/keeper' +import { config } from '../config' +import { getMetadata } from '../utils' +import TestContractHandler from '../../test/keeper/TestContractHandler' +import { + getRoyaltyAttributes, + RoyaltyAttributes, + RoyaltyKind, + SubscriptionCreditsNFTApi, + NFT1155Api, +} from '../../src/nevermined' +import { mineBlocks } from '../utils/utils' + +chai.use(chaiAsPromised) + +describe('Credit and Duration Subscriptions with Multiple services using NFT ERC-1155 End-to-End', () => { + let editor: Account + let subscriber: Account + let reseller: Account + + let nevermined: Nevermined + let token: Token + let escrowPaymentCondition: EscrowPaymentCondition + let transferNftCondition: TransferNFTCondition + let subscriptionDDO: DDO + let assetDDO: DDO + + let agreementId: string + + const subscriptionDuration1 = 5 // in blocks + const subscriptionDuration2 = 20 // in blocks + // Configuration of First Sale: + // Editor -> Subscriber, the Reseller get a cut (25%) + const subscriptionPrice1 = 20n + const subscriptionPrice2 = 40n + + const amounts1 = [15n, 5n] + const amounts2 = [30n, 10n] + let receivers: string[] + let assetPrice1: AssetPrice + let assetPrice2: AssetPrice + let royaltyAttributes: RoyaltyAttributes + + let subscriptionMetadata: MetaData + let assetMetadata: MetaData + let subsSalesService + + const preMint = false + const royalties = 0 + const nftTransfer = false + + // This is the number of credits that the subscriber will get when purchase the subscription + // In the DDO this will be added in the `_numberNFTs` value of the `nft-sales` service of the subscription + const subscriptionCredits1 = 10n + const subscriptionCredits2 = 50n + // This is the number of credits that cost get access to the service attached to the subscription + // In the DDO this will be added in the `_numberNFTs` value of the `nft-access` service of the asset associated to the subscription + const accessCostInCredits1 = 2n + + let salesServices + let accessServices + let initialBalances: any + // let scale: bigint + + // let nft: ethers.Contract + let subscriptionNFT: NFT1155Api + let neverminedNodeAddress + + let payload: JWTPayload + + before(async () => { + TestContractHandler.setConfig(config) + + nevermined = await Nevermined.getInstance(config) + ;[, editor, subscriber, , reseller] = await nevermined.accounts.list() + + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(editor) + + await nevermined.services.marketplace.login(clientAssertion) + payload = decodeJwt(config.marketplaceAuthToken) + + assetMetadata = getMetadata() + subscriptionMetadata = getMetadata(undefined, 'Subscription Duration NFT1155') + subscriptionMetadata.main.type = 'subscription' + + assetMetadata.userId = payload.sub + neverminedNodeAddress = await nevermined.services.node.getProviderAddress() + + // conditions + ;({ escrowPaymentCondition, transferNftCondition } = nevermined.keeper.conditions) + + // components + ;({ token } = nevermined.keeper) + + // scale = 10n ** BigInt(await token.decimals()) + receivers = [editor.getId(), reseller.getId()] + + // subscriptionPrice1 = subscriptionPrice1 * scale + // amounts1 = amounts1.map((v) => v * scale) + assetPrice1 = new AssetPrice( + new Map([ + [receivers[0], amounts1[0]], + [receivers[1], amounts1[1]], + ]), + ).setTokenAddress(token.address) + + // subscriptionPrice2 = subscriptionPrice2 * scale + // amounts2 = amounts2.map((v) => v * scale) + + assetPrice2 = new AssetPrice( + new Map([ + [receivers[0], amounts2[0]], + [receivers[1], amounts2[1]], + ]), + ).setTokenAddress(token.address) + + royaltyAttributes = getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, royalties) + + initialBalances = { + editor: await token.balanceOf(editor.getId()), + subscriber: await token.balanceOf(subscriber.getId()), + reseller: await token.balanceOf(reseller.getId()), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), + } + }) + + describe('As an editor I want to register new content and provide multiple subscriptions to access my content', () => { + it('I want to register a subscriptions NFT with multiple plans attached', async () => { + console.log(`Running first test`) + // Deploy NFT + TestContractHandler.setConfig(config) + + const contractABI = await TestContractHandler.getABI( + 'NFT1155SubscriptionUpgradeable', + './test/resources/artifacts/', + ) + subscriptionNFT = await SubscriptionCreditsNFTApi.deployInstance( + config, + contractABI, + editor, + [ + editor.getId(), + nevermined.keeper.didRegistry.address, + 'Credits Subscription NFT', + 'CRED', + '', + ], + ) + + console.debug(`Deployed ERC-1155 Subscription NFT on address: ${subscriptionNFT.address}`) + + await nevermined.contracts.loadNft1155Api(subscriptionNFT) + + await subscriptionNFT.grantOperatorRole(transferNftCondition.address, editor) + console.debug(`Granting operator role to Nevermined Node Address: ${neverminedNodeAddress}`) + await subscriptionNFT.grantOperatorRole(neverminedNodeAddress, editor) + + assert.equal(nevermined.nfts1155.getContract.address, subscriptionNFT.address) + + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: subscriptionMetadata, + services: [ + { + serviceType: 'nft-sales', + price: assetPrice1, + nft: { duration: subscriptionDuration1, amount: subscriptionCredits1, nftTransfer }, + }, + { + serviceType: 'nft-sales', + price: assetPrice2, + nft: { duration: subscriptionDuration2, amount: subscriptionCredits2, nftTransfer }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + subscriptionDDO = await nevermined.nfts1155.create(nftAttributes, editor) + + assert.equal(await subscriptionNFT.balance(subscriptionDDO.id, editor.getId()), 0n) + assert.isDefined(subscriptionDDO) + console.log(`Subscription DID: ${subscriptionDDO.id}`) + + salesServices = subscriptionDDO.getServicesByType('nft-sales') + assert.equal(salesServices.length, 2) + assert.equal( + salesServices[0].attributes.main.price.toString(), + assetPrice1.getTotalPrice().toString(), + ) + assert.equal( + salesServices[1].attributes.main.price.toString(), + assetPrice2.getTotalPrice().toString(), + ) + }) + + it('should grant Nevermined the operator role', async () => { + assert.isTrue( + await nevermined.nfts1155.isOperator( + subscriptionDDO.id, + nevermined.keeper.conditions.transferNftCondition.address, + ), + ) + }) + + it('I want to register a new asset with multiple access services', async () => { + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: assetMetadata, + services: [ + { + serviceType: 'nft-access', + nft: { + tokenId: subscriptionDDO.shortId(), + duration: subscriptionDuration1, + amount: accessCostInCredits1, + nftTransfer, + }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + assetDDO = await nevermined.nfts1155.create(nftAttributes, editor) + assert.isDefined(assetDDO) + console.log(`Asset DID: ${assetDDO.id}`) + + accessServices = assetDDO.getServicesByType('nft-access') + assert.equal(accessServices.length, 1) + + const tokenId = DDO.getTokenIdFromService(accessServices[0]) + assert.equal(tokenId, subscriptionDDO.shortId()) + }) + }) + + describe('As a subscriber I want to purchase the cheaper subscription option', () => { + it('I check the details of the subscription NFT', async () => { + const details = await nevermined.nfts1155.details(subscriptionDDO.id) + assert.equal(details.owner, editor.getId()) + }) + + it('I am ordering the subscription NFT', async () => { + await subscriber.requestTokens(subscriptionPrice1) + + // const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) + // assert.equal(subscriberBalanceBefore.toString(), (initialBalances.subscriber + subscriptionPrice1).toString()) + + subsSalesService = accessServices[0] + console.debug(`Ordering with index ${subsSalesService.index}`) + agreementId = await nevermined.nfts1155.order( + subscriptionDDO.id, + subscriptionCredits1, + subscriber, + subsSalesService.index, + ) + + console.log(`Agreement Id: ${agreementId}`) + assert.isDefined(agreementId) + + // const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) + + // assert.equal(subscriberBalanceAfter, initialBalances.subscriber) + }) + + it('The credits seller can check the payment and transfer the NFT to the subscriber', async () => { + // Let's use the Node to mint the subscription and release the payments + + const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance Before: ${balanceBefore}`) + console.log(`Balance Before (JSON): ${JSON.stringify(balanceBefore.toString())}`) + assert.isTrue(balanceBefore === 0n) + + try { + const receipt = await nevermined.nfts1155.claim( + agreementId, + editor.getId(), + subscriber.getId(), + subscriptionCredits1, + subscriptionDDO.id, + subsSalesService.index, + ) + assert.isTrue(receipt) + } catch (e) { + console.error(e.message) + assert.fail(e.message) + } + + console.log(`Got the receipt`) + + const minted = await subscriptionNFT.getContract.getMintedEntries( + subscriber.getId(), + subscriptionDDO.shortId(), + ) + console.log(`Minted: ${minted.length}`) + }) + + it('the editor and reseller can receive their payment', async () => { + const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) + const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) + + assert.isTrue(receiver0Balance === initialBalances.editor + assetPrice1.getAmounts()[0]) + assert.isTrue(receiver1Balance === initialBalances.reseller + assetPrice1.getAmounts()[1]) + }) + + it('the subscriber can check the balance with the new NFTs received', async () => { + console.log( + `Checking the balance of DID [${ + subscriptionDDO.id + }] of the subscriber ${subscriber.getId()}`, + ) + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Purchase is completed: ${balanceAfter}`) + assert.isTrue(balanceAfter === subscriptionCredits1) + }) + + it('The collector access the files', async () => { + const result = await nevermined.nfts1155.access( + assetDDO.id, + subscriber, + '/tmp/', + undefined, + agreementId, + ) + assert.isTrue(result) + }) + + it('The balance of the subscriber should be lower because credits got used', async () => { + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Burn: ${balanceAfter}`) + assert.isTrue(balanceAfter === subscriptionCredits1 - accessCostInCredits1) + }) + + // TODO: Enable this test when the TransferNFTCondition allow minting NFT-1155 with duration + it.skip('After the credits expire the user can not get access', async () => { + await mineBlocks(nevermined, subscriber, subscriptionDuration1 + 1) + + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Expiring duration: ${balanceAfter}`) + assert.isTrue(balanceAfter === 0n) + }) + + describe('As a subscriber now Im interested in the more expensive service', () => { + it('I am ordering the subscription NFT', async () => { + await subscriber.requestTokens(subscriptionPrice2) + + const balanceBeforeTopup = await subscriptionNFT.balance( + subscriptionDDO.id, + subscriber.getId(), + ) + + subsSalesService = salesServices[1] + console.debug(`Ordering with index ${subsSalesService.index}`) + agreementId = await nevermined.nfts1155.order( + subscriptionDDO.id, + subscriptionCredits2, + subscriber, + subsSalesService.index, + ) + + assert.isDefined(agreementId) + console.log(`Agreement Id: ${agreementId}`) + + const receipt = await nevermined.nfts1155.claim( + agreementId, + editor.getId(), + subscriber.getId(), + subscriptionCredits2, + subscriptionDDO.id, + subsSalesService.index, + ) + assert.isTrue(receipt) + + const balanceAfterTopup = await subscriptionNFT.balance( + subscriptionDDO.id, + subscriber.getId(), + ) + assert.equal(balanceBeforeTopup + subscriptionCredits2, balanceAfterTopup) + }) + }) + }) +}) diff --git a/integration/utils/utils.ts b/integration/utils/utils.ts index 6c0b86776..29df6664f 100644 --- a/integration/utils/utils.ts +++ b/integration/utils/utils.ts @@ -42,6 +42,7 @@ export async function repeat(n: number, p: Promise): Promise { export async function mineBlocks(nevermined: Nevermined, account: Account, blocksToWait: number) { for (let index = 0; index < blocksToWait; index++) { + console.debug(`Mining block ${index}`) await nevermined.provenance.used( generateId(), generateId(), @@ -51,5 +52,6 @@ export async function mineBlocks(nevermined: Nevermined, account: Account, block 'mining', account, ) + await sleep(500) } } diff --git a/package.json b/package.json index e99e8e01b..4563be1c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc6", + "version": "2.0.0-rc7", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index a42d18140..4deb6ae3c 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -287,6 +287,7 @@ export abstract class AgreementTemplate extends ContractBase { }) observer(OrderProgressStep.ApprovingPayment) + console.debug(`Locking tokens ${amounts} from ${from.getId()}`) await this.lockTokens(tokenAddress, amounts, from, txParams) observer(OrderProgressStep.ApprovedPayment) diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 863572a55..d531a5857 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -92,7 +92,7 @@ export abstract class BaseTemplate public abstract paramsGen(params: ValidationParams): Promise public async extraGen(_params: ValidationParams): Promise { - return {} + return { service_index: _params.service_index } } public async accept(_params: ValidationParams): Promise { @@ -132,11 +132,15 @@ export abstract class BaseTemplate ): Promise { const ddo = await this.nevermined.assets.resolve(did) const agreement = await this.nevermined.keeper.agreementStoreManager.getAgreement(agreement_id) + + console.debug(`Using Service Index ${extra.service_index}`) + const agreementData = await this.instanceFromDDO( agreement.agreementIdSeed, ddo, agreement.creator, params, + extra.service_index, ) if (agreementData.agreementId !== agreement_id) { throw new Error( diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index 10e669d80..b742e7b24 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -73,16 +73,25 @@ export class NFTAccessTemplate extends BaseTemplate { - if ( - await this.nevermined.keeper.conditions.nftAccessCondition.checkPermissions( - params.consumer_address, - params.did, + const ddo = await this.nevermined.assets.resolve(params.did) + + const metadataService = ddo.findServiceByType('metadata') + const isNft1155Credit = + metadataService.attributes.main.nftType.toString() === + NeverminedNFT1155Type.nft1155Credit.toString() + + console.debug('isNft1155Credit', isNft1155Credit) + // If is not a NFT Credit and have permissions, access is granted + if (!isNft1155Credit) { + if ( + await this.nevermined.keeper.conditions.nftAccessCondition.checkPermissions( + params.consumer_address, + params.did, + ) ) - ) { - return true + return true } - const ddo = await this.nevermined.assets.resolve(params.did) const service = params.service_index && params.service_index > 0 ? ddo.findServiceByIndex(params.service_index) diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index 48ca9ea53..34104422c 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -339,7 +339,8 @@ export class JwtUtils extends Instantiable { babysig, ) const accessToken = await this.nevermined.services.node.fetchToken(grantToken, 1) - this.tokenCache.set(cacheKey, accessToken) + // TODO: enable the cache back when this issue is fixed in the Node: https://github.com/nevermined-io/node/issues/225 + // this.tokenCache.set(cacheKey, accessToken) return accessToken } else { diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index 5ac46c87a..42c109b86 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -390,7 +390,7 @@ export class NeverminedNode extends Instantiable { nftType: ercType, serviceIndex: serviceIndex && serviceIndex >= 0 ? serviceIndex : -1, }) - console.log(`REMOVE: Claim body: ${claimBody}`) + console.debug(`REMOVE: Claim body: ${claimBody}`) const response = await this.nevermined.utils.fetch.post(this.getClaimNftEndpoint(), claimBody) if (!response.ok) { From ee6bde27c682c3820c3e25d56884d30b327103dd Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:34:36 +0200 Subject: [PATCH 075/151] chore: adding v2.0.0-rc7 Changelog updates --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce162f5f7..b174fad04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc7](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc6...v2.0.0-rc7) + +> 10 August 2023 + +- fix: resolving integration problems [`87d7beb`](https://github.com/nevermined-io/sdk-js/commit/87d7beb3eb3897bcf7b5babb510d118f05d36c73) +- chore: adding v2.0.0-rc6 Changelog updates [`bffa101`](https://github.com/nevermined-io/sdk-js/commit/bffa101c71f77f81f9d62614c697555c34c2648f) + #### [v2.0.0-rc6](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc5...v2.0.0-rc6) > 9 August 2023 From 298ac526f3d28fbe8dfac6a8900aefce1701240c Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 11 Aug 2023 09:27:22 +0200 Subject: [PATCH 076/151] ci: updating to latest versions --- .github/workflows/testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7e62483f7..8224be36d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,7 +16,9 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' - node-version: 'develop' + # TODO: remove this when the Node is updated + node-version: 'v2.0.0-rc3' + contracts-version: 'latest' - name: Install dependencies run: | From f800cce5476be19c7c395772da73707099c6e3ad Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:40:05 +0200 Subject: [PATCH 077/151] fix: credits flow with duration --- integration/.mocharc.json | 5 +- integration/nevermined/Credits.e2e.test.ts | 3 +- .../CreditsWithDuration.e2e.test.ts | 37 +++++++------- integration/nevermined/NFTTemplates.test.ts | 2 + .../nevermined/NFTTemplatesWithEther.test.ts | 1 + integration/resources/ddo-nft.json | 5 ++ integration/utils/utils.ts | 2 +- package.json | 2 +- src/ddo/types.ts | 1 + src/keeper/contracts/ContractBase.ts | 4 +- src/keeper/contracts/NFTContractsBase.ts | 4 +- .../conditions/NFTs/TransferNFTCondition.ts | 43 +++++++++------- .../templates/AgreementTemplate.abstract.ts | 3 +- .../templates/BaseTemplate.abstract.ts | 5 -- .../contracts/templates/NFTAccessTemplate.ts | 1 - .../contracts/templates/NFTSalesTemplate.ts | 27 +++++++++- src/nevermined/api/ConditionsApi.ts | 51 ++++++++++++++++--- src/nevermined/api/nfts/NFT1155Api.ts | 11 +++- src/services/node/NeverminedNode.ts | 1 - 19 files changed, 147 insertions(+), 61 deletions(-) diff --git a/integration/.mocharc.json b/integration/.mocharc.json index e8702edc5..aa8af1052 100644 --- a/integration/.mocharc.json +++ b/integration/.mocharc.json @@ -1,7 +1,8 @@ { "require": ["ts-node/register", "source-map-support/register", "mock-local-storage"], + "diff": true, "full-trace": true, "exit": true, - "timeout": "300000", - "diff": true + "allow-uncaught": true, + "timeout": "300000" } diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index d5641ab8f..8d2774172 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -228,6 +228,7 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { assert.equal(subscriberBalanceBefore, initialBalances.subscriber + subscriptionPrice) subsSalesService = subscriptionDDO.findServiceByType('nft-sales') + console.debug(`Ordering service with index ${subsSalesService.index}`) agreementId = await nevermined.nfts1155.order( subscriptionDDO.id, subscriptionCredits, @@ -236,7 +237,7 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { ) assert.isDefined(agreementId) - + console.debug(`Agreement ID: ${agreementId}`) const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) assert.equal(subscriberBalanceAfter, initialBalances.subscriber) diff --git a/integration/nevermined/CreditsWithDuration.e2e.test.ts b/integration/nevermined/CreditsWithDuration.e2e.test.ts index d7ad69047..625397f7b 100644 --- a/integration/nevermined/CreditsWithDuration.e2e.test.ts +++ b/integration/nevermined/CreditsWithDuration.e2e.test.ts @@ -12,7 +12,6 @@ import { RoyaltyAttributes, RoyaltyKind, SubscriptionCreditsNFTApi, - NFT1155Api, } from '../../src/nevermined' import { mineBlocks } from '../utils/utils' @@ -32,7 +31,7 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC let agreementId: string - const subscriptionDuration1 = 5 // in blocks + const subscriptionDuration1 = 10 // in blocks const subscriptionDuration2 = 20 // in blocks // Configuration of First Sale: // Editor -> Subscriber, the Reseller get a cut (25%) @@ -68,7 +67,7 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC // let scale: bigint // let nft: ethers.Contract - let subscriptionNFT: NFT1155Api + let subscriptionNFT: SubscriptionCreditsNFTApi let neverminedNodeAddress let payload: JWTPayload @@ -208,7 +207,7 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC ) }) - it('I want to register a new asset with multiple access services', async () => { + it('I want to register a new asset where access is granted to subscription holders', async () => { const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ metadata: assetMetadata, services: [ @@ -248,9 +247,6 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC it('I am ordering the subscription NFT', async () => { await subscriber.requestTokens(subscriptionPrice1) - // const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) - // assert.equal(subscriberBalanceBefore.toString(), (initialBalances.subscriber + subscriptionPrice1).toString()) - subsSalesService = accessServices[0] console.debug(`Ordering with index ${subsSalesService.index}`) agreementId = await nevermined.nfts1155.order( @@ -260,12 +256,7 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC subsSalesService.index, ) - console.log(`Agreement Id: ${agreementId}`) assert.isDefined(agreementId) - - // const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) - - // assert.equal(subscriberBalanceAfter, initialBalances.subscriber) }) it('The credits seller can check the payment and transfer the NFT to the subscriber', async () => { @@ -298,9 +289,15 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC subscriptionDDO.shortId(), ) console.log(`Minted: ${minted.length}`) + minted.map((m) => + console.log( + `Minted ${m.amountMinted} tokens and expiration ${m.expirationBlock} minted on block ${m.mintBlock}`, + ), + ) + // getMintedEntries }) - it('the editor and reseller can receive their payment', async () => { + it('The editor and reseller can receive their payment', async () => { const receiver0Balance = await token.balanceOf(assetPrice1.getReceivers()[0]) const receiver1Balance = await token.balanceOf(assetPrice1.getReceivers()[1]) @@ -308,13 +305,20 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC assert.isTrue(receiver1Balance === initialBalances.reseller + assetPrice1.getAmounts()[1]) }) - it('the subscriber can check the balance with the new NFTs received', async () => { + it('The subscriber can check the balance with the new NFTs received', async () => { console.log( `Checking the balance of DID [${ subscriptionDDO.id }] of the subscriber ${subscriber.getId()}`, ) - const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + + const blockNumber = await nevermined.web3.getBlockNumber() + console.log(`Block Number: ${blockNumber}`) + const balanceAfter = await subscriptionNFT.getContract.balance( + subscriber.getId(), + subscriptionDDO.shortId(), + ) + console.log(`Balance After Purchase is completed: ${balanceAfter}`) assert.isTrue(balanceAfter === subscriptionCredits1) }) @@ -337,7 +341,7 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC }) // TODO: Enable this test when the TransferNFTCondition allow minting NFT-1155 with duration - it.skip('After the credits expire the user can not get access', async () => { + it('After the credits expire the user can not get access', async () => { await mineBlocks(nevermined, subscriber, subscriptionDuration1 + 1) const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) @@ -364,7 +368,6 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC ) assert.isDefined(agreementId) - console.log(`Agreement Id: ${agreementId}`) const receipt = await nevermined.nfts1155.claim( agreementId, diff --git a/integration/nevermined/NFTTemplates.test.ts b/integration/nevermined/NFTTemplates.test.ts index 53bce94ae..7a86a56c5 100644 --- a/integration/nevermined/NFTTemplates.test.ts +++ b/integration/nevermined/NFTTemplates.test.ts @@ -301,6 +301,7 @@ describe('NFTTemplates E2E', () => { nevermined.keeper.nftUpgradeable.address, conditionIdLockPayment[1], true, + TransferNFTCondition.NO_EXPIRY, artist, ) @@ -531,6 +532,7 @@ describe('NFTTemplates E2E', () => { nevermined.keeper.nftUpgradeable.address, conditionIdLockPayment2[1], true, + TransferNFTCondition.NO_EXPIRY, collector1, ) diff --git a/integration/nevermined/NFTTemplatesWithEther.test.ts b/integration/nevermined/NFTTemplatesWithEther.test.ts index fce837b74..77e63cfce 100644 --- a/integration/nevermined/NFTTemplatesWithEther.test.ts +++ b/integration/nevermined/NFTTemplatesWithEther.test.ts @@ -287,6 +287,7 @@ describe('NFTTemplates With Ether E2E', async () => { nevermined.keeper.nftUpgradeable.address, conditionIdLockPayment[1], true, + TransferNFTCondition.NO_EXPIRY, artist, ) diff --git a/integration/resources/ddo-nft.json b/integration/resources/ddo-nft.json index f0d7a94a2..811a15e04 100644 --- a/integration/resources/ddo-nft.json +++ b/integration/resources/ddo-nft.json @@ -333,6 +333,11 @@ "name": "_contractAddress", "type": "address", "value": "0xe6A3980DaF4060e4b7e98Fa0AEf156B5cd6cD99E" + }, + { + "name": "_tokenId", + "type": "bytes32", + "value": "" } ], "events": [ diff --git a/integration/utils/utils.ts b/integration/utils/utils.ts index 29df6664f..e8d38e200 100644 --- a/integration/utils/utils.ts +++ b/integration/utils/utils.ts @@ -52,6 +52,6 @@ export async function mineBlocks(nevermined: Nevermined, account: Account, block 'mining', account, ) - await sleep(500) + await sleep(100) } } diff --git a/package.json b/package.json index 63ea13e8c..8cf2632b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc7", + "version": "2.0.0-rc8", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/ddo/types.ts b/src/ddo/types.ts index 033a53406..32167b8bb 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -728,6 +728,7 @@ export interface ValidationParams { babysig?: Babysig nft_amount?: bigint nft_holder?: string + duration?: number expiration?: number } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 9b0a5fe9f..8c47ad8f4 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -104,10 +104,12 @@ export abstract class ContractBase extends Instantiable { contract: ethers.BaseContract, progress: (data: any) => void, ): Promise { + const methodSignature = this.getSignatureOfMethod(name, args) // Uncomment to debug contract calls // console.debug(`Making contract call ....: ${name} - ${from}`) // console.debug(`With args - ${JSON.stringify(args)}`) - const methodSignature = this.getSignatureOfMethod(name, args) + // console.debug(`And signature - ${methodSignature}`) + const { gasLimit, value } = txparams // make the call if (progress) { diff --git a/src/keeper/contracts/NFTContractsBase.ts b/src/keeper/contracts/NFTContractsBase.ts index 9c4feaeed..a8f7e5e99 100644 --- a/src/keeper/contracts/NFTContractsBase.ts +++ b/src/keeper/contracts/NFTContractsBase.ts @@ -5,7 +5,7 @@ import { ContractTransactionReceipt, EventLog } from 'ethers' import { KeeperError } from '../../errors' export interface MintedEntry { - tokenId: bigint + amountMinted: bigint expirationBlock: bigint mintBlock: bigint } @@ -128,7 +128,7 @@ export class NFTContractsBase extends ContractBase { const entries: MintedEntry[] = [] for (let i = 0; i < minted.length; i++) { entries.push({ - tokenId: BigInt(minted[i][0]), + amountMinted: BigInt(minted[i][0]), expirationBlock: BigInt(minted[i][1]), mintBlock: BigInt(minted[i][2]), }) diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts index 02e8461b1..cb96bdd1a 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts @@ -15,6 +15,7 @@ export interface TransferNFTConditionContext extends ConditionContext { providerId: string consumerId: string nftAmount: bigint + duration: number expiration: number } @@ -22,6 +23,8 @@ export interface TransferNFTConditionContext extends ConditionContext { * Condition allowing to transfer an NFT between the original owner and a receiver */ export class TransferNFTCondition extends ProviderCondition { + public static readonly NO_EXPIRY = 0 + public static async getInstance(config: InstantiableConfig): Promise { return Condition.getInstance(config, 'TransferNFTCondition', TransferNFTCondition) } @@ -46,7 +49,7 @@ export class TransferNFTCondition extends ProviderCondition> { return { list: [ @@ -57,6 +60,7 @@ export class TransferNFTCondition extends ProviderCondition { if (method === 'fulfillForDelegate') { @@ -68,6 +72,7 @@ export class TransferNFTCondition extends ProviderCondition p.name === '_nftTransfer') .value as string - return this.params( + const params = this.params( ddo.shortId(), nftHolder, consumerId, @@ -112,6 +118,8 @@ export class TransferNFTCondition extends ProviderCondition extends ContractBase { ) const assetPrice = DDO.getAssetPriceFromService(service) + const payment = DDO.findServiceConditionByName(service, 'lockPayment') if (!payment) throw new Error('Payment Condition not found!') const rewardAddress = this.nevermined.keeper.conditions.escrowPaymentCondition.address @@ -287,7 +288,7 @@ export abstract class AgreementTemplate extends ContractBase { }) observer(OrderProgressStep.ApprovingPayment) - console.debug(`Locking tokens ${amounts} from ${from.getId()}`) + await this.lockTokens(tokenAddress, amounts, from, txParams) observer(OrderProgressStep.ApprovedPayment) diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index d531a5857..9a1cda9e9 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -133,8 +133,6 @@ export abstract class BaseTemplate const ddo = await this.nevermined.assets.resolve(did) const agreement = await this.nevermined.keeper.agreementStoreManager.getAgreement(agreement_id) - console.debug(`Using Service Index ${extra.service_index}`) - const agreementData = await this.instanceFromDDO( agreement.agreementIdSeed, ddo, @@ -152,15 +150,12 @@ export abstract class BaseTemplate const condInstance = agreementData.instances.find( (c) => c.condition === a.contractName, ) as ConditionInstance - // console.debug(`Fulfilling with Node ${JSON.stringify(condInstance, jsonReplacer)}`) await a.fulfillWithNode(condInstance, extra, from, txparams) const lock_state = await this.nevermined.keeper.conditionStoreManager.getCondition( condInstance.id, ) - // console.debug(`LockState === ${JSON.stringify(lock_state, jsonReplacer)}`) - if (lock_state.state !== ConditionState.Fulfilled) { throw new Error( `In agreement ${agreement_id}, condition [${a.contractName}] ${condInstance.id} is not fulfilled`, diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index b742e7b24..cd409a004 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -80,7 +80,6 @@ export class NFTAccessTemplate extends BaseTemplate { + const duration = DDO.getDurationFromService(service) || 0 + const expiration = duration > 0 ? (await this.nevermined.web3.getBlockNumber()) + duration : 0 + const nftTransfer = DDO.getNFTTransferFromService(service) + return { + consumerId, + nftAmount, + duration, + expiration, + nftTransfer, + providerId: undefined, + } } public async paramsGen({ consumer_address, nft_amount, + duration = 0, expiration = 0, }: ValidationParams): Promise { - return this.params(consumer_address, nft_amount, expiration) + return this.params(consumer_address, nft_amount, duration, expiration) } public lockConditionIndex(): number { @@ -83,11 +104,13 @@ export class NFTSalesTemplate extends BaseTemplate 0 ? (await this.nevermined.keeper.web3.getBlockNumber()) + duration : 0 + console.log(`ConditionsApi :: transferNft with expiration block = ${expirationBlock}`) + + const params = template.params( + accessConsumer, + nftAmount, + duration, + expirationBlock, + undefined, + nftTranfer, + ) const instance = await template.instanceFromDDO( agreementIdSeed, @@ -467,7 +478,7 @@ export class ConditionsApi extends Instantiable { serviceReference: number | ServiceType = 'nft-sales', nftAmount: bigint, from?: Account, - params?: txParams, + txParams?: txParams, ) { const { transferNftCondition } = this.nevermined.keeper.conditions const template = this.nevermined.keeper.templates.nftSalesTemplate @@ -475,21 +486,47 @@ export class ConditionsApi extends Instantiable { const { accessConsumer } = await template.getAgreementData(agreementId) const { agreementIdSeed, creator } = await this.nevermined.keeper.agreementStoreManager.getAgreement(agreementId) - const serviceIndex = ddo.findServiceByReference(serviceReference).index + const service = ddo.findServiceByReference(serviceReference) + + const nftTranfer = DDO.getNFTTransferFromService(service) + const duration = DDO.getDurationFromService(service) || 0 + const expirationBlock = + duration > 0 ? (await this.nevermined.keeper.web3.getBlockNumber()) + duration : 0 + console.log( + `ConditionsApi :: transferNftForDelegate with expiration block = ${expirationBlock}`, + ) + + const params = template.params( + accessConsumer, + nftAmount, + duration, + expirationBlock, + undefined, + nftTranfer, + ) + const instance = await template.instanceFromDDO( agreementIdSeed, ddo, creator, - template.params(accessConsumer, nftAmount), - serviceIndex, + params, + service.index, ) const [did, nftHolder, nftReceiver, _nftAmount, lockPaymentCondition, , transferAsset] = instance.instances[1].list const contractReceipt: ContractTransactionReceipt = await transferNftCondition.fulfillPlain( agreementId, - [did, nftHolder, nftReceiver, _nftAmount, lockPaymentCondition, transferAsset], + [ + did, + nftHolder, + nftReceiver, + _nftAmount, + lockPaymentCondition, + transferAsset, + expirationBlock, + ], from, - params, + txParams, 'fulfillForDelegate', ) diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index bc7105bea..733802d15 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -4,7 +4,7 @@ import { generateId, SubscribablePromise, zeroX } from '../../../utils' import { PublishMetadata } from '../AssetsApi' import { Account } from '../../Account' import { TxParameters, Nft1155Contract } from '../../../keeper' -import { DDO, ServiceType } from '../../../ddo' +import { DDO, ServiceNFTSales, ServiceType } from '../../../ddo' import { NFTError } from '../../../errors' import { NFTsBaseApi } from './NFTsBaseApi' import { ContractTransactionReceipt } from 'ethers' @@ -255,12 +255,19 @@ export class NFT1155Api extends NFTsBaseApi { const agreementIdSeed = zeroX(generateId()) const ddo = await this.nevermined.assets.resolve(did) + const service = ddo.findServiceByReference(serviceReference) as ServiceNFTSales + const params = await nftSalesTemplate.getParamsFromService( + consumer.getId(), + numberEditions, + service, + ) + this.logger.log('Creating nft-sales agreement and paying') const agreementId = await nftSalesTemplate.createAgreementWithPaymentFromDDO( agreementIdSeed, ddo, serviceReference, - nftSalesTemplate.params(consumer.getId(), numberEditions), + params, consumer, consumer, txParams, diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index 42c109b86..ffc1700a6 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -390,7 +390,6 @@ export class NeverminedNode extends Instantiable { nftType: ercType, serviceIndex: serviceIndex && serviceIndex >= 0 ? serviceIndex : -1, }) - console.debug(`REMOVE: Claim body: ${claimBody}`) const response = await this.nevermined.utils.fetch.post(this.getClaimNftEndpoint(), claimBody) if (!response.ok) { From 980a4bfff1fc0ea885d3079bd222e787febdc93c Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 21 Aug 2023 15:23:19 +0200 Subject: [PATCH 078/151] fix: fixing fulfillment of transferNft cond --- src/keeper/contracts/ContractBase.ts | 2 +- .../conditions/NFTs/TransferNFTCondition.ts | 1 - src/nevermined/api/ConditionsApi.ts | 20 +++++++++---------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 8c47ad8f4..5a87ea048 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -234,7 +234,7 @@ export abstract class ContractBase extends Instantiable { Sending transaction "${name}" on contract "${this.contractName}" at ${ this.address } failed.\n - Error: ${err.info.error.message}\n + Error: ${err}\n From: ${from}\n Parameters: ${JSON.stringify(mappedArgs, jsonReplacer, 2)}\n ${'-'.repeat(40)} diff --git a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts index cb96bdd1a..ce9d7734a 100644 --- a/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts +++ b/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts @@ -198,7 +198,6 @@ export class TransferNFTCondition extends ProviderCondition 0 ? (await this.nevermined.keeper.web3.getBlockNumber()) + duration : 0 @@ -514,21 +515,20 @@ export class ConditionsApi extends Instantiable { ) const [did, nftHolder, nftReceiver, _nftAmount, lockPaymentCondition, , transferAsset] = instance.instances[1].list - const contractReceipt: ContractTransactionReceipt = await transferNftCondition.fulfillPlain( - agreementId, - [ + const contractReceipt: ContractTransactionReceipt = + await transferNftCondition.fulfillForDelegate( + agreementId, did, nftHolder, nftReceiver, _nftAmount, lockPaymentCondition, + nftAddress, transferAsset, - expirationBlock, - ], - from, - txParams, - 'fulfillForDelegate', - ) + BigInt(expirationBlock), + from, + txParams, + ) return this.isFulfilled(contractReceipt) } From 3d5502ff13e69bfa8e8c1e29f201b95a0e225823 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 21 Aug 2023 15:23:43 +0200 Subject: [PATCH 079/151] chore: adding v2.0.0-rc8 Changelog updates --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b174fad04..7df02cc6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc8](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc7...v2.0.0-rc8) + +> 21 August 2023 + +- E2E integration with Credit Subscriptions [`#563`](https://github.com/nevermined-io/sdk-js/pull/563) +- Feat/update mocha [`#564`](https://github.com/nevermined-io/sdk-js/pull/564) +- fix: credits flow with duration [`f800cce`](https://github.com/nevermined-io/sdk-js/commit/f800cce5476be19c7c395772da73707099c6e3ad) +- feat: improve tests speed [`648eb19`](https://github.com/nevermined-io/sdk-js/commit/648eb19311cf6bb5427c5aca97c900aaa1e9767d) +- feat: remove the need to wait for the marketplace api in the tests [`ee829ac`](https://github.com/nevermined-io/sdk-js/commit/ee829ac8e1ce75268b0ada75682283aca75b5cb7) + #### [v2.0.0-rc7](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc6...v2.0.0-rc7) > 10 August 2023 From 267f0817edaf4dfdcb567681eab392af13540610 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:25:26 +0200 Subject: [PATCH 080/151] ci: using develop node --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8224be36d..e677ee783 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -17,7 +17,7 @@ jobs: opengsn: 'true' estuary: 'true' # TODO: remove this when the Node is updated - node-version: 'v2.0.0-rc3' + node-version: 'develop' contracts-version: 'latest' - name: Install dependencies From 9329a4b31f690ebfe68b007c2fc89215d3048303 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:50:59 +0200 Subject: [PATCH 081/151] ci: latest contracts --- .github/workflows/testing-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 4326821f2..6d5a045f9 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -23,7 +23,7 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' - contracts-version: 'v3.2.1' + contracts-version: 'latest' node: 'false' - name: Install dependencies From da999c7fd5d019ef61d9374b860edf11f215ed02 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:57:12 +0200 Subject: [PATCH 082/151] test: validating downloads by owner without access service --- .../nevermined/PublisherDownloadAsset.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/integration/nevermined/PublisherDownloadAsset.test.ts b/integration/nevermined/PublisherDownloadAsset.test.ts index 92abb3ef0..4c42dd1a8 100644 --- a/integration/nevermined/PublisherDownloadAsset.test.ts +++ b/integration/nevermined/PublisherDownloadAsset.test.ts @@ -30,12 +30,20 @@ describe('Publisher Download Asset', () => { }) it('should register an asset', async () => { - ddo = await nevermined.assets.create(AssetAttributes.getInstance({ metadata }), publisher) + ddo = await nevermined.assets.create( + AssetAttributes.getInstance({ metadata, services: [] }), + publisher, + ) assert.isDefined(ddo, 'Register has not returned a DDO') assert.match(ddo.id, /^did:nv:[a-f0-9]{64}$/, 'DDO id is not valid') assert.isAtLeast(ddo.authentication.length, 1, 'Default authentication not added') - assert.isDefined(ddo.findServiceByType('access'), "DDO access service doesn't exist") + let accessService + try { + accessService = ddo.findServiceByType('access') + // eslint-disable-next-line no-empty + } catch {} + assert.isUndefined(accessService, "DDO access service doesn't exist") }) it('should consume and store the assets', async () => { From 4f1d70c0209a1bc411a5e6d47ff42f284b12e7d5 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:44:02 +0200 Subject: [PATCH 083/151] feat: wip - lazy asset registration --- .../nevermined/AssetLazyRegistration.ts | 154 ++++++++++++++++++ integration/nevermined/Assets.test.ts | 8 +- integration/nevermined/NFT1155Api.e2e.test.ts | 8 +- package.json | 4 +- src/ddo/types.ts | 2 + src/nevermined/api/AssetsApi.ts | 42 ++++- src/nevermined/api/ComputeApi.ts | 13 +- src/nevermined/api/RegistryBaseApi.ts | 53 +++--- src/nevermined/api/nfts/NFT1155Api.ts | 15 +- src/nevermined/api/nfts/NFT721Api.ts | 17 +- src/services/node/NeverminedNode.ts | 8 +- 11 files changed, 267 insertions(+), 57 deletions(-) create mode 100644 integration/nevermined/AssetLazyRegistration.ts diff --git a/integration/nevermined/AssetLazyRegistration.ts b/integration/nevermined/AssetLazyRegistration.ts new file mode 100644 index 000000000..ce88908d1 --- /dev/null +++ b/integration/nevermined/AssetLazyRegistration.ts @@ -0,0 +1,154 @@ +import { assert } from 'chai' +import { Account, ContractHandler, Nevermined, didZeroX, generateId, zeroX } from '../../src' +import { config } from '../config' +import { Signer, Transaction, ethers } from 'ethers' +import { sleep } from '../utils/utils' + +describe('Lazy registration of assets', () => { + let publisher: Account + let relayer: Account + let publisherSigner: Signer + let relayerSigner: Signer + let nevermined: Nevermined + let didRegistryAbi + let registryContract: ethers.Contract + let functionArgs + + const functionName = 'registerDID' + + const providers = [] + const metadataUrl = 'http://localhost:5000' + const activityId = zeroX(generateId()) + const immutableUrl = '' + + before(async () => { + nevermined = await Nevermined.getInstance(config) + ;[publisher, relayer] = await nevermined.accounts.list() + + publisherSigner = await nevermined.accounts.findSigner(publisher.getId()) + relayerSigner = await nevermined.accounts.findSigner(relayer.getId()) + + const networkName = await nevermined.keeper.getNetworkName() + didRegistryAbi = await ContractHandler.getABI( + 'DIDRegistry', + config.artifactsFolder, + networkName, + ) + registryContract = new ethers.Contract( + didRegistryAbi.address, + didRegistryAbi.abi, + nevermined.web3, + ) + registryContract[functionName](didRegistryAbi.address) + }) + + describe('Ethers :: Lazy registration of assets', () => { + const didSeed = zeroX(generateId()) + const checksum = zeroX(generateId()) + let fragment + let unsignedTx + let signedTx + + it('should be able to generate a tx hash and the signature', async () => { + registryContract.connect(publisherSigner) + + functionArgs = [ + didSeed, + checksum, + providers.map(zeroX), + metadataUrl, + activityId, + immutableUrl, + ] + + fragment = await registryContract[functionName].getFragment(...functionArgs) + assert.isDefined(fragment) + + unsignedTx = await registryContract[functionName].populateTransaction(...functionArgs) + assert.isDefined(unsignedTx) + + console.log(`unsignedTx: `, unsignedTx) + + signedTx = await publisherSigner.signTransaction(unsignedTx) + + assert.isDefined(signedTx) + console.log(`signedTx: `, JSON.stringify(signedTx)) + }) + + it('should be able to rely the tx and register on-chain', async () => { + const tx = Transaction.from(signedTx) + + const gasLimit = await registryContract[functionName].estimateGas(...functionArgs, { + from: relayer.getId(), + }) + const feeData = await nevermined.utils.contractHandler.getFeeData() + + // const feeData = await nevermined.web3.getFeeData() + + tx.chainId = await nevermined.keeper.getNetworkId() + tx.type = 2 + tx.nonce = await relayerSigner.getNonce() + tx.gasLimit = gasLimit + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + if (Object.keys(feeData).includes('gasPrice')) + tx.gasPrice = Object.values(feeData)['gasPrice']! + else { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + tx.maxFeePerGas = Object.values(feeData)['maxFeePerGas']! + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + tx.maxPriorityFeePerGas = Object.values(feeData)['maxPriorityFeePerGas']! + } + + console.log(`Deserialized tx: `, JSON.stringify(tx)) + + const txResponse = await nevermined.web3.broadcastTransaction(tx.serialized) + + // const txResponse = await provider.sendTransaction(Transaction.from(signedTx)) + + assert.isDefined(txResponse) + + console.log(`TX Response: `, txResponse) + await sleep(3000) + + // const txResult = await nevermined.web3.getTransactionReceipt(txResponse.hash) + // console.log(`TX Result: `, JSON.stringify(txResult)) + }) + + it('the asset should be there created correctly', async () => { + const did = await nevermined.keeper.didRegistry.hashDID(zeroX(didSeed), publisher.getId()) + + console.log(`DID: `, did) + console.log(`DID Seed: `, didSeed) + + const assetRegistry = await nevermined.keeper.didRegistry.getAttributesByDid(did) + + assert.equal(assetRegistry.did, didZeroX(did)) + assert.equal(assetRegistry.owner, publisher.getId()) + }) + }) + + describe.skip('Contracts :: Lazy registration of assets', () => { + const didSeed = `did:nv:${generateId()}` + const checksum = generateId() + + it('should be able to generate a tx hash and the signature', async () => { + const _did = await nevermined.keeper.didRegistry.hashDID(didSeed, publisher.getId()) + + await nevermined.keeper.didRegistry.registerDID( + didSeed, + checksum, + providers, + publisher.getId(), + metadataUrl, + ) + }) + + // it('should be able to rely the tx and register on-chain', async () => { + + // }) + + // it('the asset should be there created correctly', async () => { + + // }) + }) +}) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index 7f794aafc..7edea3ea3 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -5,7 +5,7 @@ import { config } from '../config' import { getAssetPrice, getMetadata } from '../utils' import { Nevermined, Account, MetaData, DDO, AssetPrice, AssetAttributes } from '../../src' import { generateId } from '../../src/utils' -import { PublishMetadata, DIDResolvePolicy } from '../../src/nevermined' +import { PublishMetadataOptions, DIDResolvePolicy } from '../../src/nevermined' let nevermined: Nevermined let publisher: Account @@ -60,7 +60,9 @@ describe('Assets', () => { }, ], }) - ddo = await nevermined.assets.create(assetAttributes, publisher, PublishMetadata.IPFS) + ddo = await nevermined.assets.create(assetAttributes, publisher, { + metadata: PublishMetadataOptions.IPFS, + }) assert.isDefined(ddo) assert.equal(ddo._nvm.versions.length, 1) @@ -119,7 +121,7 @@ describe('Assets', () => { ddo.shortId(), updatedMetadata, publisher, - PublishMetadata.IPFS, + PublishMetadataOptions.IPFS, ) const resolvedDDO = await nevermined.assets.resolve(ddo.id, DIDResolvePolicy.ImmutableFirst) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 0f3824bd6..87fdf59a0 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -12,15 +12,15 @@ import { import { config } from '../config' import { getMetadata } from '../utils' import { + DIDResolvePolicy, getRoyaltyAttributes, - PublishMetadata, + PublishMetadataOptions, RoyaltyKind, } from '../../src/nevermined/api/AssetsApi' import { ethers } from 'ethers' import '../globals' import { AssetAttributes } from '../../src/models/AssetAttributes' import { NFTAttributes } from '../../src/models/NFTAttributes' -import { DIDResolvePolicy } from '../../src/nevermined/api/RegistryBaseApi' chai.use(chaiAsPromised) @@ -169,7 +169,9 @@ function makeTest(isCustom) { royaltyAttributes, preMint: true, }) - ddo = await nevermined.nfts1155.create(nftAttributes, artist, PublishMetadata.IPFS) + ddo = await nevermined.nfts1155.create(nftAttributes, artist, { + metadata: PublishMetadataOptions.IPFS, + }) assert.isDefined(ddo) diff --git a/package.json b/package.json index 8cf2632b5..c4023830d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc8", + "version": "2.0.0-rc9", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", @@ -56,7 +56,7 @@ "cross-fetch": "^4.0.0", "crypto-browserify": "^3.12.0", "deprecated-decorator": "^0.1.6", - "ethers": "^6.6.5", + "ethers": "^6.7.1", "graphql": "^16.7.1", "https-browserify": "^1.0.0", "jose": "^4.5.1", diff --git a/src/ddo/types.ts b/src/ddo/types.ts index 32167b8bb..dadea44de 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -502,6 +502,8 @@ export interface NvmConfig { networks?: { [key: string]: boolean } + + lazyRegistrationSignature?: string } export enum ImmutableBackends { diff --git a/src/nevermined/api/AssetsApi.ts b/src/nevermined/api/AssetsApi.ts index dc76d4c96..29c6c89c4 100644 --- a/src/nevermined/api/AssetsApi.ts +++ b/src/nevermined/api/AssetsApi.ts @@ -6,7 +6,7 @@ import { TxParameters, RoyaltyScheme } from '../../keeper' import { AssetError, DDOError } from '../../errors' import { Nevermined, apiPath } from '../../sdk' import { ContractTransactionReceipt } from 'ethers' -import { DIDResolvePolicy, RegistryBaseApi } from './RegistryBaseApi' +import { RegistryBaseApi } from './RegistryBaseApi' import { CreateProgressStep, OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' import { Providers } from '../Provider' import { Babysig, AssetAttributes } from '../../models' @@ -18,13 +18,40 @@ import { Babysig, AssetAttributes } from '../../models' * - Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin * - Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave */ -export enum PublishMetadata { +export enum PublishMetadataOptions { OnlyMetadataAPI, IPFS, Filecoin, Arweave, } +/** + * It specifies if the DID will be published on-chain initially or not. + */ +export enum PublishOnChainOptions { + DIDRegistry, // The DID and the reference to the DDO will be stored in the DIDRegistry contract + OnlyOffchain, // THE DID won't be stored on-chain and will be lazy-registered when needed +} + +export class AssetPublicationOptions { + metadata?: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI + did?: PublishOnChainOptions = PublishOnChainOptions.DIDRegistry +} + +/** + * It described the policy to be used when resolving an asset. It has the following options: + * * ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API + * * MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url + * * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL + * * OnlyMetadataAPI - Try to resolve the metadata only from the Marketplace/Metadata API + */ +export enum DIDResolvePolicy { + ImmutableFirst, + MetadataAPIFirst, + OnlyImmutable, + OnlyMetadataAPI, +} + /** * Attributes defining the royalties model attached to the asset */ @@ -115,7 +142,7 @@ export class AssetsApi extends RegistryBaseApi { * {@link https://docs.nevermined.io/docs/architecture/nevermined-data} * * @param assetAttributes - Attributes describing the asset - * @param publishMetadata - Allows to specify if the metadata should be stored in different backends + * @param publicationOptions - Allows to specify the publication options of the off-chain and the on-chain data. @see {@link PublishOnChainOptions} and {@link PublishMetadataOptions} * @param publisherAccount - The account publishing the asset * @param txParams - Optional transaction parameters * @returns The metadata of the asset created (DDO) @@ -125,13 +152,16 @@ export class AssetsApi extends RegistryBaseApi { public create( assetAttributes: AssetAttributes, publisherAccount: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publicationOptions: AssetPublicationOptions = { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.DIDRegistry, + }, txParams?: TxParameters, ): SubscribablePromise { return this.registerNeverminedAsset( assetAttributes, publisherAccount, - publishMetadata, + publicationOptions, undefined, txParams, ) @@ -161,7 +191,7 @@ export class AssetsApi extends RegistryBaseApi { did: string, metadata: MetaData, publisherAccount: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publishMetadata: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI, txParams?: TxParameters, ): SubscribablePromise { return this.updateAsset(did, metadata, publisherAccount, publishMetadata, txParams) diff --git a/src/nevermined/api/ComputeApi.ts b/src/nevermined/api/ComputeApi.ts index ee6ebf452..07ae7a225 100644 --- a/src/nevermined/api/ComputeApi.ts +++ b/src/nevermined/api/ComputeApi.ts @@ -5,7 +5,7 @@ import { InstantiableConfig } from '../../Instantiable.abstract' import { TxParameters } from '../../keeper' import { SubscribablePromise } from '../../utils' import { CreateProgressStep, OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' -import { PublishMetadata } from './AssetsApi' +import { AssetPublicationOptions, PublishMetadataOptions, PublishOnChainOptions } from './AssetsApi' import { RegistryBaseApi } from './RegistryBaseApi' /** @@ -33,7 +33,7 @@ export class ComputeApi extends RegistryBaseApi { * {@link https://docs.nevermined.io/docs/architecture/nevermined-data} * * @param assetAttributes - Attributes describing the asset - * @param publishMetadata - Allows to specify if the metadata should be stored in different backends + * @param publicationOptions - Allows to specify the publication options of the off-chain and the on-chain data. @see {@link PublishOnChainOptions} and {@link PublishMetadataOptions} * @param publisherAccount - The account publishing the asset * @param txParams - Optional transaction parameters * @returns The metadata of the asset created (DDO) @@ -43,7 +43,10 @@ export class ComputeApi extends RegistryBaseApi { public create( assetAttributes: AssetAttributes, publisherAccount: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publicationOptions: AssetPublicationOptions = { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.DIDRegistry, + }, txParams?: TxParameters, ): SubscribablePromise { const computeService = assetAttributes.services.find((service) => { @@ -55,7 +58,7 @@ export class ComputeApi extends RegistryBaseApi { return this.registerNeverminedAsset( assetAttributes, publisherAccount, - publishMetadata, + publicationOptions, undefined, txParams, ) @@ -85,7 +88,7 @@ export class ComputeApi extends RegistryBaseApi { did: string, metadata: MetaData, publisherAccount: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publishMetadata: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI, txParams?: TxParameters, ): SubscribablePromise { return this.updateAsset(did, metadata, publisherAccount, publishMetadata, txParams) diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index d3fbb346a..546b15cfa 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -11,26 +11,17 @@ import { AssetAttributes, AssetPrice, NFTAttributes } from '../../models' import { Account, CreateProgressStep, DID } from '../../nevermined' import { TxParameters, ServiceAaveCredit, DEFAULT_REGISTRATION_ACTIVITY_ID } from '../../keeper' import { SubscribablePromise, zeroX, generateId, ZeroAddress, formatUnits } from '../../utils' -import { PublishMetadata } from './AssetsApi' +import { + AssetPublicationOptions, + DIDResolvePolicy, + PublishMetadataOptions, + PublishOnChainOptions, +} from './AssetsApi' import { OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' import { AssetError } from '../../errors/AssetError' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { AccessService, NFTSalesService, NFTAccessService } from '../AccessService' -/** - * It described the policy to be used when resolving an asset. It has the following options: - * * ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API - * * MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url - * * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL - * * OnlyMetadataAPI - Try to resolve the metadata only from the Marketplace/Metadata API - */ -export enum DIDResolvePolicy { - ImmutableFirst, - MetadataAPIFirst, - OnlyImmutable, - OnlyMetadataAPI, -} - /** * Abstract class proving common functionality related with Assets registration. */ @@ -43,7 +34,7 @@ export abstract class RegistryBaseApi extends Instantiable { * * @param assetAttributes - Attributes describing the asset * @param publisher - The account publishing the asset - * @param publishMetadata - Allows to specify if the metadata should be stored in different backends + * @param publicationOptions - Allows to specify the publication options of the off-chain and the on-chain data. @see {@link PublishOnChainOptions} and {@link PublishMetadataOptions} * @param nftAttributes -Attributes describing the NFT (ERC-721) associated to the asset * @param txParams - Optional transaction parameters * @returns The metadata of the asset created (DDO) @@ -51,7 +42,7 @@ export abstract class RegistryBaseApi extends Instantiable { protected registerNeverminedAsset( assetAttributes: AssetAttributes, publisher: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publicationOptions: AssetPublicationOptions, nftAttributes?: NFTAttributes, txParams?: TxParameters, ): SubscribablePromise { @@ -203,12 +194,21 @@ export abstract class RegistryBaseApi extends Instantiable { const networkId = await this.nevermined.keeper.getNetworkId() ddo._nvm.networks = { [networkId]: true } - if (publishMetadata != PublishMetadata.OnlyMetadataAPI) { + if (publicationOptions.did === PublishOnChainOptions.OnlyOffchain) { + // This is a lazy-registration, so here we generate the DIDRegistry signature we are gonna use later for register on-chain + + ddo._nvm.lazyRegistrationSignature = '' + } + + if (publicationOptions.metadata != PublishMetadataOptions.OnlyMetadataAPI) { observer.next(CreateProgressStep.DdoStoredImmutable) try { // eslint-disable-next-line @typescript-eslint/no-extra-semi ;({ url: ddoVersion.immutableUrl, backend: ddoVersion.immutableBackend } = - await this.nevermined.services.node.publishImmutableContent(ddo, publishMetadata)) + await this.nevermined.services.node.publishImmutableContent( + ddo, + publicationOptions.metadata, + )) } catch (error) { this.logger.log(`Unable to publish immutable content`) } @@ -342,7 +342,7 @@ export abstract class RegistryBaseApi extends Instantiable { * @param did - Decentralized ID representing the unique id of an asset in a Nevermined network. * @param metadata - Metadata describing the asset * @param publisher - Account of the user updating the metadata - * @param publishMetadata - It allows to specify where to store the metadata + * @param publishMetadataOptions - It allows to specify where to store the metadata * @param txParams - Optional transaction parameters * @returns {@link DDO} The DDO updated */ @@ -350,7 +350,7 @@ export abstract class RegistryBaseApi extends Instantiable { did: string, metadata: MetaData, publisher: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publishMetadataOptions: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI, txParams?: TxParameters, ): SubscribablePromise { this.logger.log('Updating Asset') @@ -389,12 +389,15 @@ export abstract class RegistryBaseApi extends Instantiable { ddo._nvm.versions.push(ddoVersion) ddo.updated = ddoVersion.updated - if (publishMetadata != PublishMetadata.OnlyMetadataAPI) { + if (publishMetadataOptions != PublishMetadataOptions.OnlyMetadataAPI) { observer.next(UpdateProgressStep.StoringImmutableDDO) try { // eslint-disable-next-line @typescript-eslint/no-extra-semi ;({ url: ddoVersion.immutableUrl, backend: ddoVersion.immutableBackend } = - await this.nevermined.services.node.publishImmutableContent(ddo, publishMetadata)) + await this.nevermined.services.node.publishImmutableContent( + ddo, + publishMetadataOptions, + )) if (ddoVersion.immutableBackend) ddo._nvm.versions[lastIndex + 1] = ddoVersion } catch (error) { this.logger.log(`Unable to publish immutable content`) @@ -435,7 +438,7 @@ export abstract class RegistryBaseApi extends Instantiable { did: string, list: boolean, publisher: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publishMetadata: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI, txParams?: TxParameters, ): SubscribablePromise { this.logger.log('Switching Asset Publication') @@ -488,7 +491,7 @@ export abstract class RegistryBaseApi extends Instantiable { newRating: number, numVotesAdded = 1, publisher: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publishMetadata: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI, txParams?: TxParameters, ): SubscribablePromise { this.logger.log('Adding votes to the asset') diff --git a/src/nevermined/api/nfts/NFT1155Api.ts b/src/nevermined/api/nfts/NFT1155Api.ts index 733802d15..938c8a203 100644 --- a/src/nevermined/api/nfts/NFT1155Api.ts +++ b/src/nevermined/api/nfts/NFT1155Api.ts @@ -1,7 +1,11 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { AssetAttributes, NFTAttributes } from '../../../models' import { generateId, SubscribablePromise, zeroX } from '../../../utils' -import { PublishMetadata } from '../AssetsApi' +import { + AssetPublicationOptions, + PublishMetadataOptions, + PublishOnChainOptions, +} from '../AssetsApi' import { Account } from '../../Account' import { TxParameters, Nft1155Contract } from '../../../keeper' import { DDO, ServiceNFTSales, ServiceType } from '../../../ddo' @@ -91,7 +95,7 @@ export class NFT1155Api extends NFTsBaseApi { * * @param nftAttributes -Attributes describing the NFT (ERC-721) associated to the asset * @param publisher - The account publishing the asset - * @param publishMetadata - Allows to specify if the metadata should be stored in different backends + * @param publicationOptions - Allows to specify the publication options of the off-chain and the on-chain data. @see {@link PublishOnChainOptions} and {@link PublishMetadataOptions} * @param txParams - Optional transaction parameters * * @returns The newly registered {@link DDO}. @@ -99,13 +103,16 @@ export class NFT1155Api extends NFTsBaseApi { public create( nftAttributes: NFTAttributes, publisher: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publicationOptions: AssetPublicationOptions = { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.DIDRegistry, + }, txParams?: TxParameters, ): SubscribablePromise { return this.registerNeverminedAsset( nftAttributes as AssetAttributes, publisher, - publishMetadata, + publicationOptions, nftAttributes, txParams, ) diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index a4863c40c..dd4d3c111 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -4,7 +4,11 @@ import { NFTAttributes, AssetAttributes } from '../../../models' import { generateId, SubscribablePromise, zeroX } from '../../../utils' import { Account } from '../../Account' import { Nft721Contract, TxParameters } from '../../../keeper' -import { PublishMetadata } from '../AssetsApi' +import { + AssetPublicationOptions, + PublishMetadataOptions, + PublishOnChainOptions, +} from '../AssetsApi' import { NFTError } from '../../../errors/NFTError' import { ContractTransactionReceipt, ethers } from 'ethers' import { NFTsBaseApi } from './NFTsBaseApi' @@ -80,13 +84,13 @@ export class NFT721Api extends NFTsBaseApi { * ddo = await nevermined.nfts721.create( * nftAttributes, * artist, - * PublishMetadata.IPFS + * { metadata: PublishMetadata.IPFS } * ) * ``` * * @param nftAttributes -Attributes describing the NFT (ERC-721) associated to the asset * @param publisher - The account publishing the asset - * @param publishMetadata - Allows to specify if the metadata should be stored in different backends + * @param publicationOptions - Allows to specify the publication options of the off-chain and the on-chain data. @see {@link PublishOnChainOptions} and {@link PublishMetadataOptions} * @param txParams - Optional transaction parameters * * @returns The newly registered {@link DDO}. @@ -94,13 +98,16 @@ export class NFT721Api extends NFTsBaseApi { public create( nftAttributes: NFTAttributes, publisher: Account, - publishMetadata: PublishMetadata = PublishMetadata.OnlyMetadataAPI, + publicationOptions: AssetPublicationOptions = { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.DIDRegistry, + }, txParams?: TxParameters, ): SubscribablePromise { return this.registerNeverminedAsset( nftAttributes as AssetAttributes, publisher, - publishMetadata, + publicationOptions, nftAttributes, txParams, ) diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index ffc1700a6..aee4f8f82 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -5,7 +5,7 @@ import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { ReadStream } from 'fs' import { NeverminedNodeError, HttpError } from '../../errors' import { ERCType, Babysig } from '../../models' -import { PublishMetadata } from '../../nevermined' +import { PublishMetadataOptions } from '../../nevermined' const apiPath = '/api/v1/node/services' @@ -418,12 +418,12 @@ export class NeverminedNode extends Instantiable { public async publishImmutableContent( ddo: DDO, - publishMetadata: PublishMetadata = PublishMetadata.IPFS, + publishMetadata: PublishMetadataOptions = PublishMetadataOptions.IPFS, ): Promise<{ url: string; backend: ImmutableBackends }> { let url, backend = undefined - if (publishMetadata === PublishMetadata.Filecoin) { + if (publishMetadata === PublishMetadataOptions.Filecoin) { this.logger.log('Publishing metadata to Filecoin') ;({ url } = await this.nevermined.services.node.uploadContent( JSON.stringify(ddo), @@ -431,7 +431,7 @@ export class NeverminedNode extends Instantiable { NodeUploadBackends.Filecoin, )) backend = 'filecoin' - } else if (publishMetadata === PublishMetadata.IPFS) { + } else if (publishMetadata === PublishMetadataOptions.IPFS) { this.logger.log('Publishing metadata to IPFS') ;({ url: url } = await this.nevermined.services.node.uploadContent( JSON.stringify(ddo), From 4208330b5d9cd68569238671203c48804f792ca2 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:19:17 +0200 Subject: [PATCH 084/151] wip: lazy assets wip --- .../nevermined/AssetLazyRegistration.ts | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/integration/nevermined/AssetLazyRegistration.ts b/integration/nevermined/AssetLazyRegistration.ts index ce88908d1..48846faa0 100644 --- a/integration/nevermined/AssetLazyRegistration.ts +++ b/integration/nevermined/AssetLazyRegistration.ts @@ -64,9 +64,10 @@ describe('Lazy registration of assets', () => { fragment = await registryContract[functionName].getFragment(...functionArgs) assert.isDefined(fragment) - unsignedTx = await registryContract[functionName].populateTransaction(...functionArgs) + unsignedTx = await registryContract[functionName].populateTransaction(...functionArgs) assert.isDefined(unsignedTx) + // unsignedTx.from = relayer.getId() console.log(`unsignedTx: `, unsignedTx) signedTx = await publisherSigner.signTransaction(unsignedTx) @@ -80,27 +81,34 @@ describe('Lazy registration of assets', () => { const gasLimit = await registryContract[functionName].estimateGas(...functionArgs, { from: relayer.getId(), - }) - const feeData = await nevermined.utils.contractHandler.getFeeData() + }) - // const feeData = await nevermined.web3.getFeeData() + console.log(`Relayer ETH balance: `, await relayer.getEtherBalance()) + const feeData = await nevermined.utils.contractHandler.getFeeData() + console.log(`Fee Data: `, feeData) + // const feeData = await nevermined.web3.getFeeData() + tx.chainId = await nevermined.keeper.getNetworkId() tx.type = 2 tx.nonce = await relayerSigner.getNonce() tx.gasLimit = gasLimit - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - if (Object.keys(feeData).includes('gasPrice')) - tx.gasPrice = Object.values(feeData)['gasPrice']! - else { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - tx.maxFeePerGas = Object.values(feeData)['maxFeePerGas']! - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - tx.maxPriorityFeePerGas = Object.values(feeData)['maxPriorityFeePerGas']! + // tx.value = ethers.parseEther("0.01") + + if (Object.keys(feeData).includes('gasPrice')) { + tx.gasPrice = feeData['gasPrice']! // eslint-disable-line @typescript-eslint/no-non-null-assertion + } else { + + // tx.maxFeePerGas = ethers.parseUnits(Math.ceil(Number(feeData['maxFeePerGas']!)) + '', 'wei') + tx.maxFeePerGas = feeData['maxFeePerGas']! // eslint-disable-line @typescript-eslint/no-non-null-assertion + + // tx.maxPriorityFeePerGas = ethers.parseUnits(Math.ceil(Number(feeData['maxPriorityFeePerGas']!)) + '', 'wei') + tx.maxPriorityFeePerGas = feeData['maxPriorityFeePerGas']! // eslint-disable-line @typescript-eslint/no-non-null-assertion } console.log(`Deserialized tx: `, JSON.stringify(tx)) + // const txResponse = await publisherSigner.sendTransaction(tx) const txResponse = await nevermined.web3.broadcastTransaction(tx.serialized) // const txResponse = await provider.sendTransaction(Transaction.from(signedTx)) From bfb1fd7cc1a62e6cf5e62f930c5fd814275bbd24 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 30 Aug 2023 13:14:08 +0200 Subject: [PATCH 085/151] feat: allow off-chain asset create and resolve --- MIGRATION_GUIDE.md | 21 ++++ ...ation.ts => AssetLazyRegistration.test.ts} | 21 ++-- integration/nevermined/Assets.test.ts | 51 +++++++- src/ddo/DDO.ts | 3 +- src/nevermined/api/AssetsApi.ts | 6 +- src/nevermined/api/RegistryBaseApi.ts | 111 ++++++++++-------- 6 files changed, 147 insertions(+), 66 deletions(-) rename integration/nevermined/{AssetLazyRegistration.ts => AssetLazyRegistration.test.ts} (92%) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 4e692acb1..3f2dc472e 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -2,6 +2,17 @@ ## Breaking changes +### Defining the asset registration options + +The `assets.create` function now receives an `AssetPublicationOptions` object instead of a `PublishMetadataOptions` parameter. This object allows to define the asset off-chain and on-chain registration options: + +```typescript +await nevermined.assets.create(assetAttributes, publisher, { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.OnlyOffchain, +}) +``` + ### Defining Asset Price The assetPrice is not part of AssetAttributes anymore and is part of each individual service added to the DDO when registering a service. So for services having a price, this must be added as part of the services array of the AssetAttributes. @@ -73,3 +84,13 @@ Most of them were migrated to the `DDO` class: - `getNftHolderFromService` -> `DDO.getNftHolderFromService` - `getNftAmountFromService` -> `DDO.getNftAmountFromService` - `getNftContractAddressFromService` -> `DDO.getNftContractAddressFromService` + +## Not breaking changes + +### Assets resolution will be off-chain by default + +The `assets.resolve` function will now resolve the asset off-chain by default. This means that the DDO will be fetched from the metadata api and not retrieve the metadata url from the on-chain DIDRegistry. This behavior can be modified passing different `DIDResolvePolicy` options. + +### Assets can be registered only off-chain + +For assets not requiring the be registered on-chain, the `assets.create` function will now only register the asset off-chain. This behavior can be modified passing different `AssetPublicationOptions` options. diff --git a/integration/nevermined/AssetLazyRegistration.ts b/integration/nevermined/AssetLazyRegistration.test.ts similarity index 92% rename from integration/nevermined/AssetLazyRegistration.ts rename to integration/nevermined/AssetLazyRegistration.test.ts index 48846faa0..37d40e58c 100644 --- a/integration/nevermined/AssetLazyRegistration.ts +++ b/integration/nevermined/AssetLazyRegistration.test.ts @@ -4,7 +4,7 @@ import { config } from '../config' import { Signer, Transaction, ethers } from 'ethers' import { sleep } from '../utils/utils' -describe('Lazy registration of assets', () => { +describe.skip('Lazy registration of assets', () => { let publisher: Account let relayer: Account let publisherSigner: Signer @@ -64,7 +64,7 @@ describe('Lazy registration of assets', () => { fragment = await registryContract[functionName].getFragment(...functionArgs) assert.isDefined(fragment) - unsignedTx = await registryContract[functionName].populateTransaction(...functionArgs) + unsignedTx = await registryContract[functionName].populateTransaction(...functionArgs) assert.isDefined(unsignedTx) // unsignedTx.from = relayer.getId() @@ -81,35 +81,36 @@ describe('Lazy registration of assets', () => { const gasLimit = await registryContract[functionName].estimateGas(...functionArgs, { from: relayer.getId(), - }) + }) console.log(`Relayer ETH balance: `, await relayer.getEtherBalance()) const feeData = await nevermined.utils.contractHandler.getFeeData() console.log(`Fee Data: `, feeData) // const feeData = await nevermined.web3.getFeeData() - + tx.chainId = await nevermined.keeper.getNetworkId() tx.type = 2 tx.nonce = await relayerSigner.getNonce() tx.gasLimit = gasLimit // tx.value = ethers.parseEther("0.01") - + if (Object.keys(feeData).includes('gasPrice')) { tx.gasPrice = feeData['gasPrice']! // eslint-disable-line @typescript-eslint/no-non-null-assertion } else { - // tx.maxFeePerGas = ethers.parseUnits(Math.ceil(Number(feeData['maxFeePerGas']!)) + '', 'wei') tx.maxFeePerGas = feeData['maxFeePerGas']! // eslint-disable-line @typescript-eslint/no-non-null-assertion - - // tx.maxPriorityFeePerGas = ethers.parseUnits(Math.ceil(Number(feeData['maxPriorityFeePerGas']!)) + '', 'wei') + + // tx.maxPriorityFeePerGas = ethers.parseUnits(Math.ceil(Number(feeData['maxPriorityFeePerGas']!)) + '', 'wei') tx.maxPriorityFeePerGas = feeData['maxPriorityFeePerGas']! // eslint-disable-line @typescript-eslint/no-non-null-assertion } console.log(`Deserialized tx: `, JSON.stringify(tx)) - // const txResponse = await publisherSigner.sendTransaction(tx) - const txResponse = await nevermined.web3.broadcastTransaction(tx.serialized) + const txResponse = await relayerSigner.sendTransaction(tx) + // const provider = new ethers.JsonRpcProvider(config.web3ProviderUri, undefined, {cacheTimeout: -1}) + + // const txResponse = await nevermined.web3.broadcastTransaction(tx.serialized) // const txResponse = await provider.sendTransaction(Transaction.from(signedTx)) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index 7edea3ea3..fb3fae765 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -5,7 +5,12 @@ import { config } from '../config' import { getAssetPrice, getMetadata } from '../utils' import { Nevermined, Account, MetaData, DDO, AssetPrice, AssetAttributes } from '../../src' import { generateId } from '../../src/utils' -import { PublishMetadataOptions, DIDResolvePolicy } from '../../src/nevermined' +import { + PublishMetadataOptions, + DIDResolvePolicy, + PublishOnChainOptions, +} from '../../src/nevermined' +import { rejects } from 'assert' let nevermined: Nevermined let publisher: Account @@ -425,4 +430,48 @@ describe('Assets', () => { assert.equal(assets.totalResults.value, 0) }) }) + + describe('#register() and #resolve() totally off-chain', () => { + let offchainDID + + it('register an asset but just off-chain', async () => { + const nonce = Math.random() + createdMetadata = getMetadata(nonce, `Off-Chain Test ${nonce}`) + + createdMetadata.main.ercType = 721 + createdMetadata.additionalInformation.tags = ['offchain'] + + const assetAttributes = AssetAttributes.getInstance({ + metadata: createdMetadata, + services: [ + { + serviceType: 'access', + price: assetPrice, + }, + ], + }) + const offchainDDO = await nevermined.assets.create(assetAttributes, publisher, { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.OnlyOffchain, + }) + + assert.isDefined(offchainDDO) + assert.equal(offchainDDO._nvm.versions.length, 1) + + const metadata = offchainDDO.findServiceByType('metadata') + assert.equal(metadata.attributes.main.ercType, 721) + assert.equal(metadata.attributes.additionalInformation.tags[0], 'offchain') + offchainDID = offchainDDO.id + }) + + it('resolve from the metadata api', async () => { + const resolvedDDO = await nevermined.assets.resolve(offchainDID, DIDResolvePolicy.NoRegistry) + assert.isDefined(resolvedDDO) + assert.equal(resolvedDDO._nvm.versions.length, 1) + }) + + it('dont resolve from the DIDRegistry', async () => { + rejects(nevermined.assets.resolve(offchainDID, DIDResolvePolicy.MetadataAPIFirst)) + }) + }) }) diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 81d0f3119..8d389109c 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -430,7 +430,8 @@ export class DDO { * @returns the DID */ public static getDIDFromService(service: Service): string { - return `did:nv:${DDO.getParameterFromCondition(service, 'escrowPayment', '_did') as string}` + const shortId = DDO.getParameterFromCondition(service, 'escrowPayment', '_did') as string + return shortId.startsWith('did:nv:') ? shortId : `did:nv:${shortId}` } /** diff --git a/src/nevermined/api/AssetsApi.ts b/src/nevermined/api/AssetsApi.ts index 29c6c89c4..c0dee4973 100644 --- a/src/nevermined/api/AssetsApi.ts +++ b/src/nevermined/api/AssetsApi.ts @@ -43,13 +43,15 @@ export class AssetPublicationOptions { * * ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API * * MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url * * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL - * * OnlyMetadataAPI - Try to resolve the metadata only from the Marketplace/Metadata API + * * OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry + * * NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain */ export enum DIDResolvePolicy { ImmutableFirst, MetadataAPIFirst, OnlyImmutable, OnlyMetadataAPI, + NoRegistry, } /** @@ -131,7 +133,7 @@ export class AssetsApi extends RegistryBaseApi { */ public async resolve( did: string, - policy: DIDResolvePolicy = DIDResolvePolicy.MetadataAPIFirst, + policy: DIDResolvePolicy = DIDResolvePolicy.NoRegistry, ): Promise { return this.resolveAsset(did, policy) } diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 546b15cfa..b3bb36f30 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -219,69 +219,71 @@ export abstract class RegistryBaseApi extends Instantiable { observer.next(CreateProgressStep.RegisteringDid) // On-chain asset registration - if (nftAttributes) { - this.logger.log('Registering Mintable Asset', ddo.id) - - const nftAttributesWithoutRoyalties = { ...nftAttributes, royaltyAttributes: undefined } - - if (nftAttributes.ercType === 721) { - await didRegistry.registerMintableDID721( - didSeed, - nftAttributes.nftContractAddress, - checksum, - assetAttributes.providers || [this.config.neverminedNodeAddress], - publisher.getId(), - nftAttributesWithoutRoyalties, - serviceEndpoint, - ddoVersion.immutableUrl, - DEFAULT_REGISTRATION_ACTIVITY_ID, - txParams, - ) + if (publicationOptions.did != PublishOnChainOptions.OnlyOffchain) { + if (nftAttributes) { + this.logger.log('Registering Mintable Asset', ddo.id) + + const nftAttributesWithoutRoyalties = { ...nftAttributes, royaltyAttributes: undefined } + + if (nftAttributes.ercType === 721) { + await didRegistry.registerMintableDID721( + didSeed, + nftAttributes.nftContractAddress, + checksum, + assetAttributes.providers || [this.config.neverminedNodeAddress], + publisher.getId(), + nftAttributesWithoutRoyalties, + serviceEndpoint, + ddoVersion.immutableUrl, + DEFAULT_REGISTRATION_ACTIVITY_ID, + txParams, + ) + } else { + await didRegistry.registerMintableDID( + didSeed, + nftAttributes.nftContractAddress, + checksum, + assetAttributes.providers || [this.config.neverminedNodeAddress], + publisher.getId(), + nftAttributesWithoutRoyalties, + serviceEndpoint, + ddoVersion.immutableUrl, + DEFAULT_REGISTRATION_ACTIVITY_ID, + txParams, + ) + } + + if (nftAttributes.royaltyAttributes != undefined) { + this.logger.log(`Setting up royalties`) + + observer.next(CreateProgressStep.SettingRoyaltyScheme) + await didRegistry.setDIDRoyalties( + ddo.shortId(), + nftAttributes.royaltyAttributes.scheme.address, + publisher.getId(), + txParams, + ) + observer.next(CreateProgressStep.SettingRoyalties) + await nftAttributes.royaltyAttributes.scheme.setRoyalty( + ddo.shortId(), + nftAttributes.royaltyAttributes.amount, + publisher, + txParams, + ) + } } else { - await didRegistry.registerMintableDID( + this.logger.log('Registering Asset', ddo.id) + await didRegistry.registerDID( didSeed, - nftAttributes.nftContractAddress, checksum, assetAttributes.providers || [this.config.neverminedNodeAddress], publisher.getId(), - nftAttributesWithoutRoyalties, serviceEndpoint, ddoVersion.immutableUrl, DEFAULT_REGISTRATION_ACTIVITY_ID, txParams, ) } - - if (nftAttributes.royaltyAttributes != undefined) { - this.logger.log(`Setting up royalties`) - - observer.next(CreateProgressStep.SettingRoyaltyScheme) - await didRegistry.setDIDRoyalties( - ddo.shortId(), - nftAttributes.royaltyAttributes.scheme.address, - publisher.getId(), - txParams, - ) - observer.next(CreateProgressStep.SettingRoyalties) - await nftAttributes.royaltyAttributes.scheme.setRoyalty( - ddo.shortId(), - nftAttributes.royaltyAttributes.amount, - publisher, - txParams, - ) - } - } else { - this.logger.log('Registering Asset', ddo.id) - await didRegistry.registerDID( - didSeed, - checksum, - assetAttributes.providers || [this.config.neverminedNodeAddress], - publisher.getId(), - serviceEndpoint, - ddoVersion.immutableUrl, - DEFAULT_REGISTRATION_ACTIVITY_ID, - txParams, - ) } this.logger.log('Storing DDO', ddo.id) @@ -312,6 +314,11 @@ export abstract class RegistryBaseApi extends Instantiable { did: string, policy: DIDResolvePolicy = DIDResolvePolicy.MetadataAPIFirst, ): Promise { + // We compose the metadata api url using the SDK config, we don't retrieve any DID information from the DIDRegistry + if (policy === DIDResolvePolicy.NoRegistry) { + return await this.nevermined.services.metadata.retrieveDDO(did, undefined) + } + const { serviceEndpoint, immutableUrl } = await this.nevermined.keeper.didRegistry.getAttributesByDid(did) From b5040a4142faa9d679d057639d7c87c533146292 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 30 Aug 2023 13:41:53 +0200 Subject: [PATCH 086/151] feat: assets.update registers an event on-chain --- integration/nevermined/Assets.test.ts | 25 ++++++++++++++++++++++++- src/ddo/types.ts | 2 -- src/nevermined/api/RegistryBaseApi.ts | 26 ++++++++++---------------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index fb3fae765..136a0d8d8 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -3,7 +3,15 @@ import { assert } from 'chai' import { decodeJwt, JWTPayload } from 'jose' import { config } from '../config' import { getAssetPrice, getMetadata } from '../utils' -import { Nevermined, Account, MetaData, DDO, AssetPrice, AssetAttributes } from '../../src' +import { + Nevermined, + Account, + MetaData, + DDO, + AssetPrice, + AssetAttributes, + ProvenanceMethod, +} from '../../src' import { generateId } from '../../src/utils' import { PublishMetadataOptions, @@ -144,6 +152,21 @@ describe('Assets', () => { updatedMetadata.main.name, metaApiDDO.findServiceByType('metadata').attributes.main.name, ) + assert.equal(metaApiDDO._nvm.versions.length, 2) + }) + + it('the checksum was updated on-chain', async () => { + const { checksum } = await nevermined.keeper.didRegistry.getAttributesByDid(ddo.id) + const resolvedDDO = await nevermined.assets.resolve(ddo.id, DIDResolvePolicy.OnlyMetadataAPI) + + const _version = resolvedDDO._nvm.versions.at(-1) + assert.equal(_version.checksum, checksum) + }) + + it('an update provenance event was created', async () => { + const events = await nevermined.provenance.getDIDProvenanceEvents(ddo.shortId()) + const lastEvent = events.at(-1) + assert.equal(lastEvent.method, ProvenanceMethod.USED) }) it('unlist and list an asset', async () => { diff --git a/src/ddo/types.ts b/src/ddo/types.ts index dadea44de..32167b8bb 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -502,8 +502,6 @@ export interface NvmConfig { networks?: { [key: string]: boolean } - - lazyRegistrationSignature?: string } export enum ImmutableBackends { diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index b3bb36f30..093dea144 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -194,12 +194,6 @@ export abstract class RegistryBaseApi extends Instantiable { const networkId = await this.nevermined.keeper.getNetworkId() ddo._nvm.networks = { [networkId]: true } - if (publicationOptions.did === PublishOnChainOptions.OnlyOffchain) { - // This is a lazy-registration, so here we generate the DIDRegistry signature we are gonna use later for register on-chain - - ddo._nvm.lazyRegistrationSignature = '' - } - if (publicationOptions.metadata != PublishMetadataOptions.OnlyMetadataAPI) { observer.next(CreateProgressStep.DdoStoredImmutable) try { @@ -409,18 +403,18 @@ export abstract class RegistryBaseApi extends Instantiable { } catch (error) { this.logger.log(`Unable to publish immutable content`) } - - observer.next(UpdateProgressStep.UpdatingAssetOnChain) - await this.nevermined.keeper.didRegistry.updateMetadataUrl( - ddo.id, - checksum, - publisher.getId(), - metadataService.serviceEndpoint, - ddoVersion.immutableUrl, - txParams, - ) } + observer.next(UpdateProgressStep.UpdatingAssetOnChain) + await this.nevermined.keeper.didRegistry.updateMetadataUrl( + ddo.id, + checksum, + publisher.getId(), + metadataService.serviceEndpoint, + ddoVersion.immutableUrl, + txParams, + ) + observer.next(UpdateProgressStep.StoringDDOMarketplaceAPI) const storedDdo = await this.nevermined.services.metadata.updateDDO(ddo.id, ddo) From ba8a80c78405a2926d7cf8e39adc267802ef8f7e Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:17:10 +0200 Subject: [PATCH 087/151] fix: allowing to update files and services private metadata --- integration/nevermined/Assets.test.ts | 51 +++++++++++++++++++++++++++ src/nevermined/api/RegistryBaseApi.ts | 21 +++++++++++ 2 files changed, 72 insertions(+) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index 136a0d8d8..73f598530 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -19,6 +19,7 @@ import { PublishOnChainOptions, } from '../../src/nevermined' import { rejects } from 'assert' +import * as fs from 'fs' let nevermined: Nevermined let publisher: Account @@ -169,6 +170,56 @@ describe('Assets', () => { assert.equal(lastEvent.method, ProvenanceMethod.USED) }) + it('update the asset files', async () => { + const nonce = Math.random() + const name = `Updated Files Test ${nonce}` + const updatedMetadata = { + ...createdMetadata, + name, + } + updatedMetadata.main.files = [ + { + index: 0, + contentType: 'text/plain', + url: 'https://raw.githubusercontent.com/nevermined-io/sdk-js/main/LICENSE', + }, + ] + + await nevermined.assets.update(ddo.shortId(), updatedMetadata, publisher) + + const resolvedDDO = await nevermined.assets.resolve(ddo.id) + assert.isDefined(resolvedDDO) + + const previousMetadata = ddo.findServiceByType('metadata') + const metadata = resolvedDDO.findServiceByType('metadata') + + assert.equal(updatedMetadata.main.name, metadata.attributes.main.name) + + assert.equal(metadata.attributes.main.files.length, 1) + assert.notEqual( + previousMetadata.attributes.main.files.length, + metadata.attributes.main.files.length, + ) + assert.notEqual( + previousMetadata.attributes.encryptedFiles, + metadata.attributes.encryptedFiles, + ) + }) + + it('should be able to download the updated files', async () => { + const folder = fs.mkdtempSync('/tmp/nevermined/sdk-js/updated-files_') + + const path = (await nevermined.assets.download(ddo.id, publisher, folder, -1)) as string + assert.include(path, folder, 'The storage path is not correct.') + const files = await new Promise((resolve) => { + fs.readdir(path, (e, fileList) => { + resolve(fileList) + }) + }) + + assert.deepEqual(files, ['LICENSE'], 'Stored files are not correct.') + }) + it('unlist and list an asset', async () => { // Unlisting Asset await nevermined.assets.list(ddo.shortId(), false, publisher) diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 093dea144..7e952a510 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -357,6 +357,7 @@ export abstract class RegistryBaseApi extends Instantiable { this.logger.log('Updating Asset') return new SubscribablePromise(async (observer) => { observer.next(UpdateProgressStep.ResolveAsset) + const ddo = await this.resolveAsset(did) observer.next(UpdateProgressStep.UpdateMetadataInDDO) @@ -372,6 +373,26 @@ export abstract class RegistryBaseApi extends Instantiable { }, } + if (!['workflow'].includes(metadataService.attributes.main.type)) { + const encryptedFilesResponse = await this.nevermined.services.node.encrypt( + ddo.id, + JSON.stringify(metadataService.attributes.main.files), + new String(AssetAttributes.DEFAULT_ENCRYPTION_METHOD), + ) + metadataService.attributes.encryptedFiles = JSON.parse(encryptedFilesResponse)['hash'] + + if (metadataService.attributes.main.type === 'service') { + const encryptedServiceAttributesResponse = await this.nevermined.services.node.encrypt( + ddo.id, + JSON.stringify(metadataService.attributes.main.webService.internalAttributes), + new String(AssetAttributes.DEFAULT_ENCRYPTION_METHOD), + ) + const encryptedAttributes = JSON.parse(encryptedServiceAttributesResponse)['hash'] + metadataService.attributes.main.webService.encryptedAttributes = encryptedAttributes + metadataService.attributes.main.webService.internalAttributes = undefined + } + } + await ddo.replaceService(metadataService.index, metadataService) observer.next(UpdateProgressStep.CalculateChecksum) From b6966ee6e51c03afb5a8259e27a8727827309003 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:55:57 +0200 Subject: [PATCH 088/151] test: fix problem with temp folder --- integration/nevermined/Assets.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index 73f598530..a5737d9cb 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -207,7 +207,7 @@ describe('Assets', () => { }) it('should be able to download the updated files', async () => { - const folder = fs.mkdtempSync('/tmp/nevermined/sdk-js/updated-files_') + const folder = fs.mkdirSync('/tmp/sdk-js/updated-files', { recursive: true }) const path = (await nevermined.assets.download(ddo.id, publisher, folder, -1)) as string assert.include(path, folder, 'The storage path is not correct.') From 4541e6ea277f31b2e2273bab0f7f77989b8ecfea Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:35:20 +0200 Subject: [PATCH 089/151] chore: adding v2.0.0-rc9 Changelog updates --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7df02cc6d..eaf7a6dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.0.0-rc9](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc8...v2.0.0-rc9) + +> 30 August 2023 + +- fix: allowing to update files and services private metadata [`#574`](https://github.com/nevermined-io/sdk-js/pull/574) +- Allow off-chain register and resolve methods [`#573`](https://github.com/nevermined-io/sdk-js/pull/573) +- chore(deps): bump whatwg-url from 7.1.0 to 13.0.0 [`#527`](https://github.com/nevermined-io/sdk-js/pull/527) +- test: validating downloads by owner without access service [`#570`](https://github.com/nevermined-io/sdk-js/pull/570) +- Adapting to contracts v3.3.x [`#566`](https://github.com/nevermined-io/sdk-js/pull/566) +- feat: wip - lazy asset registration [`4f1d70c`](https://github.com/nevermined-io/sdk-js/commit/4f1d70c0209a1bc411a5e6d47ff42f284b12e7d5) +- feat: allow off-chain asset create and resolve [`bfb1fd7`](https://github.com/nevermined-io/sdk-js/commit/bfb1fd7cc1a62e6cf5e62f930c5fd814275bbd24) +- feat: assets.update registers an event on-chain [`b5040a4`](https://github.com/nevermined-io/sdk-js/commit/b5040a4142faa9d679d057639d7c87c533146292) + #### [v2.0.0-rc8](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc7...v2.0.0-rc8) > 21 August 2023 From c132bcef71b91853215033db8a1cedc9eec78fc9 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 31 Aug 2023 16:43:49 +0200 Subject: [PATCH 090/151] chore: fixing eslint parsing issues --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 50bd9fdd6..0f25b381f 100644 --- a/package.json +++ b/package.json @@ -89,8 +89,8 @@ "@types/pluralize": "^0.0.29", "@types/tar": "^6.1.5", "@types/temp": "^0.9.1", - "@typescript-eslint/eslint-plugin": "^5.30.5", - "@typescript-eslint/parser": "^5.30.5", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", "auto-changelog": "^2.4.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", From 5ba27e740a563711af4d7380b61509a6a0dfac80 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:47:20 +0200 Subject: [PATCH 091/151] ci: updating nightly tests --- .github/workflows/testing-nightly.yml | 21 ++++++++++++--------- .github/workflows/testing.yml | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index b3ae79c99..b634ad159 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -62,8 +62,9 @@ jobs: opengsn: 'true' estuary: 'true' compute: 'true' - contracts-version: 'v3.2.1' - node-version: 'v1.2.16' + # TODO: Update to tagged versions when everything is relased and in main branches + contracts-version: 'latest' + node-version: 'develop' - name: Install dependencies run: | @@ -97,14 +98,15 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - - uses: nevermined-io/nvm-tools-actions@v0.11.0 + - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' compute: 'true' - contracts-version: 'v3.2.1' - node-version: 'v1.2.9' + # TODO: Update to tagged versions when everything is relased and in main branches + contracts-version: 'latest' + node-version: 'develop' - name: Install dependencies run: | @@ -130,14 +132,15 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - - uses: nevermined-io/nvm-tools-actions@v0.11.0 + - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' compute: 'true' - contracts-version: 'v3.2.1' - node-version: 'v1.2.9' + # TODO: Update to tagged versions when everything is relased and in main branches + contracts-version: 'latest' + node-version: 'develop' - name: Install dependencies run: | @@ -173,7 +176,7 @@ jobs: - name: Download artifacts run: | mkdir -p node_modules/@nevermined-io/contracts/artifacts - yarn artifacts:download v3.2.1 mumbai public + yarn artifacts:download v3.2.2 mumbai public ls -l node_modules/@nevermined-io/contracts/artifacts - name: Run nightly tests diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e677ee783..095a5f425 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,7 +16,7 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' - # TODO: remove this when the Node is updated + # TODO: Update to tagged versions when everything is relased and in main branches node-version: 'develop' contracts-version: 'latest' From cafa51431b516e6e730ab0b05955c012dbdb0e92 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:47:46 +0200 Subject: [PATCH 092/151] ci: updating nightly tests --- .github/workflows/testing-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index b634ad159..0ad806eb1 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -176,7 +176,7 @@ jobs: - name: Download artifacts run: | mkdir -p node_modules/@nevermined-io/contracts/artifacts - yarn artifacts:download v3.2.2 mumbai public + yarn artifacts:download v3.2.1 mumbai public ls -l node_modules/@nevermined-io/contracts/artifacts - name: Run nightly tests From c0617530dbc0221aa84cc9c3b356f21b5def6609 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 20 Sep 2023 12:02:19 +0200 Subject: [PATCH 093/151] feat: initial support for zerodev --- .github/workflows/release-github.yml | 2 +- .github/workflows/release-npm.yml | 2 +- .github/workflows/testing-nightly.yml | 10 +-- .github/workflows/testing-node.yml | 2 +- .github/workflows/testing.yml | 4 +- .nvmrc | 2 +- integration/external/Zerodev.test.ts | 90 +++++++++++++++++++++++++++ package.json | 1 + src/keeper/contracts/ContractBase.ts | 13 +++- src/models/NeverminedOptions.ts | 3 + 10 files changed, 115 insertions(+), 14 deletions(-) create mode 100644 integration/external/Zerodev.test.ts diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index 63d353d27..7c3c16151 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -19,7 +19,7 @@ jobs: # Build process - uses: actions/setup-node@v3 with: - node-version: '16.x' + node-version: 18 - name: Set version to env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index d8c659568..eb8bf61fe 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 18 registry-url: https://registry.npmjs.org/ - run: yarn install --frozen-lockfile --ignore-engines - run: npm publish --access public diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index 0ad806eb1..4d678317c 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Install dependencies run: | @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -97,7 +97,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -131,7 +131,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -167,7 +167,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Install dependencies run: | diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 6d5a045f9..36849872b 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: actions/checkout@v3 with: repository: nevermined-io/node diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 095a5f425..03d644dfe 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -55,7 +55,7 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Deploy contracts run: | diff --git a/.nvmrc b/.nvmrc index dae199aec..3c032078a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v12 +18 diff --git a/integration/external/Zerodev.test.ts b/integration/external/Zerodev.test.ts new file mode 100644 index 000000000..c3a9a9361 --- /dev/null +++ b/integration/external/Zerodev.test.ts @@ -0,0 +1,90 @@ +import { HDNodeWallet, Wallet } from 'ethers' +import { assert } from 'chai' +import { ZeroDevEthersProvider, convertEthersSignerToAccountSigner } from '@zerodev/sdk' +import { + Account, + AssetAttributes, + AssetPrice, + EthSignJWT, + Nevermined, + NeverminedOptions, +} from '../../src' +import { getMetadata } from '../utils' + +describe('Nevermined sdk with zerodev', () => { + let projectId: string + let owner: HDNodeWallet + let config: NeverminedOptions + let nevermined: Nevermined + let account: Account + let zerodevProvider: ZeroDevEthersProvider<'ECDSA'> + + before(async () => { + projectId = process.env.PROJECT_ID! + owner = Wallet.createRandom() + account = new Account(await owner.getAddress()) + const infuraToken = process.env.INFURA_TOKEN! + + config = { + marketplaceUri: 'https://marketplace-api.mumbai.nevermined.app', + neverminedNodeUri: 'https://node.mumbai.nevermined.app', + graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public', + neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc', + artifactsFolder: './artifacts', + web3ProviderUri: `https://polygon-mumbai.infura.io/v3/${infuraToken}`, + } + }) + + it('should instantiate nevermined sdk with a zerodev provider', async () => { + zerodevProvider = await ZeroDevEthersProvider.init('ECDSA', { + projectId, + owner: convertEthersSignerToAccountSigner(owner as any), + }) + + nevermined = await Nevermined.getInstance({ + ...config, + zerodevProvider: zerodevProvider, + }) + + assert.isDefined(nevermined) + }) + + it('should login to the marketplace api', async () => { + const accountSigner = zerodevProvider.getAccountSigner() + + const clientAssertion = await new EthSignJWT({ + iss: account.getId(), + }) + .setProtectedHeader({ alg: 'ES256K' }) + .setIssuedAt() + .setExpirationTime('1h') + .ethSign(accountSigner as any) + + await nevermined.services.marketplace.login(clientAssertion) + }) + + it('should request some nevermined tokens', async () => { + const accountSigner = zerodevProvider.getAccountSigner() + const accountAddress = await accountSigner.getAddress() + + console.log('requesting tokens for account', accountAddress) + const result = await nevermined.keeper.dispenser.requestTokens(10, accountAddress) + assert.isDefined(result) + }) + + it('should create a new asset with zerodev provider', async () => { + const assetAttributes = AssetAttributes.getInstance({ + metadata: getMetadata(), + services: [ + { + serviceType: 'access', + price: new AssetPrice(await owner.getAddress(), 0n), + }, + ], + providers: [config.neverminedNodeAddress], + }) + + const ddo = await nevermined.assets.create(assetAttributes, account) + assert.isDefined(ddo) + }) +}) diff --git a/package.json b/package.json index 0f25b381f..e66f28644 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "homepage": "https://github.com/nevermined-io/sdk-js#readme", "dependencies": { "@apollo/client": "^3.7.16", + "@zerodev/sdk": "^4.0.17", "assert": "^2.0.0", "cross-fetch": "^4.0.0", "crypto-browserify": "^3.12.0", diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 5a87ea048..6e59a857e 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -3,6 +3,7 @@ import { ContractEvent, EventHandler, SubgraphEvent } from '../../events' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { KeeperError } from '../../errors' import { + Contract, ContractTransactionReceipt, ContractTransactionResponse, FunctionFragment, @@ -143,13 +144,13 @@ export abstract class ContractBase extends Instantiable { }) } - const transactionReceipt: ContractTransactionReceipt = await transactionResponse.wait() + // const transactionReceipt: ContractTransactionReceipt = await transactionResponse.wait() if (progress) { progress({ stage: 'receipt', args: this.searchMethodInputs(name, args), - transactionReceipt, + // transactionReceipt, method: name, from, value, @@ -159,7 +160,7 @@ export abstract class ContractBase extends Instantiable { }) } - return transactionReceipt + return transactionResponse as any } public async send( @@ -168,6 +169,12 @@ export abstract class ContractBase extends Instantiable { args: any[], params: TxParameters = {}, ): Promise { + if (this.config.zerodevProvider) { + const signer = this.config.zerodevProvider.getAccountSigner() + const contract = new Contract(this.address, this.contract.interface, signer as any) + return await this.internalSend(name, from, args, params, contract, params.progress) + } + if (params.signer) { const paramsFixed = { ...params, signer: undefined } const contract = this.contract.connect(params.signer) diff --git a/src/models/NeverminedOptions.ts b/src/models/NeverminedOptions.ts index 82eb17872..3ce241324 100644 --- a/src/models/NeverminedOptions.ts +++ b/src/models/NeverminedOptions.ts @@ -1,6 +1,7 @@ import { ethers } from 'ethers' import { LogLevel } from '../utils' import { AaveConfig } from './' +import { ZeroDevEthersProvider } from '@zerodev/sdk' export class NeverminedOptions { /** @@ -83,4 +84,6 @@ export class NeverminedOptions { * Use a gas station to calculate transaction fees */ public gasStationUri?: string + + public zerodevProvider?: ZeroDevEthersProvider<'ECDSA'> } From 9e62fcd8de0b35806364675b0ebc07b2ae12f321 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 21 Sep 2023 12:06:04 +0200 Subject: [PATCH 094/151] feat: move support from node 16 to node 18 --- .github/workflows/release-github.yml | 2 +- .github/workflows/release-npm.yml | 2 +- .github/workflows/testing-nightly.yml | 10 +++++----- .github/workflows/testing-node.yml | 2 +- .github/workflows/testing.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index 63d353d27..7c3c16151 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -19,7 +19,7 @@ jobs: # Build process - uses: actions/setup-node@v3 with: - node-version: '16.x' + node-version: 18 - name: Set version to env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index d8c659568..eb8bf61fe 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 18 registry-url: https://registry.npmjs.org/ - run: yarn install --frozen-lockfile --ignore-engines - run: npm publish --access public diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index 0ad806eb1..4d678317c 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Install dependencies run: | @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -97,7 +97,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -131,7 +131,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -167,7 +167,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Install dependencies run: | diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 6d5a045f9..36849872b 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: actions/checkout@v3 with: repository: nevermined-io/node diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 095a5f425..03d644dfe 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: nevermined-io/nvm-tools-actions@v0.14.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} @@ -55,7 +55,7 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Deploy contracts run: | From 104ce3e2f634b6661b7af5c99850a4a27897d100 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 21 Sep 2023 12:08:36 +0200 Subject: [PATCH 095/151] chore: update node version in .nvmrc --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index dae199aec..3c032078a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v12 +18 From 0c537805c9d9cd712b8f794b454e371e8a9bc2d9 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 22 Sep 2023 16:27:26 +0200 Subject: [PATCH 096/151] chore: fixing merge problem --- src/keeper/ContractHandler.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index 27df13747..dcdc5e3d1 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -255,7 +255,6 @@ export class ContractHandler extends Instantiable { } } - public async getFeeData(gasPrice?: bigint, maxFeePerGas?: bigint, maxPriorityFeePerGas?: bigint) { // Custom gas fee for polygon networks const chainId = await this.nevermined.keeper.getNetworkId() @@ -264,7 +263,7 @@ export class ContractHandler extends Instantiable { } // arbitrum - if (networkId === 42161 || networkId === 421613) { + if (chainId === 42161 || chainId === 421613) { return this.getFeeDataArbitrum() } From 4cf5a1c73b03533e66e96ef0e14486e2f3093265 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 27 Sep 2023 15:11:36 +0200 Subject: [PATCH 097/151] chore: reclaim some space in the CI unit-tests job --- .github/workflows/testing.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7786a7cd0..3445f1124 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -48,6 +48,8 @@ jobs: runs-on: ubuntu-latest steps: + - name: Reclaim some disk space + run: docker system prune --all --volumes -f - uses: actions/checkout@v3 - uses: actions/checkout@v3 with: From 64cb9dfb4674c88aeebcf463c500f5691f7778d1 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 27 Sep 2023 15:12:23 +0200 Subject: [PATCH 098/151] chore: prettier --- integration/nevermined/Assets.test.ts | 1 - src/services/node/NeverminedNode.ts | 4 ++-- test/config.ts | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index 0e5623872..e119af427 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -322,7 +322,6 @@ describe('Assets', () => { console.debug(`It should fail with error: ${err}`) assert.isDefined(err) }) - }) }) diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index 7e80b8291..e158d2fb2 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -403,10 +403,10 @@ export class NeverminedNode extends Instantiable { nftType: ercType, serviceIndex: serviceIndex && serviceIndex >= 0 ? serviceIndex : -1, }) - + this.logger.log(`Claiming NFT using endpoint: ${claimNFTEndpoint}`) const response = await this.nevermined.utils.fetch.post(claimNFTEndpoint, claimBody) - + if (!response.ok) { throw new HttpError(`${response.statusText} ${response.url}`, response.status) } diff --git a/test/config.ts b/test/config.ts index 156834966..e1074ae9b 100644 --- a/test/config.ts +++ b/test/config.ts @@ -3,7 +3,6 @@ import { LoggerInstance } from '../src/utils' LoggerInstance.setLevel(LogLevel.Error) - const config = { marketplaceUri: 'http://localhost:3100', neverminedNodeUri: 'http://localhost:8030', From 8a71dbdf18624b668c4f5f6f882e3178fe756d0d Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 27 Sep 2023 15:42:29 +0200 Subject: [PATCH 099/151] fix: connection to ganache --- .github/workflows/testing.yml | 2 +- package.json | 2 +- test/config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3445f1124..ce6ba5959 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -81,7 +81,7 @@ jobs: - name: Start ganache env: SEED_WORDS: ${{ secrets.seedWords }} - run: yarn ganache --port 18545 --chain.chainId 8998 --wallet.mnemonic "$SEED_WORDS" --detach + run: yarn ganache --server.port 18545 --chain.chainId 8998 --wallet.mnemonic "$SEED_WORDS" --detach - name: Run unit tests env: diff --git a/package.json b/package.json index 0f25b381f..643f0b3bf 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-tsdoc": "^0.2.16", "express": "^4.18.2", - "ganache": "^7.9.0", + "ganache": "^7.9.1", "http-proxy": "^1.18.1", "husky": "^8.0.3", "lint-staged": "^13.0.4", diff --git a/test/config.ts b/test/config.ts index e1074ae9b..aee61e244 100644 --- a/test/config.ts +++ b/test/config.ts @@ -7,7 +7,7 @@ const config = { marketplaceUri: 'http://localhost:3100', neverminedNodeUri: 'http://localhost:8030', neverminedNodeAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0', - web3ProviderUri: `http://localhost:${process.env.ETH_PORT || 8545}`, + web3ProviderUri: `http://127.0.0.1:${process.env.ETH_PORT || 8545}`, verbose: LogLevel.Error, artifactsFolder: './artifacts', circuitsFolder: './circuits', From 6ec693b11c8eeaa6d1144eb35b71d7a29bd045fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 14:44:27 +0300 Subject: [PATCH 100/151] chore: testing --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ce6ba5959..7f7998cee 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -18,7 +18,7 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' - # TODO: Update to tagged versions when everything is relased and in main branches + # TODO: Update to tagged versions when everything is released and in main branches node-version: 'develop' contracts-version: 'latest' From baead7c447c0af7aa40460ef597e68a49323a29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 14:48:17 +0300 Subject: [PATCH 101/151] fix: updating --- test/keeper/TestContractHandler.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index ee3df775b..64907a04a 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -84,7 +84,14 @@ export default abstract class TestContractHandler extends ContractHandler { const erc1155 = await TestContractHandler.deployContract( 'NFT1155Upgradeable', deployerAddress, - [deployerAddress, await didRegistry.getAddress(), 'Nevermined NFT1155', 'NVM', ''], + [ + deployerAddress, + await didRegistry.getAddress(), + 'Nevermined NFT1155', + 'NVM', + '', + await nvmConfig.getAddress(), + ], ) const erc721 = await TestContractHandler.deployContract('NFT721Upgradeable', deployerAddress, [ @@ -94,6 +101,7 @@ export default abstract class TestContractHandler extends ContractHandler { 'NVM', '', 0, + await nvmConfig.getAddress(), ]) transactionResponse = await didRegistry.connect(signer).getFunction('setNFT1155')( From d74d223252d6c01ac84390c598bbd6cc63f38eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 15:08:43 +0300 Subject: [PATCH 102/151] fix: other initializations --- integration/nevermined/ClaimPaymentAbortedAgreement.test.ts | 1 + integration/nevermined/NFT1155.test.ts | 1 + integration/nevermined/NFT1155Api.e2e.test.ts | 2 ++ integration/nevermined/NFT721.test.ts | 1 + integration/nevermined/NFT721Api.e2e.test.ts | 1 + integration/nevermined/NFT721Templates.test.ts | 2 ++ integration/nevermined/NFTsWithMultipleServices.test.ts | 1 + integration/nevermined/Poap.test.ts | 1 + 8 files changed, 10 insertions(+) diff --git a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts index 5da5c8baa..bf00c1bf3 100644 --- a/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts +++ b/integration/nevermined/ClaimPaymentAbortedAgreement.test.ts @@ -64,6 +64,7 @@ describe('Claim aborted agreements End-to-End', () => { 'NVM', '', '0', + nevermined.keeper.nvmConfig.address, ]) nftContract = await Nft721Contract.getInstance( diff --git a/integration/nevermined/NFT1155.test.ts b/integration/nevermined/NFT1155.test.ts index ef7171f75..cb585a2dc 100644 --- a/integration/nevermined/NFT1155.test.ts +++ b/integration/nevermined/NFT1155.test.ts @@ -81,6 +81,7 @@ describe('NFT1155 End-to-End', () => { 'NFT1155', 'NVM', '', + nevermined.keeper.nvmConfig.address, ]) assert.isDefined(nftContract) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 87fdf59a0..1e08d6cac 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -96,6 +96,7 @@ function makeTest(isCustom) { 'NFT1155', 'NVM', '', + nevermined.keeper.nvmConfig.address, ]) const nftContract = await Nft1155Contract.getInstance( @@ -480,6 +481,7 @@ function makeTest(isCustom) { 'NFT1155', 'NVM', '', + nevermined.keeper.nvmConfig.address, ]) const nftContract = await Nft1155Contract.getInstance( diff --git a/integration/nevermined/NFT721.test.ts b/integration/nevermined/NFT721.test.ts index ca20e079d..e4a9d6bb4 100644 --- a/integration/nevermined/NFT721.test.ts +++ b/integration/nevermined/NFT721.test.ts @@ -44,6 +44,7 @@ describe('Nfts721 operations', async () => { 'NVM', '', '0', + nevermined.keeper.nvmConfig.address, ]) nftContract = await Nft721Contract.getInstance( (nevermined.keeper as any).instanceConfig, diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index 64543c7c4..0836efac2 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -61,6 +61,7 @@ describe('NFTs721 Api End-to-End', () => { 'NVM', '', '0', + nevermined.keeper.nvmConfig.address, ]) nftContract = await Nft721Contract.getInstance( diff --git a/integration/nevermined/NFT721Templates.test.ts b/integration/nevermined/NFT721Templates.test.ts index cc9132832..5ca9e2fe2 100644 --- a/integration/nevermined/NFT721Templates.test.ts +++ b/integration/nevermined/NFT721Templates.test.ts @@ -105,6 +105,7 @@ describe('NFT721Templates E2E', () => { 'NVM', '', '0', + nevermined.keeper.nvmConfig.address, ]) const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(artist) @@ -630,6 +631,7 @@ describe('NFT721Templates E2E', () => { 'NVM', '', '0', + nevermined.keeper.nvmConfig.address, ]) nft = await nevermined.contracts.loadNft721(await nftContract.getAddress()) diff --git a/integration/nevermined/NFTsWithMultipleServices.test.ts b/integration/nevermined/NFTsWithMultipleServices.test.ts index 76287366f..aac91f4eb 100644 --- a/integration/nevermined/NFTsWithMultipleServices.test.ts +++ b/integration/nevermined/NFTsWithMultipleServices.test.ts @@ -58,6 +58,7 @@ describe('E2E Flow for NFTs with multiple services', () => { 'NVM', '', '0', + nevermined.keeper.nvmConfig.address, ]) nftContract = await Nft721Contract.getInstance( diff --git a/integration/nevermined/Poap.test.ts b/integration/nevermined/Poap.test.ts index 7950985ab..06465481f 100644 --- a/integration/nevermined/Poap.test.ts +++ b/integration/nevermined/Poap.test.ts @@ -42,6 +42,7 @@ describe('POAPs with Assets', () => { 'NVM', '', '0', + nevermined.keeper.nvmConfig.address, ]) assert.isDefined(poapContract) From 207ec6f2c46668a36b1ad59371550e8896bfe725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 17:36:35 +0300 Subject: [PATCH 103/151] fix: modify abis --- test/resources/artifacts/NFT1155SubscriptionUpgradeable.json | 5 +++++ test/resources/artifacts/NFT721SubscriptionUpgradeable.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json index ac2f54b0b..08f3e11a0 100644 --- a/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json +++ b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json @@ -752,6 +752,11 @@ "internalType": "string", "name": "uri_", "type": "string" + }, + { + "internalType": "address", + "name": "nvmConfig", + "type": "address" } ], "name": "initialize", diff --git a/test/resources/artifacts/NFT721SubscriptionUpgradeable.json b/test/resources/artifacts/NFT721SubscriptionUpgradeable.json index f32e0be09..b5c435416 100644 --- a/test/resources/artifacts/NFT721SubscriptionUpgradeable.json +++ b/test/resources/artifacts/NFT721SubscriptionUpgradeable.json @@ -641,6 +641,11 @@ "internalType": "uint256", "name": "cap", "type": "uint256" + }, + { + "internalType": "address", + "name": "nvmConfig", + "type": "address" } ], "name": "initialize", From d5d05674773b5d3409af75a664853cea599a0b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 17:38:33 +0300 Subject: [PATCH 104/151] fix: modify abis --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8c00efebb..e318cf5f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ coverage/ doc/ test/**/*.js !test/resources/proxy-poc/*.js +!test/resources/artifacts/*.json src/**/*.js package-lock.json yarn.lock From eed7d658f261f884e0d6c956e1aa2da698423609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 17:45:04 +0300 Subject: [PATCH 105/151] fix: at least one error left --- integration/nevermined/NFT1155Api.e2e.test.ts | 4 ++-- integration/nevermined/Subscriptions.e2e.test.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 1e08d6cac..46aacd470 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -17,7 +17,7 @@ import { PublishMetadataOptions, RoyaltyKind, } from '../../src/nevermined/api/AssetsApi' -import { ethers } from 'ethers' +import { ethers, ZeroAddress } from 'ethers' import '../globals' import { AssetAttributes } from '../../src/models/AssetAttributes' import { NFTAttributes } from '../../src/models/NFTAttributes' @@ -481,7 +481,7 @@ function makeTest(isCustom) { 'NFT1155', 'NVM', '', - nevermined.keeper.nvmConfig.address, + ZeroAddress, ]) const nftContract = await Nft1155Contract.getInstance( diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index 84b6bafac..56c54a1b1 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -7,7 +7,7 @@ import { EscrowPaymentCondition, TransferNFT721Condition, Token } from '../../sr import { config } from '../config' import { getMetadata } from '../utils' import TestContractHandler from '../../test/keeper/TestContractHandler' -import { ethers } from 'ethers' +import { ethers, ZeroAddress } from 'ethers' import { didZeroX } from '../../src/utils' import { EventOptions } from '../../src/events' import { @@ -302,6 +302,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { '', '', 0, + ZeroAddress, ]) await nevermined.contracts.loadNft721Api(subscriptionNFT) From 65f0b907b71bdf8ecf95b37acbb3220ee52fa7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 18:26:45 +0300 Subject: [PATCH 106/151] fix: new artifacts for tokens --- integration/nevermined/Credits.e2e.test.ts | 1 + .../CreditsWithDuration.e2e.test.ts | 1 + .../NFT1155SubscriptionUpgradeable.json | 206 ++++++++++++------ .../NFT721SubscriptionUpgradeable.json | 196 +++++++++++------ 4 files changed, 280 insertions(+), 124 deletions(-) diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index 8d2774172..cf2ac1f90 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -143,6 +143,7 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { 'Credits Subscription NFT', 'CRED', '', + nevermined.keeper.nvmConfig.address, ], ) diff --git a/integration/nevermined/CreditsWithDuration.e2e.test.ts b/integration/nevermined/CreditsWithDuration.e2e.test.ts index 625397f7b..b82e1961f 100644 --- a/integration/nevermined/CreditsWithDuration.e2e.test.ts +++ b/integration/nevermined/CreditsWithDuration.e2e.test.ts @@ -148,6 +148,7 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC 'Credits Subscription NFT', 'CRED', '', + nevermined.keeper.nvmConfig.address, ], ) diff --git a/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json index 08f3e11a0..c55c50f35 100644 --- a/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json +++ b/test/resources/artifacts/NFT1155SubscriptionUpgradeable.json @@ -1,7 +1,5 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "NFT1155SubscriptionUpgradeable", - "sourceName": "contracts/token/erc1155/NFT1155SubcriptionUpgradeable.sol", + "name": "NFT1155SubscriptionUpgradeable", "abi": [ { "anonymous": false, @@ -264,7 +262,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xa217fddf" }, { "inputs": [], @@ -277,7 +276,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x85be5724" }, { "inputs": [ @@ -305,12 +305,18 @@ "internalType": "string", "name": "uri_", "type": "string" + }, + { + "internalType": "address", + "name": "nvmConfig_", + "type": "address" } ], "name": "__NFT1155Upgradeable_init", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x2589b1d8" }, { "inputs": [ @@ -338,12 +344,18 @@ "internalType": "string", "name": "uri_", "type": "string" + }, + { + "internalType": "address", + "name": "nvmConfig_", + "type": "address" } ], "name": "__NFT1155Upgradeable_unchained", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xd091493b" }, { "inputs": [ @@ -362,7 +374,8 @@ } ], "stateMutability": "pure", - "type": "function" + "type": "function", + "signature": "0x82c947b7" }, { "inputs": [ @@ -386,7 +399,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x00fdd58e" }, { "inputs": [ @@ -410,7 +424,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x4e1273f4" }, { "inputs": [ @@ -428,7 +443,8 @@ "name": "burn", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xb390c0ab" }, { "inputs": [ @@ -451,7 +467,8 @@ "name": "burn", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xf5298aca" }, { "inputs": [ @@ -470,7 +487,8 @@ } ], "stateMutability": "pure", - "type": "function" + "type": "function", + "signature": "0x5ced058e" }, { "inputs": [ @@ -489,7 +507,8 @@ } ], "stateMutability": "pure", - "type": "function" + "type": "function", + "signature": "0x5ea3ab85" }, { "inputs": [], @@ -502,7 +521,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xe8a3d485" }, { "inputs": [ @@ -536,7 +556,8 @@ } ], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x1e5c2b34" }, { "inputs": [], @@ -549,7 +570,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x6fd902e1" }, { "inputs": [ @@ -590,7 +612,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xebf3c87b" }, { "inputs": [ @@ -624,7 +647,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x47c4ef25" }, { "inputs": [], @@ -637,7 +661,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xab9de230" }, { "inputs": [ @@ -656,7 +681,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x248a9ca3" }, { "inputs": [], @@ -669,7 +695,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xce1b815f" }, { "inputs": [ @@ -682,7 +709,8 @@ "name": "grantOperatorRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x27ac0c58" }, { "inputs": [ @@ -700,7 +728,28 @@ "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x2f2ff15d" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "hasNVMOperatorRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function", + "signature": "0x108762d0" }, { "inputs": [ @@ -724,7 +773,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x91d14854" }, { "inputs": [ @@ -755,14 +805,15 @@ }, { "internalType": "address", - "name": "nvmConfig", + "name": "nvmConfig_", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x45237f1c" }, { "inputs": [ @@ -786,7 +837,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xe985e9c5" }, { "inputs": [ @@ -805,7 +857,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x16279055" }, { "inputs": [ @@ -824,7 +877,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x6d70f7ae" }, { "inputs": [ @@ -843,7 +897,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x572b6c05" }, { "inputs": [ @@ -861,7 +916,8 @@ "name": "mint", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x1b2ef1ca" }, { "inputs": [ @@ -889,7 +945,8 @@ "name": "mint", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x731133e9" }, { "inputs": [ @@ -922,7 +979,8 @@ "name": "mint", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xb49c99b8" }, { "inputs": [], @@ -935,7 +993,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x06fdde03" }, { "inputs": [], @@ -948,7 +1007,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x6fac889b" }, { "inputs": [], @@ -961,7 +1021,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xe9c1e045" }, { "inputs": [], @@ -974,21 +1035,24 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x8da5cb5b" }, { "inputs": [], "name": "renounceOperatorRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x3d6d3598" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x715018a6" }, { "inputs": [ @@ -1006,7 +1070,8 @@ "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x36568abe" }, { "inputs": [ @@ -1019,7 +1084,8 @@ "name": "revokeOperatorRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xb219f7d7" }, { "inputs": [ @@ -1037,7 +1103,8 @@ "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xd547741f" }, { "inputs": [ @@ -1066,7 +1133,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x2a55205a" }, { "inputs": [ @@ -1099,7 +1167,8 @@ "name": "safeBatchTransferFrom", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x2eb2c2d6" }, { "inputs": [ @@ -1132,7 +1201,8 @@ "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xf242432a" }, { "inputs": [ @@ -1150,7 +1220,8 @@ "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xa22cb465" }, { "inputs": [ @@ -1163,7 +1234,8 @@ "name": "setContractMetadataUri", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xd2423105" }, { "inputs": [ @@ -1191,7 +1263,8 @@ "name": "setNFTAttributes", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x97cfb1a9" }, { "inputs": [ @@ -1209,7 +1282,8 @@ "name": "setNFTMetadata", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x237c4919" }, { "inputs": [ @@ -1222,7 +1296,8 @@ "name": "setNvmConfigAddress", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x02acb9a6" }, { "inputs": [ @@ -1245,7 +1320,8 @@ "name": "setTokenRoyalty", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x9713c807" }, { "inputs": [ @@ -1264,7 +1340,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x01ffc9a7" }, { "inputs": [], @@ -1277,7 +1354,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x95d89b41" }, { "inputs": [ @@ -1290,7 +1368,8 @@ "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xf2fde38b" }, { "inputs": [ @@ -1309,7 +1388,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x0e89341c" }, { "inputs": [ @@ -1333,11 +1413,13 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xed5b5931" } ], - "bytecode": "0x608060405234801561001057600080fd5b50613f5b806100206000396000f3fe608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e89565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ecb565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612ee8565b6107f3565b005b6102d161081d565b6040516102889190612f55565b6102d16102ec366004612f68565b6108ac565b6102a46102ff366004612ee8565b3b151590565b6102c7610313366004612f81565b610951565b61032b6103263660046130f5565b610977565b60405161028891906131a1565b6102c76103463660046131b5565b610b7d565b61027e610359366004612f68565b610bb7565b6102c761036c366004612ee8565b610bcc565b61038461037f366004612f81565b610c37565b6040516102889291906131f1565b6102c76103a0366004613270565b610c8d565b6102c76103b336600461331d565b610ceb565b6102c76103c636600461331d565b610d0c565b6102c7610d96565b6102c76103e136600461334d565b610db7565b6103f96103f4366004612f68565b610ed9565b60405161028894939291906133ca565b61041c6104173660046133fb565b610fd6565b604051610288919061348f565b6102a4610437366004612ee8565b6110ff565b61032b61044a366004612f68565b90565b61027e61045b3660046134a2565b611124565b6102a461046e366004612ee8565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134de565b61119f565b61027e6104c9366004612ee8565b6001600160a01b031690565b61027e600080516020613ee683398151915281565b61032b6111b3565b6102a461050036600461331d565b6111c2565b6102d16111ed565b6102c761051b366004613534565b6111fb565b6102c761052e36600461356c565b61122d565b61027e600081565b6102c76105493660046135bb565b611260565b61032b611272565b6102c7610564366004612ee8565b611281565b6102c7610577366004612f81565b6112e9565b6102c761058a3660046135e9565b6112fb565b61032b61136e565b6102c76105a5366004613648565b6113f9565b6102c76105b836600461331d565b611455565b6102c76105cb36600461334d565b611471565b6102d1611551565b6102a46105e636600461367c565b6115e3565b60ff5461032b906001600160a01b031681565b61061161060c366004612e89565b611624565b60405161028891906136aa565b61041c61062c366004612e89565b6116bf565b6102c761063f366004613703565b6117a0565b6102c7610652366004612ee8565b6117f7565b6102c761066536600461375f565b61186d565b6102c761067836600461334d565b611baf565b60008061068a8484611c0c565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613794565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613794565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613794565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613794565b9060005260206000209060030201600001548261079991906137c0565b91505b806107a6816137d3565b915050610690565b509150505b92915050565b60006107c482611c3f565b806107d357506107d382611c60565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611cb0565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137ec565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137ec565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137ec565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611d1f565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611d2e565b9050806001600160a01b038116633f2f5ee26109d2611d1f565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613826565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613794565b60200260200101516040518263ffffffff1660e01b8152600401610a8a91906131a1565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137d3565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611d1f565b610bad5760405162461bcd60e51b8152600401610ba490613884565b60405180910390fd5b6109738282611dc8565b600090815260c9602052604090206001015490565b610bd4611d1f565b6001600160a01b0316610be56111b3565b6001600160a01b03161480610c005750610c0061046e611d1f565b610c1c5760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282611dee565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138df565b610c8391906138f6565b9150509250929050565b610c95611d1f565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611d1f565b610cd75760405162461bcd60e51b8152600401610ba490613918565b610ce48585858585611df8565b5050505050565b610cf482610bb7565b610cfd81611fe9565b610d078383611ffa565b505050565b610d14611d1f565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b6109738282612081565b610db5600080516020613ee6833981519152610db0611d1f565b612081565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de630612106565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611baf565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137ec565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612fa3565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613794565b60200260200101518583815181106110bd576110bd613794565b602002602001015161067d565b8282815181106110dc576110dc613794565b60209081029190910101526110f0816137d3565b9050611085565b509392505050565b600061110961136e565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613794565b60200260200101518261115891906137c0565b915080611164816137d3565b91505061112a565b5092915050565b60006107b3600080516020613ee6833981519152836111c2565b611195611cb0565b610db56000612115565b6111ad8484846000856112fb565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137ec565b61120661046e611d1f565b6112225760405162461bcd60e51b8152600401610ba490613884565b610d07838383612167565b61123861046e611d1f565b6112545760405162461bcd60e51b8152600401610ba490613884565b6111ad848484846121ff565b61097361126b611d1f565b8383612233565b60ff546001600160a01b031690565b611289611d1f565b6001600160a01b031661129a6111b3565b6001600160a01b031614806112b557506112b561046e611d1f565b6112d15760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282612081565b6109736112f4611d1f565b838361186d565b61130785858584612313565b60006113138686611c0c565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b600080611379611272565b90506001600160a01b03811661139157600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f39190613966565b91505090565b611401611d1f565b6001600160a01b03166114126111b3565b6001600160a01b0316148061142d575061142d61046e611d1f565b6114495760405162461bcd60e51b8152600401610ba4906138af565b60fe61097382826139c9565b61145e82610bb7565b61146781611fe9565b610d078383612081565b600054610100900460ff166114985760405162461bcd60e51b8152600401610ba490613a88565b6114b7600080516020613ee68339815191526114b2611d1f565b611dee565b6114cf600080516020613ee683398151915285611dee565b6114e7600080516020613ee683398151915286611dee565b6114f0816113f9565b6101006114fd84826139c9565b5061010161150b83826139c9565b5061010280546001600160a01b0319166001600160a01b038616179055611530611d1f565b6001600160a01b0316856001600160a01b031614610ce457610ce4856117f7565b606060fe8054611560906137ec565b80601f016020809104026020016040519081016040528092919081815260200182805461158c906137ec565b80156115d95780601f106115ae576101008083540402835291602001916115d9565b820191906000526020600020905b8154815290600101906020018083116115bc57829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff168061161d575061161d82611173565b9392505050565b606061010360006116358585611c0c565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156116b35783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611663565b50505050905092915050565b606060006116cd8484611c0c565b60008181526101036020526040812054919250906001600160401b038111156116f8576116f8612fa3565b604051908082528060200260200182016040528015611721578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae5760008381526101036020526040902080548290811061175f5761175f613794565b90600052602060002090600302016002015482828151811061178357611783613794565b602090810291909101015280611798816137d3565b915050611727565b6117a8611d1f565b6001600160a01b0316856001600160a01b031614806117ce57506117ce856105e6611d1f565b6117ea5760405162461bcd60e51b8152600401610ba490613918565b610ce485858585856125ea565b6117ff611cb0565b6001600160a01b0381166118645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c3481612115565b80611878848461271f565b10156118d25760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b6118dd61046e611d1f565b8061190057506118eb611d1f565b6001600160a01b0316836001600160a01b0316145b806119125750611912836105e6611d1f565b6119705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611991908490613ad3565b9091555050610102546001600160a01b031663bb794d92836119b1611d1f565b84436040516020016119c69493929190613afd565b604051602081830303815290604052805190602001208460001b6119e8611d1f565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611a289493929190613b39565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613b79565b506000611a788484611c0c565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611ab657611ab6613794565b9060005260206000209060030201600001548211611b1d57600083815261010360205260409020805483919083908110611af257611af2613794565b90600052602060002090600302016000016000828254611b129190613ad3565b90915550610ed19050565b600083815261010360205260409020805482908110611b3e57611b3e613794565b90600052602060002090600302016000015482611b5b9190613ad3565b60008481526101036020526040902080549193509082908110611b8057611b80613794565b600091825260208220600390910201818155600181018290556002015580611ba7816137d3565b915050611a7e565b600054610100900460ff16611bd65760405162461bcd60e51b8152600401610ba490613a88565b611bde6127b2565b611be66127b2565b611bef816127d9565b611bf7612809565b611bff6127b2565b610ce48585858585611471565b60008282604051602001611c219291906131f1565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611c9157506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611cb8611d1f565b6001600160a01b0316611cc96111b3565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611d29612840565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611dc35760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d0782826139c9565b6109738282611ffa565b8151835114611e5a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b038416611e805760405162461bcd60e51b8152600401610ba490613b96565b6000611e8a611d1f565b9050611e9a81878787878761286e565b60005b8451811015611f83576000858281518110611eba57611eba613794565b602002602001015190506000858381518110611ed857611ed8613794565b60209081029190910181015160008481526097835260408082206001600160a01b038e168352909352919091205490915081811015611f295760405162461bcd60e51b8152600401610ba490613bdb565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611f689084906137c0565b9250508190555050505080611f7c906137d3565b9050611e9d565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611fd3929190613c25565b60405180910390a4610ed18187878787876128d5565b610c3481611ff5611d1f565b612a40565b61200482826111c2565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561203d611d1f565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61208b82826111c2565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556120c2611d1f565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156121b75760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce482826139c9565b816001600160a01b0316836001600160a01b0316036122a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61231e61046e611d1f565b80612341575061232c6111b3565b6001600160a01b0316846001600160a01b0316145b806123d1575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa158015612391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b59190613966565b6001600160a01b03166123c6611d1f565b6001600160a01b0316145b6124165760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff1661246a5760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc6020526040902060020154156124e257600083815260fc6020526040902060028101546001909101546124a59084906137c0565b11156124e25760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc6020526040812060010180548492906125039084906137c0565b9091555050610102546001600160a01b031663bb794d9284612523611d1f565b85436040516020016125389493929190613c6a565b604051602081830303815290604052805190602001208560001b61255a611d1f565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161259a9493929190613c93565b6020604051808303816000875af11580156125b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125dd9190613b79565b506111ad84848484612a99565b6001600160a01b0384166126105760405162461bcd60e51b8152600401610ba490613b96565b600061261a611d1f565b9050600061262785612bae565b9050600061263485612bae565b905061264483898985858961286e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156126875760405162461bcd60e51b8152600401610ba490613bdb565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126c69084906137c0565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613f06833981519152910160405180910390a4612714848a8a8a8a8a612bf9565b505050505050505050565b60006001600160a01b03831661278a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613a88565b600054610100900460ff166128005760405162461bcd60e51b8152600401610ba490613a88565b610c3481612cbb565b600054610100900460ff166128305760405162461bcd60e51b8152600401610ba490613a88565b610db561283b611d1f565b612115565b6000601436108015906128575750612857336110ff565b15612869575060131936013560601c90565b503390565b6001600160a01b038516158061288b57506001600160a01b038416155b8061289c575061289c61046e611d1f565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6128e7846001600160a01b0316612106565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906129209089908990889088908890600401613cd3565b6020604051808303816000875af192505050801561295b575060408051601f3d908101601f1916820190925261295891810190613d11565b60015b612a0757612967613d2e565b806308c379a0036129a0575061297b613d49565b8061298657506129a2565b8060405162461bcd60e51b8152600401610ba49190612f55565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b50505050505050565b612a4a82826111c2565b61097357612a5781612cc7565b612a62836020612cd9565b604051602001612a73929190613e1a565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f55565b6001600160a01b038416612af95760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b6000612b03611d1f565b90506000612b1085612bae565b90506000612b1d85612bae565b9050612b2e8360008985858961286e565b60008681526097602090815260408083206001600160a01b038b16845290915281208054879290612b609084906137c0565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613f06833981519152910160405180910390a4612a3783600089898989612bf9565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612be857612be8613794565b602090810291909101015292915050565b612c0b846001600160a01b0316612106565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c449089908990889088908890600401613e89565b6020604051808303816000875af1925050508015612c7f575060408051601f3d908101601f19168201909252612c7c91810190613d11565b60015b612c8b57612967613d2e565b6001600160e01b0319811663f23a6e6160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b609961097382826139c9565b60606107b36001600160a01b03831660145b60606000612ce88360026138df565b612cf39060026137c0565b6001600160401b03811115612d0a57612d0a612fa3565b6040519080825280601f01601f191660200182016040528015612d34576020820181803683370190505b509050600360fc1b81600081518110612d4f57612d4f613794565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7e57612d7e613794565b60200101906001600160f81b031916908160001a9053506000612da28460026138df565b612dad9060016137c0565b90505b6001811115612e25576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612de157612de1613794565b1a60f81b828281518110612df757612df7613794565b60200101906001600160f81b031916908160001a90535060049490941c93612e1e81613ece565b9050612db0565b50831561161d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e9c57600080fd5b8235612ea781612e74565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612edd57600080fd5b813561161d81612eb5565b600060208284031215612efa57600080fd5b813561161d81612e74565b60005b83811015612f20578181015183820152602001612f08565b50506000910152565b60008151808452612f41816020860160208601612f05565b601f01601f19169290920160200192915050565b60208152600061161d6020830184612f29565b600060208284031215612f7a57600080fd5b5035919050565b60008060408385031215612f9457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fde57612fde612fa3565b6040525050565b600082601f830112612ff657600080fd5b81356001600160401b0381111561300f5761300f612fa3565b604051613026601f8301601f191660200182612fb9565b81815284602083860101111561303b57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561307157613071612fa3565b5060051b60200190565b600082601f83011261308c57600080fd5b8135602061309982613058565b6040516130a68282612fb9565b83815260059390931b85018201928281019150868411156130c657600080fd5b8286015b848110156130ea5780356130dd81612e74565b83529183019183016130ca565b509695505050505050565b6000806000806080858703121561310b57600080fd5b84356001600160401b038082111561312257600080fd5b61312e88838901612fe5565b9550602087013591508082111561314457600080fd5b61315088838901612fe5565b9450604087013591508082111561316657600080fd5b61317288838901612fe5565b9350606087013591508082111561318857600080fd5b506131958782880161307b565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131c857600080fd5b8235915060208301356001600160401b038111156131e557600080fd5b610c8385828601612fe5565b6001600160a01b03929092168252602082015260400190565b600082601f83011261321b57600080fd5b8135602061322882613058565b6040516132358282612fb9565b83815260059390931b850182019282810191508684111561325557600080fd5b8286015b848110156130ea5780358352918301918301613259565b600080600080600060a0868803121561328857600080fd5b853561329381612e74565b945060208601356132a381612e74565b935060408601356001600160401b03808211156132bf57600080fd5b6132cb89838a0161320a565b945060608801359150808211156132e157600080fd5b6132ed89838a0161320a565b9350608088013591508082111561330357600080fd5b5061331088828901612fe5565b9150509295509295909350565b6000806040838503121561333057600080fd5b82359150602083013561334281612e74565b809150509250929050565b600080600080600060a0868803121561336557600080fd5b853561337081612e74565b9450602086013561338081612e74565b935060408601356001600160401b038082111561339c57600080fd5b6133a889838a01612fe5565b945060608801359150808211156133be57600080fd5b6132ed89838a01612fe5565b84151581528360208201528260408201526080606082015260006133f16080830184612f29565b9695505050505050565b6000806040838503121561340e57600080fd5b82356001600160401b038082111561342557600080fd5b6134318683870161307b565b9350602085013591508082111561344757600080fd5b50610c838582860161320a565b600081518084526020808501945080840160005b8381101561348457815187529582019590820190600101613468565b509495945050505050565b60208152600061161d6020830184613454565b6000602082840312156134b457600080fd5b81356001600160401b038111156134ca57600080fd5b6134d68482850161320a565b949350505050565b600080600080608085870312156134f457600080fd5b84356134ff81612e74565b9350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b61319587828801612fe5565b60008060006060848603121561354957600080fd5b83359250602084013561355b81612e74565b929592945050506040919091013590565b6000806000806080858703121561358257600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b8015158114610c3457600080fd5b600080604083850312156135ce57600080fd5b82356135d981612e74565b91506020830135613342816135ad565b600080600080600060a0868803121561360157600080fd5b853561360c81612e74565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b61331088828901612fe5565b60006020828403121561365a57600080fd5b81356001600160401b0381111561367057600080fd5b6134d684828501612fe5565b6000806040838503121561368f57600080fd5b823561369a81612e74565b9150602083013561334281612e74565b602080825282518282018190526000919060409081850190868401855b828110156136f657815180518552868101518786015285015185850152606090930192908501906001016136c7565b5091979650505050505050565b600080600080600060a0868803121561371b57600080fd5b853561372681612e74565b9450602086013561373681612e74565b9350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b60008060006060848603121561377457600080fd5b833561377f81612e74565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b36137aa565b6000600182016137e5576137e56137aa565b5060010190565b600181811c9082168061380057607f821691505b60208210810361382057634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061385290830186612f29565b82810360608401526138648186612f29565b905082810360808401526138788185612f29565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b36137aa565b60008261391357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561397857600080fd5b815161161d81612e74565b601f821115610d0757600081815260208120601f850160051c810160208610156139aa5750805b601f850160051c820191505b81811015610ed1578281556001016139b6565b81516001600160401b038111156139e2576139e2612fa3565b6139f6816139f084546137ec565b84613983565b602080601f831160018114613a2b5760008415613a135750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613a5a57888601518255948401946001909101908401613a3b565b5085821015613a785787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b36137aa565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613ae6565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613ae6565b600060208284031215613b8b57600080fd5b815161161d816135ad565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613c386040830185613454565b8281036020840152613c4a8185613454565b95945050505050565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613c53565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613c53565b6001600160a01b0386811682528516602082015260a060408201819052600090613cff90830186613454565b82810360608401526138648186613454565b600060208284031215613d2357600080fd5b815161161d81612eb5565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d575790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d8657505050505090565b8285019150815181811115613d9e5750505050505090565b843d8701016020828501011115613db85750505050505090565b613dc760208286010187612fb9565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e4c816017850160208801612f05565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e7d816028840160208801612f05565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ec390830184612f29565b979650505050505050565b600081613edd57613edd6137aa565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220edbfbd9cc36d0fc29f921a0c11f618778549fd5e870483e010354e8e9f57524a64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102665760003560e01c8062fdd58e1461026b57806301ffc9a71461029157806302acb9a6146102b457806306fdde03146102c95780630e89341c146102de57806316279055146102f15780631b2ef1ca146103055780631e5c2b3414610318578063237c491914610338578063248a9ca31461034b57806327ac0c581461035e5780632a55205a146103715780632eb2c2d6146103925780632f2ff15d146103a557806336568abe146103b85780633d6d3598146103cb5780633f2f5ee2146103d357806347c4ef25146103e65780634e1273f414610409578063572b6c05146104295780635ced058e1461043c5780635ea3ab851461044d5780636d70f7ae146104605780636fac889b146104735780636fd902e11461049a578063715018a6146104a0578063731133e9146104a857806382c947b7146104bb57806385be5724146104d55780638da5cb5b146104ea57806391d14854146104f257806395d89b41146105055780639713c8071461050d57806397cfb1a914610520578063a217fddf14610533578063a22cb4651461053b578063ab9de2301461054e578063b219f7d714610556578063b390c0ab14610569578063b49c99b81461057c578063ce1b815f1461058f578063d242310514610597578063d547741f146105aa578063d70cf7af146105bd578063e8a3d485146105d0578063e985e9c5146105d8578063e9c1e045146105eb578063ebf3c87b146105fe578063ed5b59311461061e578063f242432a14610631578063f2fde38b14610644578063f5298aca14610657578063f80795f81461066a575b600080fd5b61027e610279366004612e89565b61067d565b6040519081526020015b60405180910390f35b6102a461029f366004612ecb565b6107b9565b6040519015158152602001610288565b6102c76102c2366004612ee8565b6107f3565b005b6102d161081d565b6040516102889190612f55565b6102d16102ec366004612f68565b6108ac565b6102a46102ff366004612ee8565b3b151590565b6102c7610313366004612f81565b610951565b61032b6103263660046130f5565b610977565b60405161028891906131a1565b6102c76103463660046131b5565b610b7d565b61027e610359366004612f68565b610bb7565b6102c761036c366004612ee8565b610bcc565b61038461037f366004612f81565b610c37565b6040516102889291906131f1565b6102c76103a0366004613270565b610c8d565b6102c76103b336600461331d565b610ceb565b6102c76103c636600461331d565b610d0c565b6102c7610d96565b6102c76103e136600461334d565b610db7565b6103f96103f4366004612f68565b610ed9565b60405161028894939291906133ca565b61041c6104173660046133fb565b610fd6565b604051610288919061348f565b6102a4610437366004612ee8565b6110ff565b61032b61044a366004612f68565b90565b61027e61045b3660046134a2565b611124565b6102a461046e366004612ee8565b611173565b61027e7f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b4361027e565b6102c761118d565b6102c76104b63660046134de565b61119f565b61027e6104c9366004612ee8565b6001600160a01b031690565b61027e600080516020613ee683398151915281565b61032b6111b3565b6102a461050036600461331d565b6111c2565b6102d16111ed565b6102c761051b366004613534565b6111fb565b6102c761052e36600461356c565b61122d565b61027e600081565b6102c76105493660046135bb565b611260565b61032b611272565b6102c7610564366004612ee8565b611281565b6102c7610577366004612f81565b6112e9565b6102c761058a3660046135e9565b6112fb565b61032b61136e565b6102c76105a5366004613648565b6113f9565b6102c76105b836600461331d565b611455565b6102c76105cb36600461334d565b611471565b6102d1611551565b6102a46105e636600461367c565b6115e3565b60ff5461032b906001600160a01b031681565b61061161060c366004612e89565b611624565b60405161028891906136aa565b61041c61062c366004612e89565b6116bf565b6102c761063f366004613703565b6117a0565b6102c7610652366004612ee8565b6117f7565b6102c761066536600461375f565b61186d565b6102c761067836600461334d565b611baf565b60008061068a8484611c0c565b90506000805b600083815261010360205260409020548110156107ae576000838152610103602052604081208054839081106106c8576106c8613794565b906000526020600020906003020160020154118015610756575060008381526101036020526040902080548290811061070357610703613794565b90600052602060002090600302016001015460001480610756575060008381526101036020526040902080544391908390811061074257610742613794565b906000526020600020906003020160010154115b1561079c5760008381526101036020526040902080548290811061077c5761077c613794565b9060005260206000209060030201600001548261079991906137c0565b91505b806107a6816137d3565b915050610690565b509150505b92915050565b60006107c482611c3f565b806107d357506107d382611c60565b806107b357506001600160e01b0319821663152a902d60e11b1492915050565b6107fb611cb0565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b610100805461082b906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610857906137ec565b80156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108cc906137ec565b80601f01602080910402602001604051908101604052809291908181526020018280546108f8906137ec565b80156109455780601f1061091a57610100808354040283529160200191610945565b820191906000526020600020905b81548152906001019060200180831161092857829003601f168201915b50505050509050919050565b61097361095c611d1f565b83836040518060200160405280600081525061119f565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806109ad5750305b60006109b882611d2e565b9050806001600160a01b038116633f2f5ee26109d2611d1f565b610102546040516001600160e01b031960e085901b168152610a0792916001600160a01b0316908d908d908d90600401613826565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b5050505060005b8551811015610acf57816001600160a01b03166327ac0c58878381518110610a6657610a66613794565b60200260200101516040518263ffffffff1660e01b8152600401610a8a91906131a1565b600060405180830381600087803b158015610aa457600080fd5b505af1158015610ab8573d6000803e3d6000fd5b505050508080610ac7906137d3565b915050610a3c565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610b6a91815260200190565b60405180910390a3509695505050505050565b610b8861046e611d1f565b610bad5760405162461bcd60e51b8152600401610ba490613884565b60405180910390fd5b6109738282611dc8565b600090815260c9602052604090206001015490565b610bd4611d1f565b6001600160a01b0316610be56111b3565b6001600160a01b03161480610c005750610c0061046e611d1f565b610c1c5760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282611dee565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c7990866138df565b610c8391906138f6565b9150509250929050565b610c95611d1f565b6001600160a01b0316856001600160a01b03161480610cbb5750610cbb856105e6611d1f565b610cd75760405162461bcd60e51b8152600401610ba490613918565b610ce48585858585611df8565b5050505050565b610cf482610bb7565b610cfd81611fe9565b610d078383611ffa565b505050565b610d14611d1f565b6001600160a01b0316816001600160a01b031614610d8c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba4565b6109738282612081565b610db5600080516020613ee6833981519152610db0611d1f565b612081565b565b600054610100900460ff1615808015610dd75750600054600160ff909116105b80610df85750610de630612106565b158015610df8575060005460ff166001145b610e5b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba4565b6000805460ff191660011790558015610e7e576000805461ff0019166101001790555b610e8b8686868686611baf565b8015610ed1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190610f30906137ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c906137ec565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6060815183511461103b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610ba4565b600083516001600160401b0381111561105657611056612fa3565b60405190808252806020026020018201604052801561107f578160200160208202803683370190505b50905060005b84518110156110f7576110ca8582815181106110a3576110a3613794565b60200260200101518583815181106110bd576110bd613794565b602002602001015161067d565b8282815181106110dc576110dc613794565b60209081029190910101526110f0816137d3565b9050611085565b509392505050565b600061110961136e565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b835181101561116c5783818151811061114557611145613794565b60200260200101518261115891906137c0565b915080611164816137d3565b91505061112a565b5092915050565b60006107b3600080516020613ee6833981519152836111c2565b611195611cb0565b610db56000612115565b6111ad8484846000856112fb565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610101805461082b906137ec565b61120661046e611d1f565b6112225760405162461bcd60e51b8152600401610ba490613884565b610d07838383612167565b61123861046e611d1f565b6112545760405162461bcd60e51b8152600401610ba490613884565b6111ad848484846121ff565b61097361126b611d1f565b8383612233565b60ff546001600160a01b031690565b611289611d1f565b6001600160a01b031661129a6111b3565b6001600160a01b031614806112b557506112b561046e611d1f565b6112d15760405162461bcd60e51b8152600401610ba4906138af565b610c34600080516020613ee683398151915282612081565b6109736112f4611d1f565b838361186d565b61130785858584612313565b60006113138686611c0c565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b600080611379611272565b90506001600160a01b03811661139157600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f39190613966565b91505090565b611401611d1f565b6001600160a01b03166114126111b3565b6001600160a01b0316148061142d575061142d61046e611d1f565b6114495760405162461bcd60e51b8152600401610ba4906138af565b60fe61097382826139c9565b61145e82610bb7565b61146781611fe9565b610d078383612081565b600054610100900460ff166114985760405162461bcd60e51b8152600401610ba490613a88565b6114b7600080516020613ee68339815191526114b2611d1f565b611dee565b6114cf600080516020613ee683398151915285611dee565b6114e7600080516020613ee683398151915286611dee565b6114f0816113f9565b6101006114fd84826139c9565b5061010161150b83826139c9565b5061010280546001600160a01b0319166001600160a01b038616179055611530611d1f565b6001600160a01b0316856001600160a01b031614610ce457610ce4856117f7565b606060fe8054611560906137ec565b80601f016020809104026020016040519081016040528092919081815260200182805461158c906137ec565b80156115d95780601f106115ae576101008083540402835291602001916115d9565b820191906000526020600020905b8154815290600101906020018083116115bc57829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff168061161d575061161d82611173565b9392505050565b606061010360006116358585611c0c565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156116b35783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611663565b50505050905092915050565b606060006116cd8484611c0c565b60008181526101036020526040812054919250906001600160401b038111156116f8576116f8612fa3565b604051908082528060200260200182016040528015611721578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107ae5760008381526101036020526040902080548290811061175f5761175f613794565b90600052602060002090600302016002015482828151811061178357611783613794565b602090810291909101015280611798816137d3565b915050611727565b6117a8611d1f565b6001600160a01b0316856001600160a01b031614806117ce57506117ce856105e6611d1f565b6117ea5760405162461bcd60e51b8152600401610ba490613918565b610ce485858585856125ea565b6117ff611cb0565b6001600160a01b0381166118645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ba4565b610c3481612115565b80611878848461271f565b10156118d25760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610ba4565b6118dd61046e611d1f565b8061190057506118eb611d1f565b6001600160a01b0316836001600160a01b0316145b806119125750611912836105e6611d1f565b6119705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610ba4565b600082815260fc602052604081206001018054839290611991908490613ad3565b9091555050610102546001600160a01b031663bb794d92836119b1611d1f565b84436040516020016119c69493929190613afd565b604051602081830303815290604052805190602001208460001b6119e8611d1f565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611a289493929190613b39565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613b79565b506000611a788484611c0c565b90508160005b60008381526101036020526040902054811015610ed157600083815261010360205260409020805482908110611ab657611ab6613794565b9060005260206000209060030201600001548211611b1d57600083815261010360205260409020805483919083908110611af257611af2613794565b90600052602060002090600302016000016000828254611b129190613ad3565b90915550610ed19050565b600083815261010360205260409020805482908110611b3e57611b3e613794565b90600052602060002090600302016000015482611b5b9190613ad3565b60008481526101036020526040902080549193509082908110611b8057611b80613794565b600091825260208220600390910201818155600181018290556002015580611ba7816137d3565b915050611a7e565b600054610100900460ff16611bd65760405162461bcd60e51b8152600401610ba490613a88565b611bde6127b2565b611be66127b2565b611bef816127d9565b611bf7612809565b611bff6127b2565b610ce48585858585611471565b60008282604051602001611c219291906131f1565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107b357506107b3825b60006001600160e01b03198216636cdb3d1360e11b1480611c9157506001600160e01b031982166303a24d0760e21b145b806107b357506301ffc9a760e01b6001600160e01b03198316146107b3565b611cb8611d1f565b6001600160a01b0316611cc96111b3565b6001600160a01b031614610db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba4565b6000611d29612840565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611dc35760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610ba4565b919050565b600082815260fc60205260409020805460ff19166001178155600301610d0782826139c9565b6109738282611ffa565b8151835114611e5a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ba4565b6001600160a01b038416611e805760405162461bcd60e51b8152600401610ba490613b96565b6000611e8a611d1f565b9050611e9a81878787878761286e565b60005b8451811015611f83576000858281518110611eba57611eba613794565b602002602001015190506000858381518110611ed857611ed8613794565b60209081029190910181015160008481526097835260408082206001600160a01b038e168352909352919091205490915081811015611f295760405162461bcd60e51b8152600401610ba490613bdb565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611f689084906137c0565b9250508190555050505080611f7c906137d3565b9050611e9d565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611fd3929190613c25565b60405180910390a4610ed18187878787876128d5565b610c3481611ff5611d1f565b612a40565b61200482826111c2565b61097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561203d611d1f565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61208b82826111c2565b1561097357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556120c2611d1f565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156121b75760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610ba4565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610ce482826139c9565b816001600160a01b0316836001600160a01b0316036122a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610ba4565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61231e61046e611d1f565b80612341575061232c6111b3565b6001600160a01b0316846001600160a01b0316145b806123d1575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa158015612391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b59190613966565b6001600160a01b03166123c6611d1f565b6001600160a01b0316145b6124165760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610ba4565b600083815260fc602052604090205460ff1661246a5760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610ba4565b600083815260fc6020526040902060020154156124e257600083815260fc6020526040902060028101546001909101546124a59084906137c0565b11156124e25760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610ba4565b600083815260fc6020526040812060010180548492906125039084906137c0565b9091555050610102546001600160a01b031663bb794d9284612523611d1f565b85436040516020016125389493929190613c6a565b604051602081830303815290604052805190602001208560001b61255a611d1f565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161259a9493929190613c93565b6020604051808303816000875af11580156125b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125dd9190613b79565b506111ad84848484612a99565b6001600160a01b0384166126105760405162461bcd60e51b8152600401610ba490613b96565b600061261a611d1f565b9050600061262785612bae565b9050600061263485612bae565b905061264483898985858961286e565b60008681526097602090815260408083206001600160a01b038c168452909152902054858110156126875760405162461bcd60e51b8152600401610ba490613bdb565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126c69084906137c0565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020613f06833981519152910160405180910390a4612714848a8a8a8a8a612bf9565b505050505050505050565b60006001600160a01b03831661278a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610ba4565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b600054610100900460ff16610db55760405162461bcd60e51b8152600401610ba490613a88565b600054610100900460ff166128005760405162461bcd60e51b8152600401610ba490613a88565b610c3481612cbb565b600054610100900460ff166128305760405162461bcd60e51b8152600401610ba490613a88565b610db561283b611d1f565b612115565b6000601436108015906128575750612857336110ff565b15612869575060131936013560601c90565b503390565b6001600160a01b038516158061288b57506001600160a01b038416155b8061289c575061289c61046e611d1f565b610ed15760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610ba4565b6128e7846001600160a01b0316612106565b15610ed15760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906129209089908990889088908890600401613cd3565b6020604051808303816000875af192505050801561295b575060408051601f3d908101601f1916820190925261295891810190613d11565b60015b612a0757612967613d2e565b806308c379a0036129a0575061297b613d49565b8061298657506129a2565b8060405162461bcd60e51b8152600401610ba49190612f55565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610ba4565b6001600160e01b0319811663bc197c8160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b50505050505050565b612a4a82826111c2565b61097357612a5781612cc7565b612a62836020612cd9565b604051602001612a73929190613e1a565b60408051601f198184030181529082905262461bcd60e51b8252610ba491600401612f55565b6001600160a01b038416612af95760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610ba4565b6000612b03611d1f565b90506000612b1085612bae565b90506000612b1d85612bae565b9050612b2e8360008985858961286e565b60008681526097602090815260408083206001600160a01b038b16845290915281208054879290612b609084906137c0565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020613f06833981519152910160405180910390a4612a3783600089898989612bf9565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612be857612be8613794565b602090810291909101015292915050565b612c0b846001600160a01b0316612106565b15610ed15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c449089908990889088908890600401613e89565b6020604051808303816000875af1925050508015612c7f575060408051601f3d908101601f19168201909252612c7c91810190613d11565b60015b612c8b57612967613d2e565b6001600160e01b0319811663f23a6e6160e01b14612a375760405162461bcd60e51b8152600401610ba490613dd2565b609961097382826139c9565b60606107b36001600160a01b03831660145b60606000612ce88360026138df565b612cf39060026137c0565b6001600160401b03811115612d0a57612d0a612fa3565b6040519080825280601f01601f191660200182016040528015612d34576020820181803683370190505b509050600360fc1b81600081518110612d4f57612d4f613794565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d7e57612d7e613794565b60200101906001600160f81b031916908160001a9053506000612da28460026138df565b612dad9060016137c0565b90505b6001811115612e25576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612de157612de1613794565b1a60f81b828281518110612df757612df7613794565b60200101906001600160f81b031916908160001a90535060049490941c93612e1e81613ece565b9050612db0565b50831561161d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba4565b6001600160a01b0381168114610c3457600080fd5b60008060408385031215612e9c57600080fd5b8235612ea781612e74565b946020939093013593505050565b6001600160e01b031981168114610c3457600080fd5b600060208284031215612edd57600080fd5b813561161d81612eb5565b600060208284031215612efa57600080fd5b813561161d81612e74565b60005b83811015612f20578181015183820152602001612f08565b50506000910152565b60008151808452612f41816020860160208601612f05565b601f01601f19169290920160200192915050565b60208152600061161d6020830184612f29565b600060208284031215612f7a57600080fd5b5035919050565b60008060408385031215612f9457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612fde57612fde612fa3565b6040525050565b600082601f830112612ff657600080fd5b81356001600160401b0381111561300f5761300f612fa3565b604051613026601f8301601f191660200182612fb9565b81815284602083860101111561303b57600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b0382111561307157613071612fa3565b5060051b60200190565b600082601f83011261308c57600080fd5b8135602061309982613058565b6040516130a68282612fb9565b83815260059390931b85018201928281019150868411156130c657600080fd5b8286015b848110156130ea5780356130dd81612e74565b83529183019183016130ca565b509695505050505050565b6000806000806080858703121561310b57600080fd5b84356001600160401b038082111561312257600080fd5b61312e88838901612fe5565b9550602087013591508082111561314457600080fd5b61315088838901612fe5565b9450604087013591508082111561316657600080fd5b61317288838901612fe5565b9350606087013591508082111561318857600080fd5b506131958782880161307b565b91505092959194509250565b6001600160a01b0391909116815260200190565b600080604083850312156131c857600080fd5b8235915060208301356001600160401b038111156131e557600080fd5b610c8385828601612fe5565b6001600160a01b03929092168252602082015260400190565b600082601f83011261321b57600080fd5b8135602061322882613058565b6040516132358282612fb9565b83815260059390931b850182019282810191508684111561325557600080fd5b8286015b848110156130ea5780358352918301918301613259565b600080600080600060a0868803121561328857600080fd5b853561329381612e74565b945060208601356132a381612e74565b935060408601356001600160401b03808211156132bf57600080fd5b6132cb89838a0161320a565b945060608801359150808211156132e157600080fd5b6132ed89838a0161320a565b9350608088013591508082111561330357600080fd5b5061331088828901612fe5565b9150509295509295909350565b6000806040838503121561333057600080fd5b82359150602083013561334281612e74565b809150509250929050565b600080600080600060a0868803121561336557600080fd5b853561337081612e74565b9450602086013561338081612e74565b935060408601356001600160401b038082111561339c57600080fd5b6133a889838a01612fe5565b945060608801359150808211156133be57600080fd5b6132ed89838a01612fe5565b84151581528360208201528260408201526080606082015260006133f16080830184612f29565b9695505050505050565b6000806040838503121561340e57600080fd5b82356001600160401b038082111561342557600080fd5b6134318683870161307b565b9350602085013591508082111561344757600080fd5b50610c838582860161320a565b600081518084526020808501945080840160005b8381101561348457815187529582019590820190600101613468565b509495945050505050565b60208152600061161d6020830184613454565b6000602082840312156134b457600080fd5b81356001600160401b038111156134ca57600080fd5b6134d68482850161320a565b949350505050565b600080600080608085870312156134f457600080fd5b84356134ff81612e74565b9350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b61319587828801612fe5565b60008060006060848603121561354957600080fd5b83359250602084013561355b81612e74565b929592945050506040919091013590565b6000806000806080858703121561358257600080fd5b84359350602085013592506040850135915060608501356001600160401b0381111561352857600080fd5b8015158114610c3457600080fd5b600080604083850312156135ce57600080fd5b82356135d981612e74565b91506020830135613342816135ad565b600080600080600060a0868803121561360157600080fd5b853561360c81612e74565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b61331088828901612fe5565b60006020828403121561365a57600080fd5b81356001600160401b0381111561367057600080fd5b6134d684828501612fe5565b6000806040838503121561368f57600080fd5b823561369a81612e74565b9150602083013561334281612e74565b602080825282518282018190526000919060409081850190868401855b828110156136f657815180518552868101518786015285015185850152606090930192908501906001016136c7565b5091979650505050505050565b600080600080600060a0868803121561371b57600080fd5b853561372681612e74565b9450602086013561373681612e74565b9350604086013592506060860135915060808601356001600160401b0381111561363c57600080fd5b60008060006060848603121561377457600080fd5b833561377f81612e74565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107b3576107b36137aa565b6000600182016137e5576137e56137aa565b5060010190565b600181811c9082168061380057607f821691505b60208210810361382057634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0386811682528516602082015260a06040820181905260009061385290830186612f29565b82810360608401526138648186612f29565b905082810360808401526138788185612f29565b98975050505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107b3576107b36137aa565b60008261391357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561397857600080fd5b815161161d81612e74565b601f821115610d0757600081815260208120601f850160051c810160208610156139aa5750805b601f850160051c820191505b81811015610ed1578281556001016139b6565b81516001600160401b038111156139e2576139e2612fa3565b6139f6816139f084546137ec565b84613983565b602080601f831160018114613a2b5760008415613a135750858301515b600019600386901b1c1916600185901b178555610ed1565b600085815260208120601f198616915b82811015613a5a57888601518255948401946001909101908401613a3b565b5085821015613a785787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156107b3576107b36137aa565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613ae6565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613ae6565b600060208284031215613b8b57600080fd5b815161161d816135ad565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613c386040830185613454565b8281036020840152613c4a8185613454565b95945050505050565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613b26908301613c53565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006133f160e08301613c53565b6001600160a01b0386811682528516602082015260a060408201819052600090613cff90830186613454565b82810360608401526138648186613454565b600060208284031215613d2357600080fd5b815161161d81612eb5565b600060033d111561044a5760046000803e5060005160e01c90565b600060443d1015613d575790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613d8657505050505090565b8285019150815181811115613d9e5750505050505090565b843d8701016020828501011115613db85750505050505090565b613dc760208286010187612fb9565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613e4c816017850160208801612f05565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e7d816028840160208801612f05565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ec390830184612f29565b979650505050505050565b600081613edd57613edd6137aa565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220edbfbd9cc36d0fc29f921a0c11f618778549fd5e870483e010354e8e9f57524a64736f6c63430008110033", - "linkReferences": {}, - "deployedLinkReferences": {} -} + "bytecode": "0x608060405234801561001057600080fd5b50614134806100206000396000f3fe608060405234801561001057600080fd5b50600436106102715760003560e01c8062fdd58e1461027657806301ffc9a71461029c57806302acb9a6146102bf57806306fdde03146102d45780630e89341c146102e9578063108762d0146102fc578063162790551461030f5780631b2ef1ca146103235780631e5c2b3414610336578063237c491914610356578063248a9ca3146103695780632589b1d81461037c57806327ac0c581461038f5780632a55205a146103a25780632eb2c2d6146103c35780632f2ff15d146103d657806336568abe146103e95780633d6d3598146103fc57806345237f1c1461040457806347c4ef25146104175780634e1273f41461043a578063572b6c051461045a5780635ced058e1461046d5780635ea3ab851461047e5780636d70f7ae146104915780636fac889b146104a45780636fd902e1146104cb578063715018a6146104d1578063731133e9146104d957806382c947b7146104ec57806385be5724146105065780638da5cb5b1461051b57806391d148541461052357806395d89b41146105365780639713c8071461053e57806397cfb1a914610551578063a217fddf14610564578063a22cb4651461056c578063ab9de2301461057f578063b219f7d714610587578063b390c0ab1461059a578063b49c99b8146105ad578063ce1b815f146105c0578063d091493b146105c8578063d2423105146105db578063d547741f146105ee578063e8a3d48514610601578063e985e9c514610609578063e9c1e0451461061c578063ebf3c87b1461062f578063ed5b59311461064f578063f242432a14610662578063f2fde38b14610675578063f5298aca14610688575b600080fd5b610289610284366004612ff6565b61069b565b6040519081526020015b60405180910390f35b6102af6102aa366004613038565b6107d7565b6040519015158152602001610293565b6102d26102cd366004613055565b610811565b005b6102dc61083b565b60405161029391906130c2565b6102dc6102f73660046130d5565b6108ca565b6102af61030a366004613055565b61096f565b6102af61031d366004613055565b3b151590565b6102d26103313660046130ee565b610a07565b610349610344366004613262565b610a2d565b604051610293919061330e565b6102d2610364366004613322565b610c3a565b6102896103773660046130d5565b610c74565b6102d261038a36600461335e565b610c89565b6102d261039d366004613055565b610cef565b6103b56103b03660046130ee565b610d5a565b60405161029392919061341e565b6102d26103d136600461349d565b610db0565b6102d26103e436600461354a565b610e0e565b6102d26103f736600461354a565b610e2f565b6102d2610eb9565b6102d261041236600461335e565b610eda565b61042a6104253660046130d5565b610ffe565b604051610293949392919061357a565b61044d6104483660046135ab565b6110fb565b604051610293919061363f565b6102af610468366004613055565b611224565b61034961047b3660046130d5565b90565b61028961048c366004613652565b611249565b6102af61049f366004613055565b611298565b6102897f10db2492ff913239dc46d6f79a35650744688d5f5cb6fa1c310d84fc745b0b7581565b43610289565b6102d2611352565b6102d26104e736600461368e565b611364565b6102896104fa366004613055565b6001600160a01b031690565b6102896000805160206140bf83398151915281565b610349611378565b6102af61053136600461354a565b611387565b6102dc6113b2565b6102d261054c3660046136e4565b6113c0565b6102d261055f36600461371c565b6113f2565b610289600081565b6102d261057a36600461376b565b611425565b610349611437565b6102d2610595366004613055565b611446565b6102d26105a83660046130ee565b6114ae565b6102d26105bb366004613799565b6114c0565b610349611533565b6102d26105d636600461335e565b6115be565b6102d26105e93660046137f8565b6116b3565b6102d26105fc36600461354a565b61170f565b6102dc61172b565b6102af61061736600461382c565b6117bd565b60ff54610349906001600160a01b031681565b61064261063d366004612ff6565b6117f7565b604051610293919061385a565b61044d61065d366004612ff6565b611892565b6102d26106703660046138b3565b611973565b6102d2610683366004613055565b6119ca565b6102d261069636600461390f565b611a40565b6000806106a88484611d82565b90506000805b600083815261010360205260409020548110156107cc576000838152610103602052604081208054839081106106e6576106e6613944565b906000526020600020906003020160020154118015610774575060008381526101036020526040902080548290811061072157610721613944565b90600052602060002090600302016001015460001480610774575060008381526101036020526040902080544391908390811061076057610760613944565b906000526020600020906003020160010154115b156107ba5760008381526101036020526040902080548290811061079a5761079a613944565b906000526020600020906003020160000154826107b79190613970565b91505b806107c481613983565b9150506106ae565b509150505b92915050565b60006107e282611db5565b806107f157506107f182611dd6565b806107d157506001600160e01b0319821663152a902d60e11b1492915050565b610819611e26565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b61010080546108499061399c565b80601f01602080910402602001604051908101604052809291908181526020018280546108759061399c565b80156108c25780601f10610897576101008083540402835291602001916108c2565b820191906000526020600020905b8154815290600101906020018083116108a557829003601f168201915b505050505081565b600081815260fc602052604090206003018054606091906108ea9061399c565b80601f01602080910402602001604051908101604052809291908181526020018280546109169061399c565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b50505050509050919050565b60008061097a611437565b90506001600160a01b0381166109935750600092915050565b604051630108762d60e41b81526001600160a01b0382169063108762d0906109bf90869060040161330e565b602060405180830381865afa1580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0091906139d6565b9392505050565b610a29610a12611e95565b838360405180602001604052806000815250611364565b5050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b031680610a635750305b6000610a6e82611ea4565b9050806001600160a01b0381166345237f1c610a88611e95565b6101025460ff546040516001600160e01b031960e086901b168152610ac493926001600160a01b03908116928f928f928f9216906004016139f3565b600060405180830381600087803b158015610ade57600080fd5b505af1158015610af2573d6000803e3d6000fd5b5050505060005b8551811015610b8c57816001600160a01b03166327ac0c58878381518110610b2357610b23613944565b60200260200101516040518263ffffffff1660e01b8152600401610b47919061330e565b600060405180830381600087803b158015610b6157600080fd5b505af1158015610b75573d6000803e3d6000fd5b505050508080610b8490613983565b915050610af9565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bc857600080fd5b505af1158015610bdc573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd734610483604051610c2791815260200190565b60405180910390a3509695505050505050565b610c4561049f611e95565b610c6a5760405162461bcd60e51b8152600401610c6190613a5a565b60405180910390fd5b610a298282611f3e565b600090815260c9602052604090206001015490565b600054610100900460ff16610cb05760405162461bcd60e51b8152600401610c6190613a85565b610cb8611f64565b610cc0611f64565b610cc982611f8b565b610cd1611fbb565b610cd9611f64565b610ce78686868686866115be565b505050505050565b610cf7611e95565b6001600160a01b0316610d08611378565b6001600160a01b03161480610d235750610d2361049f611e95565b610d3f5760405162461bcd60e51b8152600401610c6190613ad0565b610d576000805160206140bf83398151915282611ff2565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610d9c9086613b00565b610da69190613b17565b9150509250929050565b610db8611e95565b6001600160a01b0316856001600160a01b03161480610dde5750610dde85610617611e95565b610dfa5760405162461bcd60e51b8152600401610c6190613b39565b610e078585858585611ffc565b5050505050565b610e1782610c74565b610e20816121ed565b610e2a83836121fe565b505050565b610e37611e95565b6001600160a01b0316816001600160a01b031614610eaf5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c61565b610a298282612285565b610ed86000805160206140bf833981519152610ed3611e95565b612285565b565b600054610100900460ff1615808015610efa5750600054600160ff909116105b80610f1b5750610f093061230a565b158015610f1b575060005460ff166001145b610f7e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c61565b6000805460ff191660011790558015610fa1576000805461ff0019166101001790555b610faf878787878787610c89565b8015610ff5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600081815260fc602090815260408083208151608081018352815460ff161515815260018201549381019390935260028101549183019190915260038101805484938493606093859383860191906110559061399c565b80601f01602080910402602001604051908101604052809291908181526020018280546110819061399c565b80156110ce5780601f106110a3576101008083540402835291602001916110ce565b820191906000526020600020905b8154815290600101906020018083116110b157829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b606081518351146111605760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610c61565b600083516001600160401b0381111561117b5761117b613110565b6040519080825280602002602001820160405280156111a4578160200160208202803683370190505b50905060005b845181101561121c576111ef8582815181106111c8576111c8613944565b60200260200101518583815181106111e2576111e2613944565b602002602001015161069b565b82828151811061120157611201613944565b602090810291909101015261121581613983565b90506111aa565b509392505050565b600061122e611533565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b83518110156112915783818151811061126a5761126a613944565b60200260200101518261127d9190613970565b91508061128981613983565b91505061124f565b5092915050565b60ff546000906001600160a01b03166112c3576107d16000805160206140bf83398151915283611387565b60ff54604051630108762d60e41b81526001600160a01b039091169063108762d0906112f390859060040161330e565b602060405180830381865afa158015611310573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133491906139d6565b806107d157506107d16000805160206140bf83398151915283611387565b61135a611e26565b610ed86000612319565b6113728484846000856114c0565b50505050565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61010180546108499061399c565b6113cb61049f611e95565b6113e75760405162461bcd60e51b8152600401610c6190613a5a565b610e2a83838361236b565b6113fd61049f611e95565b6114195760405162461bcd60e51b8152600401610c6190613a5a565b61137284848484612403565b610a29611430611e95565b8383612437565b60ff546001600160a01b031690565b61144e611e95565b6001600160a01b031661145f611378565b6001600160a01b0316148061147a575061147a61049f611e95565b6114965760405162461bcd60e51b8152600401610c6190613ad0565b610d576000805160206140bf83398151915282612285565b610a296114b9611e95565b8383611a40565b6114cc85858584612517565b60006114d88686611d82565b6000908152610103602090815260408083208151606081018352978852878301968752439188019182528054600181810183559185529290932096516003909202909601908155935190840155505090516002909101555050565b60008061153e611437565b90506001600160a01b03811661155657600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b89190613b87565b91505090565b600054610100900460ff166115e55760405162461bcd60e51b8152600401610c6190613a85565b6116046000805160206140bf8339815191526115ff611e95565b611ff2565b61161c6000805160206140bf83398151915286611ff2565b6116346000805160206140bf83398151915287611ff2565b61163d826116b3565b61010061164a8582613bea565b506101016116588482613bea565b5060ff80546001600160a01b038084166001600160a01b031992831617909255610102805492881692909116919091179055611692611e95565b6001600160a01b0316866001600160a01b031614610ce757610ce7866119ca565b6116bb611e95565b6001600160a01b03166116cc611378565b6001600160a01b031614806116e757506116e761049f611e95565b6117035760405162461bcd60e51b8152600401610c6190613ad0565b60fe610a298282613bea565b61171882610c74565b611721816121ed565b610e2a8383612285565b606060fe805461173a9061399c565b80601f01602080910402602001604051908101604052809291908181526020018280546117669061399c565b80156117b35780601f10611788576101008083540402835291602001916117b3565b820191906000526020600020905b81548152906001019060200180831161179657829003601f168201915b5050505050905090565b6001600160a01b03808316600090815260986020908152604080832093851683529290529081205460ff1680610a005750610a0082611298565b606061010360006118088585611d82565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156118865783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611836565b50505050905092915050565b606060006118a08484611d82565b60008181526101036020526040812054919250906001600160401b038111156118cb576118cb613110565b6040519080825280602002602001820160405280156118f4578160200160208202803683370190505b50905060005b600083815261010360205260409020548110156107cc5760008381526101036020526040902080548290811061193257611932613944565b90600052602060002090600302016002015482828151811061195657611956613944565b60209081029190910101528061196b81613983565b9150506118fa565b61197b611e95565b6001600160a01b0316856001600160a01b031614806119a157506119a185610617611e95565b6119bd5760405162461bcd60e51b8152600401610c6190613b39565b610e0785858585856127ee565b6119d2611e26565b6001600160a01b038116611a375760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c61565b610d5781612319565b80611a4b8484612923565b1015611aa55760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610c61565b611ab061049f611e95565b80611ad35750611abe611e95565b6001600160a01b0316836001600160a01b0316145b80611ae55750611ae583610617611e95565b611b435760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610c61565b600082815260fc602052604081206001018054839290611b64908490613ca9565b9091555050610102546001600160a01b031663bb794d9283611b84611e95565b8443604051602001611b999493929190613cd3565b604051602081830303815290604052805190602001208460001b611bbb611e95565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b8152600401611bfb9493929190613d0f565b6020604051808303816000875af1158015611c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3e91906139d6565b506000611c4b8484611d82565b90508160005b60008381526101036020526040902054811015610ce757600083815261010360205260409020805482908110611c8957611c89613944565b9060005260206000209060030201600001548211611cf057600083815261010360205260409020805483919083908110611cc557611cc5613944565b90600052602060002090600302016000016000828254611ce59190613ca9565b90915550610ce79050565b600083815261010360205260409020805482908110611d1157611d11613944565b90600052602060002090600302016000015482611d2e9190613ca9565b60008481526101036020526040902080549193509082908110611d5357611d53613944565b600091825260208220600390910201818155600181018290556002015580611d7a81613983565b915050611c51565b60008282604051602001611d9792919061341e565b60405160208183030381529060405280519060200120905092915050565b60006001600160e01b03198216637965db0b60e01b14806107d157506107d1825b60006001600160e01b03198216636cdb3d1360e11b1480611e0757506001600160e01b031982166303a24d0760e21b145b806107d157506301ffc9a760e01b6001600160e01b03198316146107d1565b611e2e611e95565b6001600160a01b0316611e3f611378565b6001600160a01b031614610ed85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c61565b6000611e9f6129b6565b905090565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611f395760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610c61565b919050565b600082815260fc60205260409020805460ff19166001178155600301610e2a8282613bea565b600054610100900460ff16610ed85760405162461bcd60e51b8152600401610c6190613a85565b600054610100900460ff16611fb25760405162461bcd60e51b8152600401610c6190613a85565b610d57816129e4565b600054610100900460ff16611fe25760405162461bcd60e51b8152600401610c6190613a85565b610ed8611fed611e95565b612319565b610a2982826121fe565b815183511461205e5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610c61565b6001600160a01b0384166120845760405162461bcd60e51b8152600401610c6190613d4f565b600061208e611e95565b905061209e8187878787876129f0565b60005b84518110156121875760008582815181106120be576120be613944565b6020026020010151905060008583815181106120dc576120dc613944565b60209081029190910181015160008481526097835260408082206001600160a01b038e16835290935291909120549091508181101561212d5760405162461bcd60e51b8152600401610c6190613d94565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061216c908490613970565b925050819055505050508061218090613983565b90506120a1565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516121d7929190613dde565b60405180910390a4610ce7818787878787612a57565b610d57816121f9611e95565b612bb9565b6122088282611387565b610a2957600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612241611e95565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61228f8282611387565b15610a2957600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556122c6611e95565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b03163b151590565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156123bb5760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610c61565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b600084815260fc60205260409020805460ff191660019081178255810184905560028101839055600301610e078282613bea565b816001600160a01b0316836001600160a01b0316036124aa5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610c61565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61252261049f611e95565b806125455750612530611378565b6001600160a01b0316846001600160a01b0316145b806125d5575061010254604051631b0bbd4960e21b8152600481018590526001600160a01b0390911690636c2ef52490602401602060405180830381865afa158015612595573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b99190613b87565b6001600160a01b03166125ca611e95565b6001600160a01b0316145b61261a5760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481bdc195c985d1bdc8818d85b881b5a5b9d60521b6044820152606401610c61565b600083815260fc602052604090205460ff1661266e5760405162461bcd60e51b8152602060048201526013602482015272139195081b9bdd081a5b9a5d1a585b1a5e9959606a1b6044820152606401610c61565b600083815260fc6020526040902060020154156126e657600083815260fc6020526040902060028101546001909101546126a9908490613970565b11156126e65760405162461bcd60e51b815260206004820152600c60248201526b10d85c08195e18d95959195960a21b6044820152606401610c61565b600083815260fc602052604081206001018054849290612707908490613970565b9091555050610102546001600160a01b031663bb794d9284612727611e95565b854360405160200161273c9493929190613e23565b604051602081830303815290604052805190602001208560001b61275e611e95565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161279e9493929190613e4c565b6020604051808303816000875af11580156127bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e191906139d6565b5061137284848484612c12565b6001600160a01b0384166128145760405162461bcd60e51b8152600401610c6190613d4f565b600061281e611e95565b9050600061282b85612d27565b9050600061283885612d27565b90506128488389898585896129f0565b60008681526097602090815260408083206001600160a01b038c1684529091529020548581101561288b5760405162461bcd60e51b8152600401610c6190613d94565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906128ca908490613970565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816916000805160206140df833981519152910160405180910390a4612918848a8a8a8a8a612d72565b505050505050505050565b60006001600160a01b03831661298e5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610c61565b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b6000601436108015906129cd57506129cd33611224565b156129df575060131936013560601c90565b503390565b6099610a298282613bea565b6001600160a01b0385161580612a0d57506001600160a01b038416155b80612a1e5750612a1e61049f611e95565b610ce75760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610c61565b612a69846001600160a01b031661230a565b15610ce75760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612aa29089908990889088908890600401613e8c565b6020604051808303816000875af1925050508015612add575060408051601f3d908101601f19168201909252612ada91810190613eea565b60015b612b8957612ae9613f07565b806308c379a003612b225750612afd613f22565b80612b085750612b24565b8060405162461bcd60e51b8152600401610c6191906130c2565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610c61565b6001600160e01b0319811663bc197c8160e01b14610ff55760405162461bcd60e51b8152600401610c6190613fab565b612bc38282611387565b610a2957612bd081612e34565b612bdb836020612e46565b604051602001612bec929190613ff3565b60408051601f198184030181529082905262461bcd60e51b8252610c61916004016130c2565b6001600160a01b038416612c725760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610c61565b6000612c7c611e95565b90506000612c8985612d27565b90506000612c9685612d27565b9050612ca7836000898585896129f0565b60008681526097602090815260408083206001600160a01b038b16845290915281208054879290612cd9908490613970565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716916000805160206140df833981519152910160405180910390a4610ff583600089898989612d72565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612d6157612d61613944565b602090810291909101015292915050565b612d84846001600160a01b031661230a565b15610ce75760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612dbd9089908990889088908890600401614062565b6020604051808303816000875af1925050508015612df8575060408051601f3d908101601f19168201909252612df591810190613eea565b60015b612e0457612ae9613f07565b6001600160e01b0319811663f23a6e6160e01b14610ff55760405162461bcd60e51b8152600401610c6190613fab565b60606107d16001600160a01b03831660145b60606000612e55836002613b00565b612e60906002613970565b6001600160401b03811115612e7757612e77613110565b6040519080825280601f01601f191660200182016040528015612ea1576020820181803683370190505b509050600360fc1b81600081518110612ebc57612ebc613944565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612eeb57612eeb613944565b60200101906001600160f81b031916908160001a9053506000612f0f846002613b00565b612f1a906001613970565b90505b6001811115612f92576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612f4e57612f4e613944565b1a60f81b828281518110612f6457612f64613944565b60200101906001600160f81b031916908160001a90535060049490941c93612f8b816140a7565b9050612f1d565b508315610a005760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c61565b6001600160a01b0381168114610d5757600080fd5b6000806040838503121561300957600080fd5b823561301481612fe1565b946020939093013593505050565b6001600160e01b031981168114610d5757600080fd5b60006020828403121561304a57600080fd5b8135610a0081613022565b60006020828403121561306757600080fd5b8135610a0081612fe1565b60005b8381101561308d578181015183820152602001613075565b50506000910152565b600081518084526130ae816020860160208601613072565b601f01601f19169290920160200192915050565b602081526000610a006020830184613096565b6000602082840312156130e757600080fd5b5035919050565b6000806040838503121561310157600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561314b5761314b613110565b6040525050565b600082601f83011261316357600080fd5b81356001600160401b0381111561317c5761317c613110565b604051613193601f8301601f191660200182613126565b8181528460208386010111156131a857600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b038211156131de576131de613110565b5060051b60200190565b600082601f8301126131f957600080fd5b81356020613206826131c5565b6040516132138282613126565b83815260059390931b850182019282810191508684111561323357600080fd5b8286015b8481101561325757803561324a81612fe1565b8352918301918301613237565b509695505050505050565b6000806000806080858703121561327857600080fd5b84356001600160401b038082111561328f57600080fd5b61329b88838901613152565b955060208701359150808211156132b157600080fd5b6132bd88838901613152565b945060408701359150808211156132d357600080fd5b6132df88838901613152565b935060608701359150808211156132f557600080fd5b50613302878288016131e8565b91505092959194509250565b6001600160a01b0391909116815260200190565b6000806040838503121561333557600080fd5b8235915060208301356001600160401b0381111561335257600080fd5b610da685828601613152565b60008060008060008060c0878903121561337757600080fd5b863561338281612fe1565b9550602087013561339281612fe1565b945060408701356001600160401b03808211156133ae57600080fd5b6133ba8a838b01613152565b955060608901359150808211156133d057600080fd5b6133dc8a838b01613152565b945060808901359150808211156133f257600080fd5b506133ff89828a01613152565b92505060a087013561341081612fe1565b809150509295509295509295565b6001600160a01b03929092168252602082015260400190565b600082601f83011261344857600080fd5b81356020613455826131c5565b6040516134628282613126565b83815260059390931b850182019282810191508684111561348257600080fd5b8286015b848110156132575780358352918301918301613486565b600080600080600060a086880312156134b557600080fd5b85356134c081612fe1565b945060208601356134d081612fe1565b935060408601356001600160401b03808211156134ec57600080fd5b6134f889838a01613437565b9450606088013591508082111561350e57600080fd5b61351a89838a01613437565b9350608088013591508082111561353057600080fd5b5061353d88828901613152565b9150509295509295909350565b6000806040838503121561355d57600080fd5b82359150602083013561356f81612fe1565b809150509250929050565b84151581528360208201528260408201526080606082015260006135a16080830184613096565b9695505050505050565b600080604083850312156135be57600080fd5b82356001600160401b03808211156135d557600080fd5b6135e1868387016131e8565b935060208501359150808211156135f757600080fd5b50610da685828601613437565b600081518084526020808501945080840160005b8381101561363457815187529582019590820190600101613618565b509495945050505050565b602081526000610a006020830184613604565b60006020828403121561366457600080fd5b81356001600160401b0381111561367a57600080fd5b61368684828501613437565b949350505050565b600080600080608085870312156136a457600080fd5b84356136af81612fe1565b9350602085013592506040850135915060608501356001600160401b038111156136d857600080fd5b61330287828801613152565b6000806000606084860312156136f957600080fd5b83359250602084013561370b81612fe1565b929592945050506040919091013590565b6000806000806080858703121561373257600080fd5b84359350602085013592506040850135915060608501356001600160401b038111156136d857600080fd5b8015158114610d5757600080fd5b6000806040838503121561377e57600080fd5b823561378981612fe1565b9150602083013561356f8161375d565b600080600080600060a086880312156137b157600080fd5b85356137bc81612fe1565b945060208601359350604086013592506060860135915060808601356001600160401b038111156137ec57600080fd5b61353d88828901613152565b60006020828403121561380a57600080fd5b81356001600160401b0381111561382057600080fd5b61368684828501613152565b6000806040838503121561383f57600080fd5b823561384a81612fe1565b9150602083013561356f81612fe1565b602080825282518282018190526000919060409081850190868401855b828110156138a65781518051855286810151878601528501518585015260609093019290850190600101613877565b5091979650505050505050565b600080600080600060a086880312156138cb57600080fd5b85356138d681612fe1565b945060208601356138e681612fe1565b9350604086013592506060860135915060808601356001600160401b038111156137ec57600080fd5b60008060006060848603121561392457600080fd5b833561392f81612fe1565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107d1576107d161395a565b6000600182016139955761399561395a565b5060010190565b600181811c908216806139b057607f821691505b6020821081036139d057634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156139e857600080fd5b8151610a008161375d565b600060018060a01b038089168352808816602084015260c06040840152613a1d60c0840188613096565b8381036060850152613a2f8188613096565b90508381036080850152613a438187613096565b92505080841660a084015250979650505050505050565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176107d1576107d161395a565b600082613b3457634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215613b9957600080fd5b8151610a0081612fe1565b601f821115610e2a57600081815260208120601f850160051c81016020861015613bcb5750805b601f850160051c820191505b81811015610ce757828155600101613bd7565b81516001600160401b03811115613c0357613c03613110565b613c1781613c11845461399c565b84613ba4565b602080601f831160018114613c4c5760008415613c345750858301515b600019600386901b1c1916600185901b178555610ce7565b600085815260208120601f198616915b82811015613c7b57888601518255948401946001909101908401613c5c565b5085821015613c995787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b818103818111156107d1576107d161395a565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613cfc908301613cbc565b6060830194909452506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006135a160e08301613cbc565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000613df16040830185613604565b8281036020840152613e038185613604565b95945050505050565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a060408201819052600090613cfc908301613e0c565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a082015260006135a160e08301613e0c565b6001600160a01b0386811682528516602082015260a060408201819052600090613eb890830186613604565b8281036060840152613eca8186613604565b90508281036080840152613ede8185613096565b98975050505050505050565b600060208284031215613efc57600080fd5b8151610a0081613022565b600060033d111561047b5760046000803e5060005160e01c90565b600060443d1015613f305790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715613f5f57505050505090565b8285019150815181811115613f775750505050505090565b843d8701016020828501011115613f915750505050505090565b613fa060208286010187613126565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351614025816017850160208801613072565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614056816028840160208801613072565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061409c90830184613096565b979650505050505050565b6000816140b6576140b661395a565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220beab2849bd54f0139083786066aa84d0ce0e561a0871f33b6df7da536886a9d464736f6c63430008110033", + "address": "0x4D6cbf3168044aB6cBd851838a236f2FE8cD02DA", + "implementation": "0xc16f804964A685B0B7E9aE9accb4943A4bB92B58", + "version": "v3.5.0", + "libraries": {} +} \ No newline at end of file diff --git a/test/resources/artifacts/NFT721SubscriptionUpgradeable.json b/test/resources/artifacts/NFT721SubscriptionUpgradeable.json index b5c435416..f48f20684 100644 --- a/test/resources/artifacts/NFT721SubscriptionUpgradeable.json +++ b/test/resources/artifacts/NFT721SubscriptionUpgradeable.json @@ -1,7 +1,5 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "NFT721SubscriptionUpgradeable", - "sourceName": "contracts/token/erc721/NFT721SubscriptionUpgradeable.sol", + "name": "NFT721SubscriptionUpgradeable", "abi": [ { "anonymous": false, @@ -221,7 +219,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xa217fddf" }, { "inputs": [], @@ -234,7 +233,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x85be5724" }, { "inputs": [ @@ -253,7 +253,8 @@ } ], "stateMutability": "pure", - "type": "function" + "type": "function", + "signature": "0x82c947b7" }, { "inputs": [ @@ -271,7 +272,8 @@ "name": "approve", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x095ea7b3" }, { "inputs": [ @@ -290,7 +292,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x70a08231" }, { "inputs": [ @@ -303,7 +306,8 @@ "name": "burn", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x42966c68" }, { "inputs": [ @@ -322,7 +326,8 @@ } ], "stateMutability": "pure", - "type": "function" + "type": "function", + "signature": "0x5ced058e" }, { "inputs": [ @@ -341,7 +346,8 @@ } ], "stateMutability": "pure", - "type": "function" + "type": "function", + "signature": "0x5ea3ab85" }, { "inputs": [], @@ -354,7 +360,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xe8a3d485" }, { "inputs": [ @@ -393,7 +400,8 @@ } ], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x05a14872" }, { "inputs": [ @@ -412,7 +420,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x081812fc" }, { "inputs": [], @@ -425,7 +434,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x6fd902e1" }, { "inputs": [], @@ -438,7 +448,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x22e8e1e0" }, { "inputs": [ @@ -474,7 +485,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xcbd5a40e" }, { "inputs": [ @@ -508,7 +520,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x47c4ef25" }, { "inputs": [], @@ -521,7 +534,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xab9de230" }, { "inputs": [ @@ -540,7 +554,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x248a9ca3" }, { "inputs": [], @@ -553,7 +568,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xce1b815f" }, { "inputs": [ @@ -566,7 +582,8 @@ "name": "grantOperatorRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x27ac0c58" }, { "inputs": [ @@ -584,7 +601,28 @@ "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x2f2ff15d" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "hasNVMOperatorRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function", + "signature": "0x108762d0" }, { "inputs": [ @@ -608,7 +646,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x91d14854" }, { "inputs": [ @@ -644,14 +683,15 @@ }, { "internalType": "address", - "name": "nvmConfig", + "name": "nvmConfig_", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xdd152002" }, { "inputs": [ @@ -675,7 +715,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xe985e9c5" }, { "inputs": [ @@ -694,7 +735,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x16279055" }, { "inputs": [ @@ -713,7 +755,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x6d70f7ae" }, { "inputs": [ @@ -732,7 +775,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x572b6c05" }, { "inputs": [ @@ -755,7 +799,8 @@ "name": "mint", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x156e29f6" }, { "inputs": [ @@ -773,7 +818,8 @@ "name": "mint", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x40c10f19" }, { "inputs": [ @@ -786,7 +832,8 @@ "name": "mint", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xa0712d68" }, { "inputs": [], @@ -799,7 +846,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x06fdde03" }, { "inputs": [], @@ -812,7 +860,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x6fac889b" }, { "inputs": [], @@ -825,7 +874,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xe9c1e045" }, { "inputs": [], @@ -838,7 +888,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x8da5cb5b" }, { "inputs": [ @@ -857,21 +908,24 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x6352211e" }, { "inputs": [], "name": "renounceOperatorRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x3d6d3598" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x715018a6" }, { "inputs": [ @@ -889,7 +943,8 @@ "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x36568abe" }, { "inputs": [ @@ -902,7 +957,8 @@ "name": "revokeOperatorRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xb219f7d7" }, { "inputs": [ @@ -920,7 +976,8 @@ "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xd547741f" }, { "inputs": [ @@ -949,7 +1006,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x2a55205a" }, { "inputs": [ @@ -972,7 +1030,8 @@ "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x42842e0e" }, { "inputs": [ @@ -1000,7 +1059,8 @@ "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xb88d4fde" }, { "inputs": [ @@ -1018,7 +1078,8 @@ "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xa22cb465" }, { "inputs": [ @@ -1031,7 +1092,8 @@ "name": "setContractMetadataUri", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xd2423105" }, { "inputs": [ @@ -1049,7 +1111,8 @@ "name": "setNFTMetadata", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x237c4919" }, { "inputs": [ @@ -1062,7 +1125,8 @@ "name": "setNvmConfigAddress", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x02acb9a6" }, { "inputs": [ @@ -1085,7 +1149,8 @@ "name": "setTokenRoyalty", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x9713c807" }, { "inputs": [ @@ -1104,7 +1169,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x01ffc9a7" }, { "inputs": [], @@ -1117,7 +1183,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0x95d89b41" }, { "inputs": [ @@ -1136,7 +1203,8 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xc87b56dd" }, { "inputs": [ @@ -1159,7 +1227,8 @@ "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0x23b872dd" }, { "inputs": [ @@ -1172,7 +1241,8 @@ "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "signature": "0xf2fde38b" }, { "inputs": [ @@ -1191,11 +1261,13 @@ } ], "stateMutability": "view", - "type": "function" + "type": "function", + "signature": "0xe271d9ee" } ], - "bytecode": "0x608060405234801561001057600080fd5b5061390d806100206000396000f3fe608060405234801561001057600080fd5b50600436106102675760003560e01c806301ffc9a71461026c57806302acb9a61461029457806305a14872146102a957806306fdde03146102c9578063081812fc146102de578063095ea7b3146102f1578063156e29f614610304578063162790551461031757806322e8e1e01461032b578063237c49191461034157806323b872dd14610354578063248a9ca31461036757806327ac0c581461037a5780632a55205a1461038d5780632f2ff15d146103bf57806336568abe146103d25780633d6d3598146103e557806340c10f19146103ed57806342842e0e1461040057806342966c681461041357806347c4ef2514610426578063572b6c05146104495780635ced058e1461045c5780635ea3ab851461046d5780636352211e146104805780636d70f7ae146104935780636fac889b146104a65780636fd902e1146104cd57806370a08231146104d3578063715018a6146104e657806382c947b7146104ee57806385be5724146105085780638da5cb5b1461051d57806391d148541461052557806395d89b41146105385780639713c80714610540578063a0712d6814610553578063a217fddf14610566578063a22cb4651461056e578063ab9de23014610581578063b219f7d714610589578063b88d4fde1461059c578063c87b56dd146105af578063cbd5a40e146105c2578063ce1b815f146105e2578063d2423105146105ea578063d547741f146105fd578063ded96d4814610610578063e271d9ee14610623578063e8a3d48514610643578063e985e9c51461064b578063e9c1e0451461065e578063f2fde38b14610671575b600080fd5b61027f61027a366004612a92565b610684565b60405190151581526020015b60405180910390f35b6102a76102a2366004612ac4565b6106bf565b005b6102bc6102b7366004612bc1565b6106e9565b60405161028b9190612cda565b6102d16108f2565b60405161028b9190612d3e565b6102bc6102ec366004612d51565b610984565b6102a76102ff366004612d6a565b6109ab565b6102a7610312366004612d96565b610ad7565b61027f610325366004612ac4565b3b151590565b610333610b6e565b60405190815260200161028b565b6102a761034f366004612dcb565b610b7f565b6102a7610362366004612e07565b610bb4565b610333610375366004612d51565b610bec565b6102a7610388366004612ac4565b610c01565b6103a061039b366004612e48565b610c6c565b604080516001600160a01b03909316835260208301919091520161028b565b6102a76103cd366004612e6a565b610cc2565b6102a76103e0366004612e6a565b610cde565b6102a7610d68565b6102a76103fb366004612d6a565b610d89565b6102a761040e366004612e07565b610f84565b6102a7610421366004612d51565b610f9f565b610439610434366004612d51565b61123d565b60405161028b9493929190612e9a565b61027f610457366004612ac4565b61133a565b6102bc61046a366004612d51565b90565b61033361047b366004612ecb565b61135f565b6102bc61048e366004612d51565b6113ae565b61027f6104a1366004612ac4565b6113e2565b6103337f3cf8e80a7a55dd870201fe38c468fe694473dbe8d59a63381f1da07dc1c2b65581565b43610333565b6103336104e1366004612ac4565b6113fc565b6102a7611515565b6103336104fc366004612ac4565b6001600160a01b031690565b61033360008051602061389883398151915281565b6102bc611527565b61027f610533366004612e6a565b611536565b6102d1611561565b6102a761054e366004612f5b565b611570565b6102a7610561366004612d51565b6115a2565b610333600081565b6102a761057c366004612f90565b6115b3565b6102bc6115c5565b6102a7610597366004612ac4565b6115d4565b6102a76105aa366004612fbe565b61163c565b6102d16105bd366004612d51565b61167b565b6105d56105d0366004612ac4565b61171c565b60405161028b919061303d565b6102bc6117b0565b6102a76105f8366004613096565b61183b565b6102a761060b366004612e6a565b611897565b6102a761061e3660046130ca565b6118b3565b610636610631366004612ac4565b6119d7565b60405161028b919061317f565b6102d1611ac8565b61027f6106593660046131c3565b611ad7565b60ff546102bc906001600160a01b031681565b6102a761067f366004612ac4565b611b11565b600061068f82611b87565b8061069e575061069e82611ba8565b806106b957506001600160e01b0319821663152a902d60e11b145b92915050565b6106c7611bf8565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b03168061071f5750305b600061072a82611c67565b9050806001600160a01b03811663ded96d48610744611d01565b610101546040516001600160e01b031960e085901b16815261077b92916001600160a01b0316908e908e908e908e906004016131f1565b600060405180830381600087803b15801561079557600080fd5b505af11580156107a9573d6000803e3d6000fd5b5050505060005b855181101561084357816001600160a01b03166327ac0c588783815181106107da576107da613257565b60200260200101516040518263ffffffff1660e01b81526004016107fe9190612cda565b600060405180830381600087803b15801561081857600080fd5b505af115801561082c573d6000803e3d6000fd5b50505050808061083b90613283565b9150506107b0565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561087f57600080fd5b505af1158015610893573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d16040516108de91815260200190565b60405180910390a350979650505050505050565b6060609780546109019061329c565b80601f016020809104026020016040519081016040528092919081815260200182805461092d9061329c565b801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050905090565b600061098f82611d0b565b506000908152609b60205260409020546001600160a01b031690565b60006109b6826113ae565b9050806001600160a01b0316836001600160a01b031603610a285760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a3a611d01565b6001600160a01b03161480610a565750610a5681610659611d01565b610ac85760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610a1f565b610ad28383611d30565b505050565b610ae18383610d89565b600160fc60008481526020019081526020016000206001016000828254610b0891906132d0565b90915550506001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610b7a6101025490565b905090565b610b8a6104a1611d01565b610ba65760405162461bcd60e51b8152600401610a1f906132e3565b610bb08282611d9e565b5050565b610bc5610bbf611d01565b82611dc4565b610be15760405162461bcd60e51b8152600401610a1f9061330e565b610ad2838383611e23565b600090815260c9602052604090206001015490565b610c09611d01565b6001600160a01b0316610c1a611527565b6001600160a01b03161480610c355750610c356104a1611d01565b610c515760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282611f82565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610cae908661338b565b610cb891906133a2565b9150509250929050565b610ccb82610bec565b610cd481611f8c565b610ad28383611f9d565b610ce6611d01565b6001600160a01b0316816001600160a01b031614610d5e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a1f565b610bb08282612024565b610d87600080516020613898833981519152610d82611d01565b612024565b565b610d946104a1611d01565b80610db75750610da2611527565b6001600160a01b0316826001600160a01b0316145b610e005760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b6044820152606401610a1f565b610100541580610e1557506101005461010254105b610e565760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b6044820152606401610a1f565b610e6561010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610ea2908261340a565b50610101546001600160a01b031663bb794d9282610ebe611d01565b600143604051602001610ed494939291906134e0565b604051602081830303815290604052805190602001208360001b610ef6611d01565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b8152600401610f36949392919061351f565b6020604051808303816000875af1158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f79919061355f565b50610bb082826120a9565b610ad28383836040518060200160405280600081525061163c565b610faa6104a1611d01565b80610fd55750610fb8611d01565b6001600160a01b0316610fca826113ae565b6001600160a01b0316145b6110395760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b6064820152608401610a1f565b600160fc60008381526020019081526020016000206001016000828254611060919061357c565b9091555050610101546001600160a01b031663bb794d9282611080611d01565b60014360405160200161109694939291906135a6565b604051602081830303815290604052805190602001208360001b6110b8611d01565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b81526004016110f894939291906135cf565b6020604051808303816000875af1158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b919061355f565b50611145816121b2565b60005b6101036000611155611d01565b6001600160a01b03168152602081019190915260400160002054811015610bb057816101036000611184611d01565b6001600160a01b03166001600160a01b0316815260200190815260200160002082815481106111b5576111b5613257565b9060005260206000209060030201600001540361122b5761010360006111d9611d01565b6001600160a01b03166001600160a01b03168152602001908152602001600020818154811061120a5761120a613257565b60009182526020822060039091020181815560018101829055600201555050565b8061123581613283565b915050611148565b600081815260fc602090815260408083208151608081018352815460ff161515815260018201549381019390935260028101549183019190915260038101805484938493606093859383860191906112949061329c565b80601f01602080910402602001604051908101604052809291908181526020018280546112c09061329c565b801561130d5780601f106112e25761010080835404028352916020019161130d565b820191906000526020600020905b8154815290600101906020018083116112f057829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b60006113446117b0565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b83518110156113a75783818151811061138057611380613257565b60200260200101518261139391906132d0565b91508061139f81613283565b915050611365565b5092915050565b6000806113ba83612243565b90506001600160a01b0381166106b95760405162461bcd60e51b8152600401610a1f9061360f565b60006106b960008051602061389883398151915283611536565b60008060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b03841660009081526101036020526040812080548390811061144e5761144e613257565b9060005260206000209060030201600201541180156114f057506001600160a01b03841660009081526101036020526040902080548290811061149357611493613257565b906000526020600020906003020160010154600014806114f057506001600160a01b0384166000908152610103602052604090208054439190839081106114dc576114dc613257565b906000526020600020906003020160010154115b15611503576115006001836132d0565b91505b8061150d81613283565b915050611402565b61151d611bf8565b610d87600061225e565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060609880546109019061329c565b61157b6104a1611d01565b6115975760405162461bcd60e51b8152600401610a1f906132e3565b610ad28383836122b0565b610c696115ad611d01565b82610d89565b610bb06115be611d01565b8383612348565b60ff546001600160a01b031690565b6115dc611d01565b6001600160a01b03166115ed611527565b6001600160a01b0316148061160857506116086104a1611d01565b6116245760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282612024565b61164d611647611d01565b83611dc4565b6116695760405162461bcd60e51b8152600401610a1f9061330e565b61167584848484612412565b50505050565b60606000611687612445565b90506116928361244f565b156116e75760008151116116b557604051806020016040528060008152506116e0565b806116bf8461246c565b6040516020016116d0929190613641565b6040516020818303038152906040525b9392505050565b600081511161170557604051806020016040528060008152506116e0565b806040516020016116d09190613670565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b828210156117a55783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611755565b505050509050919050565b6000806117bb6115c5565b90506001600160a01b0381166117d357600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611811573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611835919061368c565b91505090565b611843611d01565b6001600160a01b0316611854611527565b6001600160a01b0316148061186f575061186f6104a1611d01565b61188b5760405162461bcd60e51b8152600401610a1f9061335b565b60fe610bb0828261340a565b6118a082610bec565b6118a981611f8c565b610ad28383612024565b600054610100900460ff16158080156118d35750600054600160ff909116105b806118f457506118e230612483565b1580156118f4575060005460ff166001145b6119575760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a1f565b6000805460ff19166001179055801561197a576000805461ff0019166101001790555b611988878787878787612492565b80156119ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611a0c57611a0c612ae1565b604051908082528060200260200182016040528015611a35578160200160208202803683370190505b50905060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b038416600090815261010360205260409020805482908110611a8757611a87613257565b906000526020600020906003020160020154828281518110611aab57611aab613257565b602090810291909101015280611ac081613283565b915050611a3b565b606060fe80546109019061329c565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff16806116e057506116e0826113e2565b611b19611bf8565b6001600160a01b038116611b7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a1f565b610c698161225e565b60006001600160e01b03198216637965db0b60e01b14806106b957506106b9825b60006001600160e01b031982166380ac58cd60e01b1480611bd957506001600160e01b03198216635b5e139f60e01b145b806106b957506301ffc9a760e01b6001600160e01b03198316146106b9565b611c00611d01565b6001600160a01b0316611c11611527565b6001600160a01b031614610d875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1f565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611cfc5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610a1f565b919050565b6000610b7a6124f7565b611d148161244f565b610c695760405162461bcd60e51b8152600401610a1f9061360f565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d65826113ae565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610ad2828261340a565b600080611dd0836113ae565b9050806001600160a01b0316846001600160a01b03161480611df75750611df78185611ad7565b80611e1b5750836001600160a01b0316611e1084610984565b6001600160a01b0316145b949350505050565b826001600160a01b0316611e36826113ae565b6001600160a01b031614611e5c5760405162461bcd60e51b8152600401610a1f906136a9565b6001600160a01b038216611ebe5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a1f565b611ecb8383836001612525565b826001600160a01b0316611ede826113ae565b6001600160a01b031614611f045760405162461bcd60e51b8152600401610a1f906136a9565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184936000805160206138b883398151915291a4505050565b610bb08282611f9d565b610c6981611f98611d01565b612591565b611fa78282611536565b610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611fe0611d01565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61202e8282611536565b15610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19169055612065611d01565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166120ff5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a1f565b6121088161244f565b156121255760405162461bcd60e51b8152600401610a1f906136ee565b612133600083836001612525565b61213c8161244f565b156121595760405162461bcd60e51b8152600401610a1f906136ee565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291906000805160206138b8833981519152908290a45050565b60006121bd826113ae565b90506121cd816000846001612525565b6121d6826113ae565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a845282852080546000190190558785526099909352818420805490911690555192935084926000805160206138b8833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156123005760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610a1f565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036123a55760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610a1f565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61241d848484611e23565b612429848484846125ea565b6116755760405162461bcd60e51b8152600401610a1f90613724565b6060610b7a611ac8565b60008061245b83612243565b6001600160a01b0316141592915050565b60606106b98261247b846126f9565b600101612763565b6001600160a01b03163b151590565b600054610100900460ff166124b95760405162461bcd60e51b8152600401610a1f90613776565b6124c16128fe565b6124c96128fe565b6124d38484612925565b6124db612965565b6124e36128fe565b6124ef8686848461299c565b505050505050565b60006014361080159061250e575061250e3361133a565b15612520575060131936013560601c90565b503390565b6001600160a01b038416158061254257506001600160a01b038316155b8061255357506125536104a1611d01565b61258c5760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610a1f565b611675565b61259b8282611536565b610bb0576125a881612a66565b6125b3836020612763565b6040516020016125c49291906137c1565b60408051601f198184030181529082905262461bcd60e51b8252610a1f91600401612d3e565b60006125fe846001600160a01b0316612483565b156126ee57836001600160a01b031663150b7a0261261a611d01565b8786866040518563ffffffff1660e01b815260040161263c9493929190613830565b6020604051808303816000875af1925050508015612677575060408051601f3d908101601f1916820190925261267491810190613863565b60015b6126d4573d8080156126a5576040519150601f19603f3d011682016040523d82523d6000602084013e6126aa565b606091505b5080516000036126cc5760405162461bcd60e51b8152600401610a1f90613724565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e1b565b506001949350505050565b600080608083901c156127115760809290921c916010015b604083901c156127265760409290921c916008015b602083901c1561273b5760209290921c916004015b601083901c156127505760109290921c916002015b600883901c156106b95760010192915050565b6060600061277283600261338b565b61277d9060026132d0565b6001600160401b0381111561279457612794612ae1565b6040519080825280601f01601f1916602001820160405280156127be576020820181803683370190505b509050600360fc1b816000815181106127d9576127d9613257565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061280857612808613257565b60200101906001600160f81b031916908160001a905350600061282c84600261338b565b6128379060016132d0565b90505b60018111156128af576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061286b5761286b613257565b1a60f81b82828151811061288157612881613257565b60200101906001600160f81b031916908160001a90535060049490941c936128a881613880565b905061283a565b5083156116e05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a1f565b600054610100900460ff16610d875760405162461bcd60e51b8152600401610a1f90613776565b600054610100900460ff1661294c5760405162461bcd60e51b8152600401610a1f90613776565b6097612958838261340a565b506098610ad2828261340a565b600054610100900460ff1661298c5760405162461bcd60e51b8152600401610a1f90613776565b610d87612997611d01565b61225e565b600054610100900460ff166129c35760405162461bcd60e51b8152600401610a1f90613776565b6129e26000805160206138988339815191526129dd611d01565b611f82565b6129fa60008051602061389883398151915284611f82565b612a1260008051602061389883398151915285611f82565b612a1b8261183b565b61010081905561010180546001600160a01b0319166001600160a01b038516179055612a45611d01565b6001600160a01b0316846001600160a01b0316146116755761167584611b11565b60606106b96001600160a01b0383166014612763565b6001600160e01b031981168114610c6957600080fd5b600060208284031215612aa457600080fd5b81356116e081612a7c565b6001600160a01b0381168114610c6957600080fd5b600060208284031215612ad657600080fd5b81356116e081612aaf565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612b1f57612b1f612ae1565b604052919050565b60006001600160401b03831115612b4057612b40612ae1565b612b53601f8401601f1916602001612af7565b9050828152838383011115612b6757600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b8f57600080fd5b6116e083833560208501612b27565b60006001600160401b03821115612bb757612bb7612ae1565b5060051b60200190565b600080600080600060a08688031215612bd957600080fd5b85356001600160401b0380821115612bf057600080fd5b612bfc89838a01612b7e565b9650602091508188013581811115612c1357600080fd5b612c1f8a828b01612b7e565b965050604088013581811115612c3457600080fd5b612c408a828b01612b7e565b95505060608801359350608088013581811115612c5c57600080fd5b88019050601f81018913612c6f57600080fd5b8035612c82612c7d82612b9e565b612af7565b81815260059190911b8201830190838101908b831115612ca157600080fd5b928401925b82841015612cc8578335612cb981612aaf565b82529284019290840190612ca6565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612d09578181015183820152602001612cf1565b50506000910152565b60008151808452612d2a816020860160208601612cee565b601f01601f19169290920160200192915050565b6020815260006116e06020830184612d12565b600060208284031215612d6357600080fd5b5035919050565b60008060408385031215612d7d57600080fd5b8235612d8881612aaf565b946020939093013593505050565b600080600060608486031215612dab57600080fd5b8335612db681612aaf565b95602085013595506040909401359392505050565b60008060408385031215612dde57600080fd5b8235915060208301356001600160401b03811115612dfb57600080fd5b610cb885828601612b7e565b600080600060608486031215612e1c57600080fd5b8335612e2781612aaf565b92506020840135612e3781612aaf565b929592945050506040919091013590565b60008060408385031215612e5b57600080fd5b50508035926020909101359150565b60008060408385031215612e7d57600080fd5b823591506020830135612e8f81612aaf565b809150509250929050565b8415158152836020820152826040820152608060608201526000612ec16080830184612d12565b9695505050505050565b60006020808385031215612ede57600080fd5b82356001600160401b03811115612ef457600080fd5b8301601f81018513612f0557600080fd5b8035612f13612c7d82612b9e565b81815260059190911b82018301908381019087831115612f3257600080fd5b928401925b82841015612f5057833582529284019290840190612f37565b979650505050505050565b600080600060608486031215612f7057600080fd5b833592506020840135612e3781612aaf565b8015158114610c6957600080fd5b60008060408385031215612fa357600080fd5b8235612fae81612aaf565b91506020830135612e8f81612f82565b60008060008060808587031215612fd457600080fd5b8435612fdf81612aaf565b93506020850135612fef81612aaf565b92506040850135915060608501356001600160401b0381111561301157600080fd5b8501601f8101871361302257600080fd5b61303187823560208401612b27565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b82811015613089578151805185528681015187860152850151858501526060909301929085019060010161305a565b5091979650505050505050565b6000602082840312156130a857600080fd5b81356001600160401b038111156130be57600080fd5b611e1b84828501612b7e565b60008060008060008060c087890312156130e357600080fd5b86356130ee81612aaf565b955060208701356130fe81612aaf565b945060408701356001600160401b038082111561311a57600080fd5b6131268a838b01612b7e565b9550606089013591508082111561313c57600080fd5b6131488a838b01612b7e565b9450608089013591508082111561315e57600080fd5b5061316b89828a01612b7e565b92505060a087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b818110156131b75783518352928401929184019160010161319b565b50909695505050505050565b600080604083850312156131d657600080fd5b82356131e181612aaf565b91506020830135612e8f81612aaf565b6001600160a01b0387811682528616602082015260c06040820181905260009061321d90830187612d12565b828103606084015261322f8187612d12565b905082810360808401526132438186612d12565b9150508260a0830152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016132955761329561326d565b5060010190565b600181811c908216806132b057607f821691505b60208210810361171657634e487b7160e01b600052602260045260246000fd5b808201808211156106b9576106b961326d565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106b9576106b961326d565b6000826133bf57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610ad257600081815260208120601f850160051c810160208610156133eb5750805b601f850160051c820191505b818110156124ef578281556001016133f7565b81516001600160401b0381111561342357613423612ae1565b61343781613431845461329c565b846133c4565b602080601f83116001811461346c57600084156134545750858301515b600019600386901b1c1916600185901b1785556124ef565b600085815260208120601f198616915b8281101561349b5788860151825594840194600190910190840161347c565b50858210156134b95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906135099083016134c9565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e083016134c9565b60006020828403121561357157600080fd5b81516116e081612f82565b818103818111156106b9576106b961326d565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a06040820181905260009061350990830161358f565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e0830161358f565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351613653818460208801612cee565b835190830190613667818360208801612cee565b01949350505050565b60008251613682818460208701612cee565b9190910192915050565b60006020828403121561369e57600080fd5b81516116e081612aaf565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516137f3816017850160208801612cee565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613824816028840160208801612cee565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ec190830184612d12565b60006020828403121561387557600080fd5b81516116e081612a7c565b60008161388f5761388f61326d565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122058d193dc4a89936faa0836b7c3c9846ab4945e4f6b027433eff0c9a6b5fe9f9a64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102675760003560e01c806301ffc9a71461026c57806302acb9a61461029457806305a14872146102a957806306fdde03146102c9578063081812fc146102de578063095ea7b3146102f1578063156e29f614610304578063162790551461031757806322e8e1e01461032b578063237c49191461034157806323b872dd14610354578063248a9ca31461036757806327ac0c581461037a5780632a55205a1461038d5780632f2ff15d146103bf57806336568abe146103d25780633d6d3598146103e557806340c10f19146103ed57806342842e0e1461040057806342966c681461041357806347c4ef2514610426578063572b6c05146104495780635ced058e1461045c5780635ea3ab851461046d5780636352211e146104805780636d70f7ae146104935780636fac889b146104a65780636fd902e1146104cd57806370a08231146104d3578063715018a6146104e657806382c947b7146104ee57806385be5724146105085780638da5cb5b1461051d57806391d148541461052557806395d89b41146105385780639713c80714610540578063a0712d6814610553578063a217fddf14610566578063a22cb4651461056e578063ab9de23014610581578063b219f7d714610589578063b88d4fde1461059c578063c87b56dd146105af578063cbd5a40e146105c2578063ce1b815f146105e2578063d2423105146105ea578063d547741f146105fd578063ded96d4814610610578063e271d9ee14610623578063e8a3d48514610643578063e985e9c51461064b578063e9c1e0451461065e578063f2fde38b14610671575b600080fd5b61027f61027a366004612a92565b610684565b60405190151581526020015b60405180910390f35b6102a76102a2366004612ac4565b6106bf565b005b6102bc6102b7366004612bc1565b6106e9565b60405161028b9190612cda565b6102d16108f2565b60405161028b9190612d3e565b6102bc6102ec366004612d51565b610984565b6102a76102ff366004612d6a565b6109ab565b6102a7610312366004612d96565b610ad7565b61027f610325366004612ac4565b3b151590565b610333610b6e565b60405190815260200161028b565b6102a761034f366004612dcb565b610b7f565b6102a7610362366004612e07565b610bb4565b610333610375366004612d51565b610bec565b6102a7610388366004612ac4565b610c01565b6103a061039b366004612e48565b610c6c565b604080516001600160a01b03909316835260208301919091520161028b565b6102a76103cd366004612e6a565b610cc2565b6102a76103e0366004612e6a565b610cde565b6102a7610d68565b6102a76103fb366004612d6a565b610d89565b6102a761040e366004612e07565b610f84565b6102a7610421366004612d51565b610f9f565b610439610434366004612d51565b61123d565b60405161028b9493929190612e9a565b61027f610457366004612ac4565b61133a565b6102bc61046a366004612d51565b90565b61033361047b366004612ecb565b61135f565b6102bc61048e366004612d51565b6113ae565b61027f6104a1366004612ac4565b6113e2565b6103337f3cf8e80a7a55dd870201fe38c468fe694473dbe8d59a63381f1da07dc1c2b65581565b43610333565b6103336104e1366004612ac4565b6113fc565b6102a7611515565b6103336104fc366004612ac4565b6001600160a01b031690565b61033360008051602061389883398151915281565b6102bc611527565b61027f610533366004612e6a565b611536565b6102d1611561565b6102a761054e366004612f5b565b611570565b6102a7610561366004612d51565b6115a2565b610333600081565b6102a761057c366004612f90565b6115b3565b6102bc6115c5565b6102a7610597366004612ac4565b6115d4565b6102a76105aa366004612fbe565b61163c565b6102d16105bd366004612d51565b61167b565b6105d56105d0366004612ac4565b61171c565b60405161028b919061303d565b6102bc6117b0565b6102a76105f8366004613096565b61183b565b6102a761060b366004612e6a565b611897565b6102a761061e3660046130ca565b6118b3565b610636610631366004612ac4565b6119d7565b60405161028b919061317f565b6102d1611ac8565b61027f6106593660046131c3565b611ad7565b60ff546102bc906001600160a01b031681565b6102a761067f366004612ac4565b611b11565b600061068f82611b87565b8061069e575061069e82611ba8565b806106b957506001600160e01b0319821663152a902d60e11b145b92915050565b6106c7611bf8565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b03168061071f5750305b600061072a82611c67565b9050806001600160a01b03811663ded96d48610744611d01565b610101546040516001600160e01b031960e085901b16815261077b92916001600160a01b0316908e908e908e908e906004016131f1565b600060405180830381600087803b15801561079557600080fd5b505af11580156107a9573d6000803e3d6000fd5b5050505060005b855181101561084357816001600160a01b03166327ac0c588783815181106107da576107da613257565b60200260200101516040518263ffffffff1660e01b81526004016107fe9190612cda565b600060405180830381600087803b15801561081857600080fd5b505af115801561082c573d6000803e3d6000fd5b50505050808061083b90613283565b9150506107b0565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561087f57600080fd5b505af1158015610893573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d16040516108de91815260200190565b60405180910390a350979650505050505050565b6060609780546109019061329c565b80601f016020809104026020016040519081016040528092919081815260200182805461092d9061329c565b801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050905090565b600061098f82611d0b565b506000908152609b60205260409020546001600160a01b031690565b60006109b6826113ae565b9050806001600160a01b0316836001600160a01b031603610a285760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a3a611d01565b6001600160a01b03161480610a565750610a5681610659611d01565b610ac85760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610a1f565b610ad28383611d30565b505050565b610ae18383610d89565b600160fc60008481526020019081526020016000206001016000828254610b0891906132d0565b90915550506001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610b7a6101025490565b905090565b610b8a6104a1611d01565b610ba65760405162461bcd60e51b8152600401610a1f906132e3565b610bb08282611d9e565b5050565b610bc5610bbf611d01565b82611dc4565b610be15760405162461bcd60e51b8152600401610a1f9061330e565b610ad2838383611e23565b600090815260c9602052604090206001015490565b610c09611d01565b6001600160a01b0316610c1a611527565b6001600160a01b03161480610c355750610c356104a1611d01565b610c515760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282611f82565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610cae908661338b565b610cb891906133a2565b9150509250929050565b610ccb82610bec565b610cd481611f8c565b610ad28383611f9d565b610ce6611d01565b6001600160a01b0316816001600160a01b031614610d5e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a1f565b610bb08282612024565b610d87600080516020613898833981519152610d82611d01565b612024565b565b610d946104a1611d01565b80610db75750610da2611527565b6001600160a01b0316826001600160a01b0316145b610e005760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b6044820152606401610a1f565b610100541580610e1557506101005461010254105b610e565760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b6044820152606401610a1f565b610e6561010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610ea2908261340a565b50610101546001600160a01b031663bb794d9282610ebe611d01565b600143604051602001610ed494939291906134e0565b604051602081830303815290604052805190602001208360001b610ef6611d01565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b8152600401610f36949392919061351f565b6020604051808303816000875af1158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f79919061355f565b50610bb082826120a9565b610ad28383836040518060200160405280600081525061163c565b610faa6104a1611d01565b80610fd55750610fb8611d01565b6001600160a01b0316610fca826113ae565b6001600160a01b0316145b6110395760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b6064820152608401610a1f565b600160fc60008381526020019081526020016000206001016000828254611060919061357c565b9091555050610101546001600160a01b031663bb794d9282611080611d01565b60014360405160200161109694939291906135a6565b604051602081830303815290604052805190602001208360001b6110b8611d01565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b81526004016110f894939291906135cf565b6020604051808303816000875af1158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b919061355f565b50611145816121b2565b60005b6101036000611155611d01565b6001600160a01b03168152602081019190915260400160002054811015610bb057816101036000611184611d01565b6001600160a01b03166001600160a01b0316815260200190815260200160002082815481106111b5576111b5613257565b9060005260206000209060030201600001540361122b5761010360006111d9611d01565b6001600160a01b03166001600160a01b03168152602001908152602001600020818154811061120a5761120a613257565b60009182526020822060039091020181815560018101829055600201555050565b8061123581613283565b915050611148565b600081815260fc602090815260408083208151608081018352815460ff161515815260018201549381019390935260028101549183019190915260038101805484938493606093859383860191906112949061329c565b80601f01602080910402602001604051908101604052809291908181526020018280546112c09061329c565b801561130d5780601f106112e25761010080835404028352916020019161130d565b820191906000526020600020905b8154815290600101906020018083116112f057829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b60006113446117b0565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b83518110156113a75783818151811061138057611380613257565b60200260200101518261139391906132d0565b91508061139f81613283565b915050611365565b5092915050565b6000806113ba83612243565b90506001600160a01b0381166106b95760405162461bcd60e51b8152600401610a1f9061360f565b60006106b960008051602061389883398151915283611536565b60008060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b03841660009081526101036020526040812080548390811061144e5761144e613257565b9060005260206000209060030201600201541180156114f057506001600160a01b03841660009081526101036020526040902080548290811061149357611493613257565b906000526020600020906003020160010154600014806114f057506001600160a01b0384166000908152610103602052604090208054439190839081106114dc576114dc613257565b906000526020600020906003020160010154115b15611503576115006001836132d0565b91505b8061150d81613283565b915050611402565b61151d611bf8565b610d87600061225e565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060609880546109019061329c565b61157b6104a1611d01565b6115975760405162461bcd60e51b8152600401610a1f906132e3565b610ad28383836122b0565b610c696115ad611d01565b82610d89565b610bb06115be611d01565b8383612348565b60ff546001600160a01b031690565b6115dc611d01565b6001600160a01b03166115ed611527565b6001600160a01b0316148061160857506116086104a1611d01565b6116245760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282612024565b61164d611647611d01565b83611dc4565b6116695760405162461bcd60e51b8152600401610a1f9061330e565b61167584848484612412565b50505050565b60606000611687612445565b90506116928361244f565b156116e75760008151116116b557604051806020016040528060008152506116e0565b806116bf8461246c565b6040516020016116d0929190613641565b6040516020818303038152906040525b9392505050565b600081511161170557604051806020016040528060008152506116e0565b806040516020016116d09190613670565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b828210156117a55783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611755565b505050509050919050565b6000806117bb6115c5565b90506001600160a01b0381166117d357600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611811573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611835919061368c565b91505090565b611843611d01565b6001600160a01b0316611854611527565b6001600160a01b0316148061186f575061186f6104a1611d01565b61188b5760405162461bcd60e51b8152600401610a1f9061335b565b60fe610bb0828261340a565b6118a082610bec565b6118a981611f8c565b610ad28383612024565b600054610100900460ff16158080156118d35750600054600160ff909116105b806118f457506118e230612483565b1580156118f4575060005460ff166001145b6119575760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a1f565b6000805460ff19166001179055801561197a576000805461ff0019166101001790555b611988878787878787612492565b80156119ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611a0c57611a0c612ae1565b604051908082528060200260200182016040528015611a35578160200160208202803683370190505b50905060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b038416600090815261010360205260409020805482908110611a8757611a87613257565b906000526020600020906003020160020154828281518110611aab57611aab613257565b602090810291909101015280611ac081613283565b915050611a3b565b606060fe80546109019061329c565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff16806116e057506116e0826113e2565b611b19611bf8565b6001600160a01b038116611b7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a1f565b610c698161225e565b60006001600160e01b03198216637965db0b60e01b14806106b957506106b9825b60006001600160e01b031982166380ac58cd60e01b1480611bd957506001600160e01b03198216635b5e139f60e01b145b806106b957506301ffc9a760e01b6001600160e01b03198316146106b9565b611c00611d01565b6001600160a01b0316611c11611527565b6001600160a01b031614610d875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1f565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611cfc5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610a1f565b919050565b6000610b7a6124f7565b611d148161244f565b610c695760405162461bcd60e51b8152600401610a1f9061360f565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d65826113ae565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610ad2828261340a565b600080611dd0836113ae565b9050806001600160a01b0316846001600160a01b03161480611df75750611df78185611ad7565b80611e1b5750836001600160a01b0316611e1084610984565b6001600160a01b0316145b949350505050565b826001600160a01b0316611e36826113ae565b6001600160a01b031614611e5c5760405162461bcd60e51b8152600401610a1f906136a9565b6001600160a01b038216611ebe5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a1f565b611ecb8383836001612525565b826001600160a01b0316611ede826113ae565b6001600160a01b031614611f045760405162461bcd60e51b8152600401610a1f906136a9565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184936000805160206138b883398151915291a4505050565b610bb08282611f9d565b610c6981611f98611d01565b612591565b611fa78282611536565b610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611fe0611d01565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61202e8282611536565b15610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19169055612065611d01565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166120ff5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a1f565b6121088161244f565b156121255760405162461bcd60e51b8152600401610a1f906136ee565b612133600083836001612525565b61213c8161244f565b156121595760405162461bcd60e51b8152600401610a1f906136ee565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291906000805160206138b8833981519152908290a45050565b60006121bd826113ae565b90506121cd816000846001612525565b6121d6826113ae565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a845282852080546000190190558785526099909352818420805490911690555192935084926000805160206138b8833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156123005760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610a1f565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036123a55760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610a1f565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61241d848484611e23565b612429848484846125ea565b6116755760405162461bcd60e51b8152600401610a1f90613724565b6060610b7a611ac8565b60008061245b83612243565b6001600160a01b0316141592915050565b60606106b98261247b846126f9565b600101612763565b6001600160a01b03163b151590565b600054610100900460ff166124b95760405162461bcd60e51b8152600401610a1f90613776565b6124c16128fe565b6124c96128fe565b6124d38484612925565b6124db612965565b6124e36128fe565b6124ef8686848461299c565b505050505050565b60006014361080159061250e575061250e3361133a565b15612520575060131936013560601c90565b503390565b6001600160a01b038416158061254257506001600160a01b038316155b8061255357506125536104a1611d01565b61258c5760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610a1f565b611675565b61259b8282611536565b610bb0576125a881612a66565b6125b3836020612763565b6040516020016125c49291906137c1565b60408051601f198184030181529082905262461bcd60e51b8252610a1f91600401612d3e565b60006125fe846001600160a01b0316612483565b156126ee57836001600160a01b031663150b7a0261261a611d01565b8786866040518563ffffffff1660e01b815260040161263c9493929190613830565b6020604051808303816000875af1925050508015612677575060408051601f3d908101601f1916820190925261267491810190613863565b60015b6126d4573d8080156126a5576040519150601f19603f3d011682016040523d82523d6000602084013e6126aa565b606091505b5080516000036126cc5760405162461bcd60e51b8152600401610a1f90613724565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e1b565b506001949350505050565b600080608083901c156127115760809290921c916010015b604083901c156127265760409290921c916008015b602083901c1561273b5760209290921c916004015b601083901c156127505760109290921c916002015b600883901c156106b95760010192915050565b6060600061277283600261338b565b61277d9060026132d0565b6001600160401b0381111561279457612794612ae1565b6040519080825280601f01601f1916602001820160405280156127be576020820181803683370190505b509050600360fc1b816000815181106127d9576127d9613257565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061280857612808613257565b60200101906001600160f81b031916908160001a905350600061282c84600261338b565b6128379060016132d0565b90505b60018111156128af576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061286b5761286b613257565b1a60f81b82828151811061288157612881613257565b60200101906001600160f81b031916908160001a90535060049490941c936128a881613880565b905061283a565b5083156116e05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a1f565b600054610100900460ff16610d875760405162461bcd60e51b8152600401610a1f90613776565b600054610100900460ff1661294c5760405162461bcd60e51b8152600401610a1f90613776565b6097612958838261340a565b506098610ad2828261340a565b600054610100900460ff1661298c5760405162461bcd60e51b8152600401610a1f90613776565b610d87612997611d01565b61225e565b600054610100900460ff166129c35760405162461bcd60e51b8152600401610a1f90613776565b6129e26000805160206138988339815191526129dd611d01565b611f82565b6129fa60008051602061389883398151915284611f82565b612a1260008051602061389883398151915285611f82565b612a1b8261183b565b61010081905561010180546001600160a01b0319166001600160a01b038516179055612a45611d01565b6001600160a01b0316846001600160a01b0316146116755761167584611b11565b60606106b96001600160a01b0383166014612763565b6001600160e01b031981168114610c6957600080fd5b600060208284031215612aa457600080fd5b81356116e081612a7c565b6001600160a01b0381168114610c6957600080fd5b600060208284031215612ad657600080fd5b81356116e081612aaf565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612b1f57612b1f612ae1565b604052919050565b60006001600160401b03831115612b4057612b40612ae1565b612b53601f8401601f1916602001612af7565b9050828152838383011115612b6757600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b8f57600080fd5b6116e083833560208501612b27565b60006001600160401b03821115612bb757612bb7612ae1565b5060051b60200190565b600080600080600060a08688031215612bd957600080fd5b85356001600160401b0380821115612bf057600080fd5b612bfc89838a01612b7e565b9650602091508188013581811115612c1357600080fd5b612c1f8a828b01612b7e565b965050604088013581811115612c3457600080fd5b612c408a828b01612b7e565b95505060608801359350608088013581811115612c5c57600080fd5b88019050601f81018913612c6f57600080fd5b8035612c82612c7d82612b9e565b612af7565b81815260059190911b8201830190838101908b831115612ca157600080fd5b928401925b82841015612cc8578335612cb981612aaf565b82529284019290840190612ca6565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612d09578181015183820152602001612cf1565b50506000910152565b60008151808452612d2a816020860160208601612cee565b601f01601f19169290920160200192915050565b6020815260006116e06020830184612d12565b600060208284031215612d6357600080fd5b5035919050565b60008060408385031215612d7d57600080fd5b8235612d8881612aaf565b946020939093013593505050565b600080600060608486031215612dab57600080fd5b8335612db681612aaf565b95602085013595506040909401359392505050565b60008060408385031215612dde57600080fd5b8235915060208301356001600160401b03811115612dfb57600080fd5b610cb885828601612b7e565b600080600060608486031215612e1c57600080fd5b8335612e2781612aaf565b92506020840135612e3781612aaf565b929592945050506040919091013590565b60008060408385031215612e5b57600080fd5b50508035926020909101359150565b60008060408385031215612e7d57600080fd5b823591506020830135612e8f81612aaf565b809150509250929050565b8415158152836020820152826040820152608060608201526000612ec16080830184612d12565b9695505050505050565b60006020808385031215612ede57600080fd5b82356001600160401b03811115612ef457600080fd5b8301601f81018513612f0557600080fd5b8035612f13612c7d82612b9e565b81815260059190911b82018301908381019087831115612f3257600080fd5b928401925b82841015612f5057833582529284019290840190612f37565b979650505050505050565b600080600060608486031215612f7057600080fd5b833592506020840135612e3781612aaf565b8015158114610c6957600080fd5b60008060408385031215612fa357600080fd5b8235612fae81612aaf565b91506020830135612e8f81612f82565b60008060008060808587031215612fd457600080fd5b8435612fdf81612aaf565b93506020850135612fef81612aaf565b92506040850135915060608501356001600160401b0381111561301157600080fd5b8501601f8101871361302257600080fd5b61303187823560208401612b27565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b82811015613089578151805185528681015187860152850151858501526060909301929085019060010161305a565b5091979650505050505050565b6000602082840312156130a857600080fd5b81356001600160401b038111156130be57600080fd5b611e1b84828501612b7e565b60008060008060008060c087890312156130e357600080fd5b86356130ee81612aaf565b955060208701356130fe81612aaf565b945060408701356001600160401b038082111561311a57600080fd5b6131268a838b01612b7e565b9550606089013591508082111561313c57600080fd5b6131488a838b01612b7e565b9450608089013591508082111561315e57600080fd5b5061316b89828a01612b7e565b92505060a087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b818110156131b75783518352928401929184019160010161319b565b50909695505050505050565b600080604083850312156131d657600080fd5b82356131e181612aaf565b91506020830135612e8f81612aaf565b6001600160a01b0387811682528616602082015260c06040820181905260009061321d90830187612d12565b828103606084015261322f8187612d12565b905082810360808401526132438186612d12565b9150508260a0830152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016132955761329561326d565b5060010190565b600181811c908216806132b057607f821691505b60208210810361171657634e487b7160e01b600052602260045260246000fd5b808201808211156106b9576106b961326d565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106b9576106b961326d565b6000826133bf57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610ad257600081815260208120601f850160051c810160208610156133eb5750805b601f850160051c820191505b818110156124ef578281556001016133f7565b81516001600160401b0381111561342357613423612ae1565b61343781613431845461329c565b846133c4565b602080601f83116001811461346c57600084156134545750858301515b600019600386901b1c1916600185901b1785556124ef565b600085815260208120601f198616915b8281101561349b5788860151825594840194600190910190840161347c565b50858210156134b95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906135099083016134c9565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e083016134c9565b60006020828403121561357157600080fd5b81516116e081612f82565b818103818111156106b9576106b961326d565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a06040820181905260009061350990830161358f565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e0830161358f565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351613653818460208801612cee565b835190830190613667818360208801612cee565b01949350505050565b60008251613682818460208701612cee565b9190910192915050565b60006020828403121561369e57600080fd5b81516116e081612aaf565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516137f3816017850160208801612cee565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613824816028840160208801612cee565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ec190830184612d12565b60006020828403121561387557600080fd5b81516116e081612a7c565b60008161388f5761388f61326d565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122058d193dc4a89936faa0836b7c3c9846ab4945e4f6b027433eff0c9a6b5fe9f9a64736f6c63430008110033", - "linkReferences": {}, - "deployedLinkReferences": {} -} + "bytecode": "0x608060405234801561001057600080fd5b50613aca806100206000396000f3fe608060405234801561001057600080fd5b50600436106102725760003560e01c806301ffc9a71461027757806302acb9a61461029f57806305a14872146102b457806306fdde03146102d4578063081812fc146102e9578063095ea7b3146102fc578063108762d01461030f578063156e29f614610322578063162790551461033557806322e8e1e014610349578063237c49191461035f57806323b872dd14610372578063248a9ca31461038557806327ac0c58146103985780632a55205a146103ab5780632f2ff15d146103dd57806336568abe146103f05780633d6d35981461040357806340c10f191461040b57806342842e0e1461041e57806342966c681461043157806347c4ef2514610444578063572b6c05146104675780635ced058e1461047a5780635ea3ab851461048b5780636352211e1461049e5780636d70f7ae146104b15780636fac889b146104c45780636fd902e1146104eb57806370a08231146104f1578063715018a61461050457806382c947b71461050c57806385be5724146105265780638da5cb5b1461053b57806391d148541461054357806395d89b41146105565780639713c8071461055e578063a0712d6814610571578063a217fddf14610584578063a22cb4651461058c578063ab9de2301461059f578063b219f7d7146105a7578063b88d4fde146105ba578063c87b56dd146105cd578063cbd5a40e146105e0578063ce1b815f14610600578063d242310514610608578063d547741f1461061b578063dd1520021461062e578063e271d9ee14610641578063e8a3d48514610661578063e985e9c514610669578063e9c1e0451461067c578063f2fde38b1461068f575b600080fd5b61028a610285366004612c23565b6106a2565b60405190151581526020015b60405180910390f35b6102b26102ad366004612c60565b6106dd565b005b6102c76102c2366004612d5d565b610707565b6040516102969190612e76565b6102dc61092c565b6040516102969190612eda565b6102c76102f7366004612eed565b6109be565b6102b261030a366004612f06565b6109e5565b61028a61031d366004612c60565b610b11565b6102b2610330366004612f32565b610ba9565b61028a610343366004612c60565b3b151590565b610351610c40565b604051908152602001610296565b6102b261036d366004612f67565b610c51565b6102b2610380366004612fa3565b610c86565b610351610393366004612eed565b610cbe565b6102b26103a6366004612c60565b610cd3565b6103be6103b9366004612fe4565b610d3e565b604080516001600160a01b039093168352602083019190915201610296565b6102b26103eb366004613006565b610d94565b6102b26103fe366004613006565b610db0565b6102b2610e3a565b6102b2610419366004612f06565b610e5b565b6102b261042c366004612fa3565b611056565b6102b261043f366004612eed565b611071565b610457610452366004612eed565b61130f565b6040516102969493929190613036565b61028a610475366004612c60565b61140c565b6102c7610488366004612eed565b90565b610351610499366004613067565b611431565b6102c76104ac366004612eed565b611480565b61028a6104bf366004612c60565b6114b4565b6103517f3cf8e80a7a55dd870201fe38c468fe694473dbe8d59a63381f1da07dc1c2b65581565b43610351565b6103516104ff366004612c60565b61156e565b6102b2611687565b61035161051a366004612c60565b6001600160a01b031690565b610351600080516020613a5583398151915281565b6102c7611699565b61028a610551366004613006565b6116a8565b6102dc6116d3565b6102b261056c3660046130f7565b6116e2565b6102b261057f366004612eed565b611714565b610351600081565b6102b261059a36600461312c565b611725565b6102c7611737565b6102b26105b5366004612c60565b611746565b6102b26105c836600461315a565b6117ae565b6102dc6105db366004612eed565b6117ed565b6105f36105ee366004612c60565b61188d565b60405161029691906131d9565b6102c7611921565b6102b2610616366004613232565b6119ac565b6102b2610629366004613006565b611a08565b6102b261063c366004613266565b611a24565b61065461064f366004612c60565b611b4a565b604051610296919061332d565b6102dc611c3b565b61028a610677366004613371565b611c4a565b60ff546102c7906001600160a01b031681565b6102b261069d366004612c60565b611c84565b60006106ad82611cfa565b806106bc57506106bc82611d1b565b806106d757506001600160e01b0319821663152a902d60e11b145b92915050565b6106e5611d6b565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b03168061073d5750305b600061074882611dda565b9050806001600160a01b03811663dd152002610762611e74565b61010160009054906101000a90046001600160a01b03168c8c8c8c60ff60009054906101000a90046001600160a01b03166040518863ffffffff1660e01b81526004016107b5979695949392919061339f565b600060405180830381600087803b1580156107cf57600080fd5b505af11580156107e3573d6000803e3d6000fd5b5050505060005b855181101561087d57816001600160a01b03166327ac0c588783815181106108145761081461340c565b60200260200101516040518263ffffffff1660e01b81526004016108389190612e76565b600060405180830381600087803b15801561085257600080fd5b505af1158015610866573d6000803e3d6000fd5b50505050808061087590613438565b9150506107ea565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156108b957600080fd5b505af11580156108cd573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d160405161091891815260200190565b60405180910390a350979650505050505050565b60606097805461093b90613451565b80601f016020809104026020016040519081016040528092919081815260200182805461096790613451565b80156109b45780601f10610989576101008083540402835291602001916109b4565b820191906000526020600020905b81548152906001019060200180831161099757829003601f168201915b5050505050905090565b60006109c982611e7e565b506000908152609b60205260409020546001600160a01b031690565b60006109f082611480565b9050806001600160a01b0316836001600160a01b031603610a625760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a74611e74565b6001600160a01b03161480610a905750610a9081610677611e74565b610b025760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610a59565b610b0c8383611ea3565b505050565b600080610b1c611737565b90506001600160a01b038116610b355750600092915050565b604051630108762d60e41b81526001600160a01b0382169063108762d090610b61908690600401612e76565b602060405180830381865afa158015610b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba29190613485565b9392505050565b610bb38383610e5b565b600160fc60008481526020019081526020016000206001016000828254610bda91906134a2565b90915550506001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610c4c6101025490565b905090565b610c5c6104bf611e74565b610c785760405162461bcd60e51b8152600401610a59906134b5565b610c828282611f11565b5050565b610c97610c91611e74565b82611f37565b610cb35760405162461bcd60e51b8152600401610a59906134e0565b610b0c838383611f96565b600090815260c9602052604090206001015490565b610cdb611e74565b6001600160a01b0316610cec611699565b6001600160a01b03161480610d075750610d076104bf611e74565b610d235760405162461bcd60e51b8152600401610a599061352d565b610d3b600080516020613a55833981519152826120f5565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610d80908661355d565b610d8a9190613574565b9150509250929050565b610d9d82610cbe565b610da6816120ff565b610b0c8383612110565b610db8611e74565b6001600160a01b0316816001600160a01b031614610e305760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a59565b610c828282612197565b610e59600080516020613a55833981519152610e54611e74565b612197565b565b610e666104bf611e74565b80610e895750610e74611699565b6001600160a01b0316826001600160a01b0316145b610ed25760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b6044820152606401610a59565b610100541580610ee757506101005461010254105b610f285760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b6044820152606401610a59565b610f3761010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610f7490826135e4565b50610101546001600160a01b031663bb794d9282610f90611e74565b600143604051602001610fa694939291906136ba565b604051602081830303815290604052805190602001208360001b610fc8611e74565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161100894939291906136f9565b6020604051808303816000875af1158015611027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104b9190613485565b50610c82828261221c565b610b0c838383604051806020016040528060008152506117ae565b61107c6104bf611e74565b806110a7575061108a611e74565b6001600160a01b031661109c82611480565b6001600160a01b0316145b61110b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b6064820152608401610a59565b600160fc600083815260200190815260200160002060010160008282546111329190613739565b9091555050610101546001600160a01b031663bb794d9282611152611e74565b6001436040516020016111689493929190613763565b604051602081830303815290604052805190602001208360001b61118a611e74565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b81526004016111ca949392919061378c565b6020604051808303816000875af11580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d9190613485565b5061121781612325565b60005b6101036000611227611e74565b6001600160a01b03168152602081019190915260400160002054811015610c8257816101036000611256611e74565b6001600160a01b03166001600160a01b0316815260200190815260200160002082815481106112875761128761340c565b906000526020600020906003020160000154036112fd5761010360006112ab611e74565b6001600160a01b03166001600160a01b0316815260200190815260200160002081815481106112dc576112dc61340c565b60009182526020822060039091020181815560018101829055600201555050565b8061130781613438565b91505061121a565b600081815260fc602090815260408083208151608081018352815460ff1615158152600182015493810193909352600281015491830191909152600381018054849384936060938593838601919061136690613451565b80601f016020809104026020016040519081016040528092919081815260200182805461139290613451565b80156113df5780601f106113b4576101008083540402835291602001916113df565b820191906000526020600020905b8154815290600101906020018083116113c257829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6000611416611921565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b8351811015611479578381815181106114525761145261340c565b60200260200101518261146591906134a2565b91508061147181613438565b915050611437565b5092915050565b60008061148c836123b6565b90506001600160a01b0381166106d75760405162461bcd60e51b8152600401610a59906137cc565b60ff546000906001600160a01b03166114df576106d7600080516020613a55833981519152836116a8565b60ff54604051630108762d60e41b81526001600160a01b039091169063108762d09061150f908590600401612e76565b602060405180830381865afa15801561152c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115509190613485565b806106d757506106d7600080516020613a55833981519152836116a8565b60008060005b6001600160a01b03841660009081526101036020526040902054811015611479576001600160a01b0384166000908152610103602052604081208054839081106115c0576115c061340c565b90600052602060002090600302016002015411801561166257506001600160a01b0384166000908152610103602052604090208054829081106116055761160561340c565b9060005260206000209060030201600101546000148061166257506001600160a01b03841660009081526101036020526040902080544391908390811061164e5761164e61340c565b906000526020600020906003020160010154115b15611675576116726001836134a2565b91505b8061167f81613438565b915050611574565b61168f611d6b565b610e5960006123d1565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606098805461093b90613451565b6116ed6104bf611e74565b6117095760405162461bcd60e51b8152600401610a59906134b5565b610b0c838383612423565b610d3b61171f611e74565b82610e5b565b610c82611730611e74565b83836124bb565b60ff546001600160a01b031690565b61174e611e74565b6001600160a01b031661175f611699565b6001600160a01b0316148061177a575061177a6104bf611e74565b6117965760405162461bcd60e51b8152600401610a599061352d565b610d3b600080516020613a5583398151915282612197565b6117bf6117b9611e74565b83611f37565b6117db5760405162461bcd60e51b8152600401610a59906134e0565b6117e784848484612585565b50505050565b606060006117f96125b8565b9050611804836125c2565b156118585760008151116118275760405180602001604052806000815250610ba2565b80611831846125df565b6040516020016118429291906137fe565b6040516020818303038152906040529392505050565b60008151116118765760405180602001604052806000815250610ba2565b80604051602001611842919061382d565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561191657838290600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050815260200190600101906118c6565b505050509050919050565b60008061192c611737565b90506001600160a01b03811661194457600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a69190613849565b91505090565b6119b4611e74565b6001600160a01b03166119c5611699565b6001600160a01b031614806119e057506119e06104bf611e74565b6119fc5760405162461bcd60e51b8152600401610a599061352d565b60fe610c8282826135e4565b611a1182610cbe565b611a1a816120ff565b610b0c8383612197565b600054610100900460ff1615808015611a445750600054600160ff909116105b80611a655750611a53306125f6565b158015611a65575060005460ff166001145b611ac85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a59565b6000805460ff191660011790558015611aeb576000805461ff0019166101001790555b611afa88888888888888612605565b8015611b40576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611b7f57611b7f612c7d565b604051908082528060200260200182016040528015611ba8578160200160208202803683370190505b50905060005b6001600160a01b03841660009081526101036020526040902054811015611479576001600160a01b038416600090815261010360205260409020805482908110611bfa57611bfa61340c565b906000526020600020906003020160020154828281518110611c1e57611c1e61340c565b602090810291909101015280611c3381613438565b915050611bae565b606060fe805461093b90613451565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff1680610ba25750610ba2826114b4565b611c8c611d6b565b6001600160a01b038116611cf15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a59565b610d3b816123d1565b60006001600160e01b03198216637965db0b60e01b14806106d757506106d7825b60006001600160e01b031982166380ac58cd60e01b1480611d4c57506001600160e01b03198216635b5e139f60e01b145b806106d757506301ffc9a760e01b6001600160e01b03198316146106d7565b611d73611e74565b6001600160a01b0316611d84611699565b6001600160a01b031614610e595760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a59565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611e6f5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610a59565b919050565b6000610c4c61266c565b611e87816125c2565b610d3b5760405162461bcd60e51b8152600401610a59906137cc565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611ed882611480565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610b0c82826135e4565b600080611f4383611480565b9050806001600160a01b0316846001600160a01b03161480611f6a5750611f6a8185611c4a565b80611f8e5750836001600160a01b0316611f83846109be565b6001600160a01b0316145b949350505050565b826001600160a01b0316611fa982611480565b6001600160a01b031614611fcf5760405162461bcd60e51b8152600401610a5990613866565b6001600160a01b0382166120315760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a59565b61203e838383600161269a565b826001600160a01b031661205182611480565b6001600160a01b0316146120775760405162461bcd60e51b8152600401610a5990613866565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a855283862080546000190190559087168086528386208054600101905586865260999094528285208054909216841790915590518493600080516020613a7583398151915291a4505050565b610c828282612110565b610d3b8161210b611e74565b612706565b61211a82826116a8565b610c8257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612153611e74565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6121a182826116a8565b15610c8257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556121d8611e74565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166122725760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a59565b61227b816125c2565b156122985760405162461bcd60e51b8152600401610a59906138ab565b6122a660008383600161269a565b6122af816125c2565b156122cc5760405162461bcd60e51b8152600401610a59906138ab565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b031916841790555183929190600080516020613a75833981519152908290a45050565b600061233082611480565b905061234081600084600161269a565b61234982611480565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a84528285208054600019019055878552609990935281842080549091169055519293508492600080516020613a75833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156124735760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610a59565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036125185760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610a59565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612590848484611f96565b61259c8484848461275f565b6117e75760405162461bcd60e51b8152600401610a59906138e1565b6060610c4c611c3b565b6000806125ce836123b6565b6001600160a01b0316141592915050565b60606106d7826125ee8461286e565b6001016128d8565b6001600160a01b03163b151590565b600054610100900460ff1661262c5760405162461bcd60e51b8152600401610a5990613933565b612634612a73565b61263c612a73565b6126468585612a9a565b61264e612ada565b612656612a73565b6126638787858585612b11565b50505050505050565b60006014361080159061268357506126833361140c565b15612695575060131936013560601c90565b503390565b6001600160a01b03841615806126b757506001600160a01b038316155b806126c857506126c86104bf611e74565b6127015760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610a59565b6117e7565b61271082826116a8565b610c825761271d81612bf7565b6127288360206128d8565b60405160200161273992919061397e565b60408051601f198184030181529082905262461bcd60e51b8252610a5991600401612eda565b6000612773846001600160a01b03166125f6565b1561286357836001600160a01b031663150b7a0261278f611e74565b8786866040518563ffffffff1660e01b81526004016127b194939291906139ed565b6020604051808303816000875af19250505080156127ec575060408051601f3d908101601f191682019092526127e991810190613a20565b60015b612849573d80801561281a576040519150601f19603f3d011682016040523d82523d6000602084013e61281f565b606091505b5080516000036128415760405162461bcd60e51b8152600401610a59906138e1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f8e565b506001949350505050565b600080608083901c156128865760809290921c916010015b604083901c1561289b5760409290921c916008015b602083901c156128b05760209290921c916004015b601083901c156128c55760109290921c916002015b600883901c156106d75760010192915050565b606060006128e783600261355d565b6128f29060026134a2565b6001600160401b0381111561290957612909612c7d565b6040519080825280601f01601f191660200182016040528015612933576020820181803683370190505b509050600360fc1b8160008151811061294e5761294e61340c565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061297d5761297d61340c565b60200101906001600160f81b031916908160001a90535060006129a184600261355d565b6129ac9060016134a2565b90505b6001811115612a24576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106129e0576129e061340c565b1a60f81b8282815181106129f6576129f661340c565b60200101906001600160f81b031916908160001a90535060049490941c93612a1d81613a3d565b90506129af565b508315610ba25760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a59565b600054610100900460ff16610e595760405162461bcd60e51b8152600401610a5990613933565b600054610100900460ff16612ac15760405162461bcd60e51b8152600401610a5990613933565b6097612acd83826135e4565b506098610b0c82826135e4565b600054610100900460ff16612b015760405162461bcd60e51b8152600401610a5990613933565b610e59612b0c611e74565b6123d1565b600054610100900460ff16612b385760405162461bcd60e51b8152600401610a5990613933565b612b57600080516020613a55833981519152612b52611e74565b6120f5565b612b6f600080516020613a55833981519152856120f5565b612b87600080516020613a55833981519152866120f5565b612b90836119ac565b61010082905560ff80546001600160a01b038084166001600160a01b031992831617909255610101805492871692909116919091179055612bcf611e74565b6001600160a01b0316856001600160a01b031614612bf057612bf085611c84565b5050505050565b60606106d76001600160a01b03831660146128d8565b6001600160e01b031981168114610d3b57600080fd5b600060208284031215612c3557600080fd5b8135610ba281612c0d565b6001600160a01b0381168114610d3b57600080fd5b8035611e6f81612c40565b600060208284031215612c7257600080fd5b8135610ba281612c40565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612cbb57612cbb612c7d565b604052919050565b60006001600160401b03831115612cdc57612cdc612c7d565b612cef601f8401601f1916602001612c93565b9050828152838383011115612d0357600080fd5b828260208301376000602084830101529392505050565b600082601f830112612d2b57600080fd5b610ba283833560208501612cc3565b60006001600160401b03821115612d5357612d53612c7d565b5060051b60200190565b600080600080600060a08688031215612d7557600080fd5b85356001600160401b0380821115612d8c57600080fd5b612d9889838a01612d1a565b9650602091508188013581811115612daf57600080fd5b612dbb8a828b01612d1a565b965050604088013581811115612dd057600080fd5b612ddc8a828b01612d1a565b95505060608801359350608088013581811115612df857600080fd5b88019050601f81018913612e0b57600080fd5b8035612e1e612e1982612d3a565b612c93565b81815260059190911b8201830190838101908b831115612e3d57600080fd5b928401925b82841015612e64578335612e5581612c40565b82529284019290840190612e42565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612ea5578181015183820152602001612e8d565b50506000910152565b60008151808452612ec6816020860160208601612e8a565b601f01601f19169290920160200192915050565b602081526000610ba26020830184612eae565b600060208284031215612eff57600080fd5b5035919050565b60008060408385031215612f1957600080fd5b8235612f2481612c40565b946020939093013593505050565b600080600060608486031215612f4757600080fd5b8335612f5281612c40565b95602085013595506040909401359392505050565b60008060408385031215612f7a57600080fd5b8235915060208301356001600160401b03811115612f9757600080fd5b610d8a85828601612d1a565b600080600060608486031215612fb857600080fd5b8335612fc381612c40565b92506020840135612fd381612c40565b929592945050506040919091013590565b60008060408385031215612ff757600080fd5b50508035926020909101359150565b6000806040838503121561301957600080fd5b82359150602083013561302b81612c40565b809150509250929050565b841515815283602082015282604082015260806060820152600061305d6080830184612eae565b9695505050505050565b6000602080838503121561307a57600080fd5b82356001600160401b0381111561309057600080fd5b8301601f810185136130a157600080fd5b80356130af612e1982612d3a565b81815260059190911b820183019083810190878311156130ce57600080fd5b928401925b828410156130ec578335825292840192908401906130d3565b979650505050505050565b60008060006060848603121561310c57600080fd5b833592506020840135612fd381612c40565b8015158114610d3b57600080fd5b6000806040838503121561313f57600080fd5b823561314a81612c40565b9150602083013561302b8161311e565b6000806000806080858703121561317057600080fd5b843561317b81612c40565b9350602085013561318b81612c40565b92506040850135915060608501356001600160401b038111156131ad57600080fd5b8501601f810187136131be57600080fd5b6131cd87823560208401612cc3565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b8281101561322557815180518552868101518786015285015185850152606090930192908501906001016131f6565b5091979650505050505050565b60006020828403121561324457600080fd5b81356001600160401b0381111561325a57600080fd5b611f8e84828501612d1a565b600080600080600080600060e0888a03121561328157600080fd5b873561328c81612c40565b9650602088013561329c81612c40565b955060408801356001600160401b03808211156132b857600080fd5b6132c48b838c01612d1a565b965060608a01359150808211156132da57600080fd5b6132e68b838c01612d1a565b955060808a01359150808211156132fc57600080fd5b506133098a828b01612d1a565b93505060a0880135915061331f60c08901612c55565b905092959891949750929550565b6020808252825182820181905260009190848201906040850190845b8181101561336557835183529284019291840191600101613349565b50909695505050505050565b6000806040838503121561338457600080fd5b823561338f81612c40565b9150602083013561302b81612c40565b600060018060a01b03808a168352808916602084015260e060408401526133c960e0840189612eae565b83810360608501526133db8189612eae565b905083810360808501526133ef8188612eae565b60a0850196909652509290921660c0909101525095945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161344a5761344a613422565b5060010190565b600181811c9082168061346557607f821691505b60208210810361188757634e487b7160e01b600052602260045260246000fd5b60006020828403121561349757600080fd5b8151610ba28161311e565b808201808211156106d7576106d7613422565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106d7576106d7613422565b60008261359157634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610b0c57600081815260208120601f850160051c810160208610156135bd5750805b601f850160051c820191505b818110156135dc578281556001016135c9565b505050505050565b81516001600160401b038111156135fd576135fd612c7d565b6136118161360b8454613451565b84613596565b602080601f831160018114613646576000841561362e5750858301515b600019600386901b1c1916600185901b1785556135dc565b600085815260208120601f198616915b8281101561367557888601518255948401946001909101908401613656565b50858210156136935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906136e39083016136a3565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a0820152600061305d60e083016136a3565b818103818111156106d7576106d7613422565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906136e390830161374c565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a0820152600061305d60e0830161374c565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351613810818460208801612e8a565b835190830190613824818360208801612e8a565b01949350505050565b6000825161383f818460208701612e8a565b9190910192915050565b60006020828403121561385b57600080fd5b8151610ba281612c40565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516139b0816017850160208801612e8a565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516139e1816028840160208801612e8a565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061305d90830184612eae565b600060208284031215613a3257600080fd5b8151610ba281612c0d565b600081613a4c57613a4c613422565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220226b11127bd8abfbb9aac8fb063a7cfe58665bcc594068743c344c08e8f33a2964736f6c63430008110033", + "address": "0x17d059d9298278BB0B4eFAc41e93B3AEEE1517dE", + "implementation": "0x3D4348D49B77c0C0a0E30018e518990c4f1f38e7", + "version": "v3.5.0", + "libraries": {} +} \ No newline at end of file From 3009c478f064ac5b18924ef2f67b175dddcbadec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Sep 2023 18:36:11 +0300 Subject: [PATCH 107/151] fix: rest of the cases? --- integration/external/Datasets.e2e.test.ts | 1 + integration/external/Services.e2e.test.ts | 1 + integration/nevermined/SubscriptionDuration.test.ts | 3 +++ integration/nevermined/Subscriptions.e2e.test.ts | 1 + 4 files changed, 6 insertions(+) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index 787263c7d..91c6b70d3 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -162,6 +162,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { '', '', 0, + nevermined.keeper.nvmConfig.address, ]) await nevermined.contracts.loadNft721Api(subscriptionNFT) diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index e1a212f65..dfdd99c99 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -220,6 +220,7 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { '', '', 0, + nevermined.keeper.nvmConfig.address, ]) await nevermined.contracts.loadNft721Api(subscriptionNFT) diff --git a/integration/nevermined/SubscriptionDuration.test.ts b/integration/nevermined/SubscriptionDuration.test.ts index 8645585b0..ced2e5c3e 100644 --- a/integration/nevermined/SubscriptionDuration.test.ts +++ b/integration/nevermined/SubscriptionDuration.test.ts @@ -36,6 +36,7 @@ describe('Subscription Durations', () => { '', '', 0, + nevermined.keeper.nvmConfig.address, ]) await nevermined.contracts.loadNft721Api(subscriptionNFT) @@ -129,6 +130,7 @@ describe('Subscription Durations', () => { '', '', 0, + nevermined.keeper.nvmConfig.address, ]) await nevermined.contracts.loadNft721Api(subscriptionNFT) @@ -221,6 +223,7 @@ describe('Subscription Durations', () => { '', '', 0, + nevermined.keeper.nvmConfig.address, ]) await nevermined.contracts.loadNft721Api(subscriptionNFT) diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index 56c54a1b1..96849b34c 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -122,6 +122,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { '', '', 0, + nevermined.keeper.nvmConfig.address, ]) await nevermined.contracts.loadNft721Api(subscriptionNFT) From 886f0ae27dab2dc6b1205f6b35c5861a5efaf9e2 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 29 Sep 2023 09:57:21 +0200 Subject: [PATCH 108/151] test: e2e testing of NVM App flows --- integration/nevermined/Assets.test.ts | 1 - integration/nevermined/Credits.e2e.test.ts | 2 +- .../CreditsWithDuration.e2e.test.ts | 3 +- integration/nevermined/NFT1155Api.e2e.test.ts | 2 +- integration/nevermined/NFT721Api.e2e.test.ts | 2 +- integration/nevermined/NVMAppFlows.ts | 431 ++++++++++++++++++ .../nevermined/Subscriptions.e2e.test.ts | 2 +- package.json | 2 +- src/nevermined/api/nfts/NFT721Api.ts | 4 +- src/nevermined/api/nfts/NFTsBaseApi.ts | 30 +- src/services/node/NeverminedNode.ts | 4 +- test/config.ts | 1 - test/keeper/TestContractHandler.ts | 1 + 13 files changed, 470 insertions(+), 15 deletions(-) create mode 100644 integration/nevermined/NVMAppFlows.ts diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index 0e5623872..e119af427 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -322,7 +322,6 @@ describe('Assets', () => { console.debug(`It should fail with error: ${err}`) assert.isDefined(err) }) - }) }) diff --git a/integration/nevermined/Credits.e2e.test.ts b/integration/nevermined/Credits.e2e.test.ts index 8d2774172..d7c84d535 100644 --- a/integration/nevermined/Credits.e2e.test.ts +++ b/integration/nevermined/Credits.e2e.test.ts @@ -179,7 +179,7 @@ describe('Credit Subscriptions using NFT ERC-1155 End-to-End', () => { it('should grant Nevermined the operator role', async () => { assert.isTrue( - await nevermined.nfts1155.isOperator( + await nevermined.nfts1155.isOperatorOfDID( subscriptionDDO.id, nevermined.keeper.conditions.transferNftCondition.address, ), diff --git a/integration/nevermined/CreditsWithDuration.e2e.test.ts b/integration/nevermined/CreditsWithDuration.e2e.test.ts index 625397f7b..dd7fbe8b6 100644 --- a/integration/nevermined/CreditsWithDuration.e2e.test.ts +++ b/integration/nevermined/CreditsWithDuration.e2e.test.ts @@ -200,7 +200,7 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC it('should grant Nevermined the operator role', async () => { assert.isTrue( - await nevermined.nfts1155.isOperator( + await nevermined.nfts1155.isOperatorOfDID( subscriptionDDO.id, nevermined.keeper.conditions.transferNftCondition.address, ), @@ -340,7 +340,6 @@ describe('Credit and Duration Subscriptions with Multiple services using NFT ERC assert.isTrue(balanceAfter === subscriptionCredits1 - accessCostInCredits1) }) - // TODO: Enable this test when the TransferNFTCondition allow minting NFT-1155 with duration it('After the credits expire the user can not get access', async () => { await mineBlocks(nevermined, subscriber, subscriptionDuration1 + 1) diff --git a/integration/nevermined/NFT1155Api.e2e.test.ts b/integration/nevermined/NFT1155Api.e2e.test.ts index 87fdf59a0..db77df113 100644 --- a/integration/nevermined/NFT1155Api.e2e.test.ts +++ b/integration/nevermined/NFT1155Api.e2e.test.ts @@ -181,7 +181,7 @@ function makeTest(isCustom) { it('should give Nevermined the operator role', async () => { assert.isTrue( - await nevermined.nfts1155.isOperator( + await nevermined.nfts1155.isOperatorOfDID( ddo.id, nevermined.keeper.conditions.transferNftCondition.address, ), diff --git a/integration/nevermined/NFT721Api.e2e.test.ts b/integration/nevermined/NFT721Api.e2e.test.ts index 64543c7c4..a93e46fc5 100644 --- a/integration/nevermined/NFT721Api.e2e.test.ts +++ b/integration/nevermined/NFT721Api.e2e.test.ts @@ -134,7 +134,7 @@ describe('NFTs721 Api End-to-End', () => { it('should give operator role to Nevermined', async () => { assert.isTrue( - await nevermined.nfts721.isOperator( + await nevermined.nfts721.isOperatorOfDID( ddo.id, nevermined.keeper.conditions.transferNft721Condition.address, ), diff --git a/integration/nevermined/NVMAppFlows.ts b/integration/nevermined/NVMAppFlows.ts new file mode 100644 index 000000000..a54fb30c5 --- /dev/null +++ b/integration/nevermined/NVMAppFlows.ts @@ -0,0 +1,431 @@ +import chai, { assert } from 'chai' +import chaiAsPromised from 'chai-as-promised' + +import { decodeJwt, JWTPayload } from 'jose' +import { Account, DDO, MetaData, Nevermined, AssetPrice, NFTAttributes } from '../../src' +import { Token, TransferNFTCondition } from '../../src/keeper' +import { config } from '../config' +import { getMetadata } from '../utils' +import TestContractHandler from '../../test/keeper/TestContractHandler' +import { + getRoyaltyAttributes, + PublishMetadataOptions, + PublishOnChainOptions, + RoyaltyAttributes, + RoyaltyKind, + SubscriptionCreditsNFTApi, +} from '../../src/nevermined' +import { mineBlocks } from '../utils/utils' + +chai.use(chaiAsPromised) + +describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { + let publisher: Account + let subscriber: Account + let reseller: Account + + let nevermined: Nevermined + let token: Token + let transferNftCondition: TransferNFTCondition + let subscriptionDDO: DDO + let datasetDDO: DDO + + let agreementId: string + + const amounts1 = [15n, 5n] + const amounts2 = [30n, 10n] + let receivers: string[] + let subsSilverPrice: AssetPrice + let subsGoldPrice: AssetPrice + let royaltyAttributes: RoyaltyAttributes + + let subscriptionMetadata: MetaData + let datasetMetadata: MetaData + + const preMint = false + const royalties = 0 + const nftTransfer = false + + const subscriptionSilverDuration = 10 // in blocks + const subscriptionGoldDuration = 20 // in blocks + + const subscriptionSilverPrice = 20n + const subscriptionGoldPrice = 40n + // This is the number of credits that the subscriber will get when purchase the subscription + // In the DDO this will be added in the `_numberNFTs` value of the `nft-sales` service of the subscription + const subscriptionSilverCredits = 15n + const subscriptionGoldCredits = 50n + // This is the number of credits that cost get access to the service attached to the subscription + // In the DDO this will be added in the `_numberNFTs` value of the `nft-access` service of the asset associated to the subscription + const accessCostInCreditsDataset = 2n + const _accessCostInCreditsService = 5n + + let salesServices + let accessServices + + // let nft: ethers.Contract + let subscriptionNFT: SubscriptionCreditsNFTApi + let neverminedNodeAddress + + let payload: JWTPayload + + before(async () => { + TestContractHandler.setConfig(config) + + nevermined = await Nevermined.getInstance(config) + ;[, publisher, subscriber, , reseller] = await nevermined.accounts.list() + + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(publisher) + + await nevermined.services.marketplace.login(clientAssertion) + payload = decodeJwt(config.marketplaceAuthToken) + + datasetMetadata = getMetadata() + subscriptionMetadata = getMetadata(undefined, 'NVM App Credits Subscription') + subscriptionMetadata.main.type = 'subscription' + + datasetMetadata.userId = payload.sub + neverminedNodeAddress = await nevermined.services.node.getProviderAddress() + + // conditions + ;({ transferNftCondition } = nevermined.keeper.conditions) + + // components + ;({ token } = nevermined.keeper) + + // scale = 10n ** BigInt(await token.decimals()) + receivers = [publisher.getId(), reseller.getId()] + + subsSilverPrice = new AssetPrice( + new Map([ + [receivers[0], amounts1[0]], + [receivers[1], amounts1[1]], + ]), + ).setTokenAddress(token.address) + + subsGoldPrice = new AssetPrice( + new Map([ + [receivers[0], amounts2[0]], + [receivers[1], amounts2[1]], + ]), + ).setTokenAddress(token.address) + + royaltyAttributes = getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, royalties) + }) + + describe('As NVM Admin I want to setup a factory contract for subscriptions', () => { + it('As NVM admin I can deploy a `NFT1155SubscriptionUpgradeable` contract (NFT1155)', async () => { + console.log(`Running first test`) + // Deploy NFT + TestContractHandler.setConfig(config) + + const contractABI = await TestContractHandler.getABI( + 'NFT1155SubscriptionUpgradeable', + './test/resources/artifacts/', + ) + subscriptionNFT = await SubscriptionCreditsNFTApi.deployInstance( + config, + contractABI, + publisher, + [ + publisher.getId(), + nevermined.keeper.didRegistry.address, + 'App Subscription NFT', + 'CRED', + '', + ], + ) + + console.debug(`Deployed ERC-1155 Subscription NFT on address: ${subscriptionNFT.address}`) + + await nevermined.contracts.loadNft1155Api(subscriptionNFT) + + await subscriptionNFT.grantOperatorRole(transferNftCondition.address, publisher) + console.debug(`Granting operator role to Nevermined Node Address: ${neverminedNodeAddress}`) + await subscriptionNFT.grantOperatorRole(neverminedNodeAddress, publisher) + + assert.equal(nevermined.nfts1155.getContract.address, subscriptionNFT.address) + }) + + it('I should grant Nevermined the operator role', async () => { + assert.isTrue( + await nevermined.nfts1155.isOperator( + subscriptionNFT.address, + nevermined.keeper.conditions.transferNftCondition.address, + 1155, + ), + ) + }) + }) + + describe('As publisher I can register a time based Smart Subscription', () => { + it('As publisher I can register a time based Smart Subscription as part of the NFT1155', async () => { + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: subscriptionMetadata, + services: [ + { + serviceType: 'nft-sales', + price: subsSilverPrice, + nft: { + duration: subscriptionSilverDuration, + amount: subscriptionSilverCredits, + nftTransfer, + }, + }, + { + serviceType: 'nft-sales', + price: subsGoldPrice, + nft: { + duration: subscriptionGoldDuration, + amount: subscriptionGoldCredits, + nftTransfer, + }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + subscriptionDDO = await nevermined.nfts1155.create(nftAttributes, publisher) + + assert.equal(await subscriptionNFT.balance(subscriptionDDO.id, publisher.getId()), 0n) + assert.isDefined(subscriptionDDO) + console.log(`Subscription DID: ${subscriptionDDO.id}`) + + salesServices = subscriptionDDO.getServicesByType('nft-sales') + assert.equal(salesServices.length, 2) + assert.equal( + salesServices[0].attributes.main.price.toString(), + subsSilverPrice.getTotalPrice().toString(), + ) + assert.equal( + salesServices[1].attributes.main.price.toString(), + subsGoldPrice.getTotalPrice().toString(), + ) + }) + + it('As publisher I can register an off-chain dataset associated to a time subscription', async () => { + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: datasetMetadata, + services: [ + { + serviceType: 'nft-access', + nft: { + tokenId: subscriptionDDO.shortId(), + // TODO: Review + duration: subscriptionSilverDuration, + amount: accessCostInCreditsDataset, + nftTransfer, + }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + datasetDDO = await nevermined.nfts1155.create(nftAttributes, publisher, { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.OnlyOffchain, + }) + assert.isDefined(datasetDDO) + console.log(`Asset DID: ${datasetDDO.id}`) + + accessServices = datasetDDO.getServicesByType('nft-access') + assert.equal(accessServices.length, 1) + + const tokenId = DDO.getTokenIdFromService(accessServices[0]) + assert.equal(tokenId, subscriptionDDO.shortId()) + }) + + it.skip('As a publisher I can register an off-chain webservice associated to a time subscription', async () => {}) + }) + + describe('As a subscriber I can purchase a time based Smart Subscription based on NFT1155', () => { + let agreementId: string + + it('I can order and claim the subscription', async () => { + await subscriber.requestTokens(subscriptionSilverPrice) + + const silverSalesService = subscriptionDDO.getServicesByType('nft-sales')[0] + console.log( + `Silver Sales Service with index ${silverSalesService.index} and Price ${silverSalesService.attributes.main.price}`, + ) + agreementId = await nevermined.nfts1155.order( + subscriptionDDO.id, + subscriptionSilverCredits, + subscriber, + silverSalesService.index, + ) + assert.isDefined(agreementId) + + try { + const receipt = await nevermined.nfts1155.claim( + agreementId, + publisher.getId(), + subscriber.getId(), + subscriptionSilverCredits, + subscriptionDDO.id, + silverSalesService.index, + ) + assert.isTrue(receipt) + } catch (e) { + console.error(e.message) + assert.fail(e.message) + } + }) + + it('I can download a dataset using my subscription', async () => { + const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance Before: ${balanceBefore}`) + + console.log(`First AgreementId: ${agreementId}`) + const result = await nevermined.nfts1155.access( + datasetDDO.id, + subscriber, + '/tmp/.nevermined/downloads/1/', + undefined, + agreementId, + ) + assert.isTrue(result) + + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After: ${balanceAfter}`) + + assert.equal(balanceBefore - accessCostInCreditsDataset, balanceAfter) + }) + + it.skip('I can access a service using my subscription ', async () => {}) + }) + + describe('Subscriptions expires', () => { + it('When subscription expires my balance is back to 0', async () => { + await mineBlocks(nevermined, subscriber, subscriptionSilverDuration + 1) + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Expiring duration: ${balanceAfter}`) + assert.isTrue(balanceAfter === 0n) + }) + + it('As a subscriber I can not access to the dataset using my expired subscription', async () => { + try { + await nevermined.nfts1155.access( + datasetDDO.id, + subscriber, + '/tmp/.nevermined/downloads/1/', + undefined, + agreementId, + ) + assert.fail('Should not be able to access the dataset') + } catch (e) { + assert.isTrue(true) + } + }) + + it.skip('As a subscriber I can not access to the service using my expired subscription ', async () => {}) + }) + + describe('As a subscriber I want to topup my subscription purchasing a GOLD plan', () => { + it('I check the details of the subscription NFT', async () => { + const details = await nevermined.nfts1155.details(subscriptionDDO.id) + assert.equal(details.owner, publisher.getId()) + }) + + it('I am ordering the GOLD plan associated to the subscription NFT', async () => { + const balanceBeforeTopup = await subscriptionNFT.balance( + subscriptionDDO.id, + subscriber.getId(), + ) + + console.log(`Balance Before Topup: ${balanceBeforeTopup}`) + + await subscriber.requestTokens(subscriptionGoldPrice) + + const goldSalesService = subscriptionDDO.getServicesByType('nft-sales')[1] + console.log( + `Gold Sales Service with index ${goldSalesService.index} and Price ${goldSalesService.attributes.main.price}`, + ) + agreementId = await nevermined.nfts1155.order( + subscriptionDDO.id, + subscriptionGoldCredits, + subscriber, + goldSalesService.index, + ) + assert.isDefined(agreementId) + console.log(`Ordered Agreement Id ${agreementId}`) + + try { + const receipt = await nevermined.nfts1155.claim( + agreementId, + publisher.getId(), + subscriber.getId(), + subscriptionGoldCredits, + subscriptionDDO.id, + goldSalesService.index, + ) + assert.isTrue(receipt) + } catch (e) { + console.error(e.message) + assert.fail(e.message) + } + + const balanceAfterTopup = await subscriptionNFT.balance( + subscriptionDDO.id, + subscriber.getId(), + ) + console.log(`Balance After Topup: ${balanceAfterTopup}`) + + const minted = await subscriptionNFT.getContract.getMintedEntries( + subscriber.getId(), + subscriptionDDO.shortId(), + ) + console.log(`Current Block Number: ${await nevermined.web3.getBlockNumber()}`) + console.log(`Minted entries: ${minted.length}`) + minted.map((m) => + console.log( + `Minted ${m.amountMinted} tokens on block ${m.mintBlock} and expiring on ${m.expirationBlock} block`, + ), + ) + + assert.equal(balanceBeforeTopup + subscriptionGoldCredits, balanceAfterTopup) + }) + + it('I can download again using my toped up subscription', async () => { + const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance Before: ${balanceBefore}`) + + console.log(`Using Agreement Id ${agreementId}`) + const result = await nevermined.nfts1155.access( + datasetDDO.id, + subscriber, + '/tmp/.nevermined/downloads/2/', + undefined, + agreementId, + ) + // for (let i = 0; i < 5; i++) { + // await nevermined.nfts1155.access(datasetDDO.id, subscriber, '/tmp/', undefined, agreementId) + // await sleep(1000) + // console.log(`Balance After Access: ${await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId())}`) + // } + + assert.isTrue(result) + + const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + console.log(`Balance After: ${balanceAfter}`) + + const minted = await subscriptionNFT.getContract.getMintedEntries( + subscriber.getId(), + subscriptionDDO.shortId(), + ) + console.log(`Current Block Number: ${await nevermined.web3.getBlockNumber()}`) + console.log(`Minted entries: ${minted.length}`) + minted.map((m) => + console.log( + `Minted ${m.amountMinted} tokens on block ${m.mintBlock} and expiring on ${m.expirationBlock} block`, + ), + ) + + assert.equal(balanceBefore - accessCostInCreditsDataset, balanceAfter) + }) + }) +}) diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index 84b6bafac..52cc8edb4 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -152,7 +152,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { it('should grant Nevermined the operator role', async () => { assert.isTrue( - await nevermined.nfts721.isOperator( + await nevermined.nfts721.isOperatorOfDID( subscriptionDDO.id, nevermined.keeper.conditions.transferNft721Condition.address, ), diff --git a/package.json b/package.json index 0f25b381f..9c0c518b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc9", + "version": "2.0.0-rc10", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index dd4d3c111..b06bd3b4d 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -661,7 +661,7 @@ export class NFT721Api extends NFTsBaseApi { return this.nevermined.services.node.getSubscriptionToken(did, account) } - public async isOperator(did: string, address: string): Promise { - return super.isOperator(did, address, 721) + public async isOperatorOfDID(did: string, address: string): Promise { + return super.isOperatorOfDID(did, address, 721) } } diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index f7da25917..1e7283b60 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -62,7 +62,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { ? this.nevermined.keeper.conditions.transferNftCondition.address : this.nevermined.keeper.conditions.transferNft721Condition.address - const isOperator = await this.isOperator(did, transferNftConditionAddress) + const isOperator = await this.isOperatorOfDID(did, transferNftConditionAddress) if (!isOperator) { throw new NFTError('Nevermined does not have operator role') } @@ -87,7 +87,11 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { * * @returns operator status of address as a boolean */ - public async isOperator(did: string, address: string, ercType: ERCType = 1155): Promise { + public async isOperatorOfDID( + did: string, + address: string, + ercType: ERCType = 1155, + ): Promise { const ddo = await this.nevermined.assets.resolve(did) const nftContractAddress = NFTsBaseApi.getNFTContractAddress(ddo, 'nft-sales') @@ -99,6 +103,28 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { return nftContract.isOperator(address) } + /** + * Check if a particular address is the operator of given a NFT address. + * + * @param nftContractAddress - The DID of the NFT to check + * @param operatorAddress - The address to check if operator status + * @param ercType - The erc type of the NFT. + * + * @returns operator status of address as a boolean + */ + public async isOperator( + nftContractAddress: string, + operatorAddress: string, + ercType: ERCType = 1155, + ): Promise { + const nftContract = + ercType == 1155 + ? await this.nevermined.contracts.loadNft1155Contract(nftContractAddress) + : await this.nevermined.contracts.loadNft721Contract(nftContractAddress) + + return nftContract.isOperator(operatorAddress) + } + /** * Get the details of an NFT * diff --git a/src/services/node/NeverminedNode.ts b/src/services/node/NeverminedNode.ts index 7e80b8291..e158d2fb2 100644 --- a/src/services/node/NeverminedNode.ts +++ b/src/services/node/NeverminedNode.ts @@ -403,10 +403,10 @@ export class NeverminedNode extends Instantiable { nftType: ercType, serviceIndex: serviceIndex && serviceIndex >= 0 ? serviceIndex : -1, }) - + this.logger.log(`Claiming NFT using endpoint: ${claimNFTEndpoint}`) const response = await this.nevermined.utils.fetch.post(claimNFTEndpoint, claimBody) - + if (!response.ok) { throw new HttpError(`${response.statusText} ${response.url}`, response.status) } diff --git a/test/config.ts b/test/config.ts index 156834966..e1074ae9b 100644 --- a/test/config.ts +++ b/test/config.ts @@ -3,7 +3,6 @@ import { LoggerInstance } from '../src/utils' LoggerInstance.setLevel(LogLevel.Error) - const config = { marketplaceUri: 'http://localhost:3100', neverminedNodeUri: 'http://localhost:8030', diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index ee3df775b..cfe908fb5 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -197,6 +197,7 @@ export default abstract class TestContractHandler extends ContractHandler { ZeroAddress, ], ) + transactionResponse = await erc1155.connect(signer).getFunction('grantOperatorRole')( await transferNftCondition.getAddress(), ) From 2d82d79fcec0f313c1adb5b0743f9219148a521b Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:48:31 +0200 Subject: [PATCH 109/151] fix: making it work with contracts v3.5.2 --- integration/nevermined/NVMAppFlows.ts | 5 +++-- integration/nevermined/Subscriptions.e2e.test.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integration/nevermined/NVMAppFlows.ts b/integration/nevermined/NVMAppFlows.ts index a54fb30c5..a17716360 100644 --- a/integration/nevermined/NVMAppFlows.ts +++ b/integration/nevermined/NVMAppFlows.ts @@ -120,8 +120,8 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { TestContractHandler.setConfig(config) const contractABI = await TestContractHandler.getABI( - 'NFT1155SubscriptionUpgradeable', - './test/resources/artifacts/', + `NFT1155SubscriptionUpgradeable.${await nevermined.keeper.getNetworkName()}`, + './artifacts/', ) subscriptionNFT = await SubscriptionCreditsNFTApi.deployInstance( config, @@ -133,6 +133,7 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { 'App Subscription NFT', 'CRED', '', + nevermined.keeper.nvmConfig.address, ], ) diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index 52cc8edb4..84b6bafac 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -152,7 +152,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { it('should grant Nevermined the operator role', async () => { assert.isTrue( - await nevermined.nfts721.isOperatorOfDID( + await nevermined.nfts721.isOperator( subscriptionDDO.id, nevermined.keeper.conditions.transferNft721Condition.address, ), From 027833629c39c1c8e1fb9ee8a6a1248a323ba5ab Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:53:57 +0200 Subject: [PATCH 110/151] test: fixing tests --- .../nevermined/Subscriptions.e2e.test.ts | 20 ++++++++++++++----- src/keeper/contracts/Nft721Contract.ts | 1 + src/nevermined/api/nfts/NFTsBaseApi.ts | 2 +- .../NFT721SubscriptionUpgradeable.json | 6 +++--- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/integration/nevermined/Subscriptions.e2e.test.ts b/integration/nevermined/Subscriptions.e2e.test.ts index 96849b34c..6c2ab7cfc 100644 --- a/integration/nevermined/Subscriptions.e2e.test.ts +++ b/integration/nevermined/Subscriptions.e2e.test.ts @@ -2,7 +2,15 @@ import chai, { assert } from 'chai' import chaiAsPromised from 'chai-as-promised' import { decodeJwt, JWTPayload } from 'jose' -import { Account, DDO, MetaData, Nevermined, AssetPrice, NFTAttributes } from '../../src' +import { + Account, + DDO, + MetaData, + Nevermined, + AssetPrice, + NFTAttributes, + jsonReplacer, +} from '../../src' import { EscrowPaymentCondition, TransferNFT721Condition, Token } from '../../src/keeper' import { config } from '../config' import { getMetadata } from '../utils' @@ -112,8 +120,9 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { TestContractHandler.setConfig(config) const contractABI = await TestContractHandler.getABI( - 'NFT721SubscriptionUpgradeable', - './test/resources/artifacts/', + // 'NFT721SubscriptionUpgradeable', + `NFT721SubscriptionUpgradeable.${await nevermined.keeper.getNetworkName()}`, + './artifacts/', ) subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, editor, [ editor.getId(), @@ -154,8 +163,9 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { it('should grant Nevermined the operator role', async () => { assert.isTrue( await nevermined.nfts721.isOperator( - subscriptionDDO.id, + subscriptionNFT.address, nevermined.keeper.conditions.transferNft721Condition.address, + 721, ), ) }) @@ -219,7 +229,7 @@ describe('Subscriptions using NFT ERC-721 End-to-End', () => { ) const minted = await subscriptionNFT.getContract.getMintedEntries(subscriber.getId()) - console.log(`Minted: ${JSON.stringify(minted)}`) + console.log(`Minted: ${JSON.stringify(minted, jsonReplacer)}`) assert.equal(await subscriptionNFT.balanceOf(subscriber.getId()), 1n) }) diff --git a/src/keeper/contracts/Nft721Contract.ts b/src/keeper/contracts/Nft721Contract.ts index 6d57acfc2..61e51cf2c 100644 --- a/src/keeper/contracts/Nft721Contract.ts +++ b/src/keeper/contracts/Nft721Contract.ts @@ -24,6 +24,7 @@ export class Nft721Contract extends NFTContractsBase { const solidityABI = await ContractHandler.getABI(contractName, artifactsFolder, networkName) + console.log(`Checking Address =${address}=`) await new ContractHandler(config).checkExists(address) nft.contract = new ethers.Contract(address, solidityABI.abi, nft.web3) nft.address = await nft.contract.getAddress() diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index 1e7283b60..af96e6cb7 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -118,7 +118,7 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { ercType: ERCType = 1155, ): Promise { const nftContract = - ercType == 1155 + ercType === 1155 ? await this.nevermined.contracts.loadNft1155Contract(nftContractAddress) : await this.nevermined.contracts.loadNft721Contract(nftContractAddress) diff --git a/test/resources/artifacts/NFT721SubscriptionUpgradeable.json b/test/resources/artifacts/NFT721SubscriptionUpgradeable.json index f48f20684..765694483 100644 --- a/test/resources/artifacts/NFT721SubscriptionUpgradeable.json +++ b/test/resources/artifacts/NFT721SubscriptionUpgradeable.json @@ -1266,8 +1266,8 @@ } ], "bytecode": "0x608060405234801561001057600080fd5b50613aca806100206000396000f3fe608060405234801561001057600080fd5b50600436106102725760003560e01c806301ffc9a71461027757806302acb9a61461029f57806305a14872146102b457806306fdde03146102d4578063081812fc146102e9578063095ea7b3146102fc578063108762d01461030f578063156e29f614610322578063162790551461033557806322e8e1e014610349578063237c49191461035f57806323b872dd14610372578063248a9ca31461038557806327ac0c58146103985780632a55205a146103ab5780632f2ff15d146103dd57806336568abe146103f05780633d6d35981461040357806340c10f191461040b57806342842e0e1461041e57806342966c681461043157806347c4ef2514610444578063572b6c05146104675780635ced058e1461047a5780635ea3ab851461048b5780636352211e1461049e5780636d70f7ae146104b15780636fac889b146104c45780636fd902e1146104eb57806370a08231146104f1578063715018a61461050457806382c947b71461050c57806385be5724146105265780638da5cb5b1461053b57806391d148541461054357806395d89b41146105565780639713c8071461055e578063a0712d6814610571578063a217fddf14610584578063a22cb4651461058c578063ab9de2301461059f578063b219f7d7146105a7578063b88d4fde146105ba578063c87b56dd146105cd578063cbd5a40e146105e0578063ce1b815f14610600578063d242310514610608578063d547741f1461061b578063dd1520021461062e578063e271d9ee14610641578063e8a3d48514610661578063e985e9c514610669578063e9c1e0451461067c578063f2fde38b1461068f575b600080fd5b61028a610285366004612c23565b6106a2565b60405190151581526020015b60405180910390f35b6102b26102ad366004612c60565b6106dd565b005b6102c76102c2366004612d5d565b610707565b6040516102969190612e76565b6102dc61092c565b6040516102969190612eda565b6102c76102f7366004612eed565b6109be565b6102b261030a366004612f06565b6109e5565b61028a61031d366004612c60565b610b11565b6102b2610330366004612f32565b610ba9565b61028a610343366004612c60565b3b151590565b610351610c40565b604051908152602001610296565b6102b261036d366004612f67565b610c51565b6102b2610380366004612fa3565b610c86565b610351610393366004612eed565b610cbe565b6102b26103a6366004612c60565b610cd3565b6103be6103b9366004612fe4565b610d3e565b604080516001600160a01b039093168352602083019190915201610296565b6102b26103eb366004613006565b610d94565b6102b26103fe366004613006565b610db0565b6102b2610e3a565b6102b2610419366004612f06565b610e5b565b6102b261042c366004612fa3565b611056565b6102b261043f366004612eed565b611071565b610457610452366004612eed565b61130f565b6040516102969493929190613036565b61028a610475366004612c60565b61140c565b6102c7610488366004612eed565b90565b610351610499366004613067565b611431565b6102c76104ac366004612eed565b611480565b61028a6104bf366004612c60565b6114b4565b6103517f3cf8e80a7a55dd870201fe38c468fe694473dbe8d59a63381f1da07dc1c2b65581565b43610351565b6103516104ff366004612c60565b61156e565b6102b2611687565b61035161051a366004612c60565b6001600160a01b031690565b610351600080516020613a5583398151915281565b6102c7611699565b61028a610551366004613006565b6116a8565b6102dc6116d3565b6102b261056c3660046130f7565b6116e2565b6102b261057f366004612eed565b611714565b610351600081565b6102b261059a36600461312c565b611725565b6102c7611737565b6102b26105b5366004612c60565b611746565b6102b26105c836600461315a565b6117ae565b6102dc6105db366004612eed565b6117ed565b6105f36105ee366004612c60565b61188d565b60405161029691906131d9565b6102c7611921565b6102b2610616366004613232565b6119ac565b6102b2610629366004613006565b611a08565b6102b261063c366004613266565b611a24565b61065461064f366004612c60565b611b4a565b604051610296919061332d565b6102dc611c3b565b61028a610677366004613371565b611c4a565b60ff546102c7906001600160a01b031681565b6102b261069d366004612c60565b611c84565b60006106ad82611cfa565b806106bc57506106bc82611d1b565b806106d757506001600160e01b0319821663152a902d60e11b145b92915050565b6106e5611d6b565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b03168061073d5750305b600061074882611dda565b9050806001600160a01b03811663dd152002610762611e74565b61010160009054906101000a90046001600160a01b03168c8c8c8c60ff60009054906101000a90046001600160a01b03166040518863ffffffff1660e01b81526004016107b5979695949392919061339f565b600060405180830381600087803b1580156107cf57600080fd5b505af11580156107e3573d6000803e3d6000fd5b5050505060005b855181101561087d57816001600160a01b03166327ac0c588783815181106108145761081461340c565b60200260200101516040518263ffffffff1660e01b81526004016108389190612e76565b600060405180830381600087803b15801561085257600080fd5b505af1158015610866573d6000803e3d6000fd5b50505050808061087590613438565b9150506107ea565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156108b957600080fd5b505af11580156108cd573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d160405161091891815260200190565b60405180910390a350979650505050505050565b60606097805461093b90613451565b80601f016020809104026020016040519081016040528092919081815260200182805461096790613451565b80156109b45780601f10610989576101008083540402835291602001916109b4565b820191906000526020600020905b81548152906001019060200180831161099757829003601f168201915b5050505050905090565b60006109c982611e7e565b506000908152609b60205260409020546001600160a01b031690565b60006109f082611480565b9050806001600160a01b0316836001600160a01b031603610a625760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a74611e74565b6001600160a01b03161480610a905750610a9081610677611e74565b610b025760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610a59565b610b0c8383611ea3565b505050565b600080610b1c611737565b90506001600160a01b038116610b355750600092915050565b604051630108762d60e41b81526001600160a01b0382169063108762d090610b61908690600401612e76565b602060405180830381865afa158015610b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba29190613485565b9392505050565b610bb38383610e5b565b600160fc60008481526020019081526020016000206001016000828254610bda91906134a2565b90915550506001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610c4c6101025490565b905090565b610c5c6104bf611e74565b610c785760405162461bcd60e51b8152600401610a59906134b5565b610c828282611f11565b5050565b610c97610c91611e74565b82611f37565b610cb35760405162461bcd60e51b8152600401610a59906134e0565b610b0c838383611f96565b600090815260c9602052604090206001015490565b610cdb611e74565b6001600160a01b0316610cec611699565b6001600160a01b03161480610d075750610d076104bf611e74565b610d235760405162461bcd60e51b8152600401610a599061352d565b610d3b600080516020613a55833981519152826120f5565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610d80908661355d565b610d8a9190613574565b9150509250929050565b610d9d82610cbe565b610da6816120ff565b610b0c8383612110565b610db8611e74565b6001600160a01b0316816001600160a01b031614610e305760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a59565b610c828282612197565b610e59600080516020613a55833981519152610e54611e74565b612197565b565b610e666104bf611e74565b80610e895750610e74611699565b6001600160a01b0316826001600160a01b0316145b610ed25760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b6044820152606401610a59565b610100541580610ee757506101005461010254105b610f285760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b6044820152606401610a59565b610f3761010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610f7490826135e4565b50610101546001600160a01b031663bb794d9282610f90611e74565b600143604051602001610fa694939291906136ba565b604051602081830303815290604052805190602001208360001b610fc8611e74565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b815260040161100894939291906136f9565b6020604051808303816000875af1158015611027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104b9190613485565b50610c82828261221c565b610b0c838383604051806020016040528060008152506117ae565b61107c6104bf611e74565b806110a7575061108a611e74565b6001600160a01b031661109c82611480565b6001600160a01b0316145b61110b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b6064820152608401610a59565b600160fc600083815260200190815260200160002060010160008282546111329190613739565b9091555050610101546001600160a01b031663bb794d9282611152611e74565b6001436040516020016111689493929190613763565b604051602081830303815290604052805190602001208360001b61118a611e74565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b81526004016111ca949392919061378c565b6020604051808303816000875af11580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d9190613485565b5061121781612325565b60005b6101036000611227611e74565b6001600160a01b03168152602081019190915260400160002054811015610c8257816101036000611256611e74565b6001600160a01b03166001600160a01b0316815260200190815260200160002082815481106112875761128761340c565b906000526020600020906003020160000154036112fd5761010360006112ab611e74565b6001600160a01b03166001600160a01b0316815260200190815260200160002081815481106112dc576112dc61340c565b60009182526020822060039091020181815560018101829055600201555050565b8061130781613438565b91505061121a565b600081815260fc602090815260408083208151608081018352815460ff1615158152600182015493810193909352600281015491830191909152600381018054849384936060938593838601919061136690613451565b80601f016020809104026020016040519081016040528092919081815260200182805461139290613451565b80156113df5780601f106113b4576101008083540402835291602001916113df565b820191906000526020600020905b8154815290600101906020018083116113c257829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b6000611416611921565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b8351811015611479578381815181106114525761145261340c565b60200260200101518261146591906134a2565b91508061147181613438565b915050611437565b5092915050565b60008061148c836123b6565b90506001600160a01b0381166106d75760405162461bcd60e51b8152600401610a59906137cc565b60ff546000906001600160a01b03166114df576106d7600080516020613a55833981519152836116a8565b60ff54604051630108762d60e41b81526001600160a01b039091169063108762d09061150f908590600401612e76565b602060405180830381865afa15801561152c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115509190613485565b806106d757506106d7600080516020613a55833981519152836116a8565b60008060005b6001600160a01b03841660009081526101036020526040902054811015611479576001600160a01b0384166000908152610103602052604081208054839081106115c0576115c061340c565b90600052602060002090600302016002015411801561166257506001600160a01b0384166000908152610103602052604090208054829081106116055761160561340c565b9060005260206000209060030201600101546000148061166257506001600160a01b03841660009081526101036020526040902080544391908390811061164e5761164e61340c565b906000526020600020906003020160010154115b15611675576116726001836134a2565b91505b8061167f81613438565b915050611574565b61168f611d6b565b610e5960006123d1565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606098805461093b90613451565b6116ed6104bf611e74565b6117095760405162461bcd60e51b8152600401610a59906134b5565b610b0c838383612423565b610d3b61171f611e74565b82610e5b565b610c82611730611e74565b83836124bb565b60ff546001600160a01b031690565b61174e611e74565b6001600160a01b031661175f611699565b6001600160a01b0316148061177a575061177a6104bf611e74565b6117965760405162461bcd60e51b8152600401610a599061352d565b610d3b600080516020613a5583398151915282612197565b6117bf6117b9611e74565b83611f37565b6117db5760405162461bcd60e51b8152600401610a59906134e0565b6117e784848484612585565b50505050565b606060006117f96125b8565b9050611804836125c2565b156118585760008151116118275760405180602001604052806000815250610ba2565b80611831846125df565b6040516020016118429291906137fe565b6040516020818303038152906040529392505050565b60008151116118765760405180602001604052806000815250610ba2565b80604051602001611842919061382d565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561191657838290600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050815260200190600101906118c6565b505050509050919050565b60008061192c611737565b90506001600160a01b03811661194457600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a69190613849565b91505090565b6119b4611e74565b6001600160a01b03166119c5611699565b6001600160a01b031614806119e057506119e06104bf611e74565b6119fc5760405162461bcd60e51b8152600401610a599061352d565b60fe610c8282826135e4565b611a1182610cbe565b611a1a816120ff565b610b0c8383612197565b600054610100900460ff1615808015611a445750600054600160ff909116105b80611a655750611a53306125f6565b158015611a65575060005460ff166001145b611ac85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a59565b6000805460ff191660011790558015611aeb576000805461ff0019166101001790555b611afa88888888888888612605565b8015611b40576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611b7f57611b7f612c7d565b604051908082528060200260200182016040528015611ba8578160200160208202803683370190505b50905060005b6001600160a01b03841660009081526101036020526040902054811015611479576001600160a01b038416600090815261010360205260409020805482908110611bfa57611bfa61340c565b906000526020600020906003020160020154828281518110611c1e57611c1e61340c565b602090810291909101015280611c3381613438565b915050611bae565b606060fe805461093b90613451565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff1680610ba25750610ba2826114b4565b611c8c611d6b565b6001600160a01b038116611cf15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a59565b610d3b816123d1565b60006001600160e01b03198216637965db0b60e01b14806106d757506106d7825b60006001600160e01b031982166380ac58cd60e01b1480611d4c57506001600160e01b03198216635b5e139f60e01b145b806106d757506301ffc9a760e01b6001600160e01b03198316146106d7565b611d73611e74565b6001600160a01b0316611d84611699565b6001600160a01b031614610e595760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a59565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611e6f5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610a59565b919050565b6000610c4c61266c565b611e87816125c2565b610d3b5760405162461bcd60e51b8152600401610a59906137cc565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611ed882611480565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610b0c82826135e4565b600080611f4383611480565b9050806001600160a01b0316846001600160a01b03161480611f6a5750611f6a8185611c4a565b80611f8e5750836001600160a01b0316611f83846109be565b6001600160a01b0316145b949350505050565b826001600160a01b0316611fa982611480565b6001600160a01b031614611fcf5760405162461bcd60e51b8152600401610a5990613866565b6001600160a01b0382166120315760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a59565b61203e838383600161269a565b826001600160a01b031661205182611480565b6001600160a01b0316146120775760405162461bcd60e51b8152600401610a5990613866565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a855283862080546000190190559087168086528386208054600101905586865260999094528285208054909216841790915590518493600080516020613a7583398151915291a4505050565b610c828282612110565b610d3b8161210b611e74565b612706565b61211a82826116a8565b610c8257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612153611e74565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6121a182826116a8565b15610c8257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556121d8611e74565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166122725760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a59565b61227b816125c2565b156122985760405162461bcd60e51b8152600401610a59906138ab565b6122a660008383600161269a565b6122af816125c2565b156122cc5760405162461bcd60e51b8152600401610a59906138ab565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b031916841790555183929190600080516020613a75833981519152908290a45050565b600061233082611480565b905061234081600084600161269a565b61234982611480565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a84528285208054600019019055878552609990935281842080549091169055519293508492600080516020613a75833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156124735760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610a59565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036125185760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610a59565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612590848484611f96565b61259c8484848461275f565b6117e75760405162461bcd60e51b8152600401610a59906138e1565b6060610c4c611c3b565b6000806125ce836123b6565b6001600160a01b0316141592915050565b60606106d7826125ee8461286e565b6001016128d8565b6001600160a01b03163b151590565b600054610100900460ff1661262c5760405162461bcd60e51b8152600401610a5990613933565b612634612a73565b61263c612a73565b6126468585612a9a565b61264e612ada565b612656612a73565b6126638787858585612b11565b50505050505050565b60006014361080159061268357506126833361140c565b15612695575060131936013560601c90565b503390565b6001600160a01b03841615806126b757506001600160a01b038316155b806126c857506126c86104bf611e74565b6127015760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610a59565b6117e7565b61271082826116a8565b610c825761271d81612bf7565b6127288360206128d8565b60405160200161273992919061397e565b60408051601f198184030181529082905262461bcd60e51b8252610a5991600401612eda565b6000612773846001600160a01b03166125f6565b1561286357836001600160a01b031663150b7a0261278f611e74565b8786866040518563ffffffff1660e01b81526004016127b194939291906139ed565b6020604051808303816000875af19250505080156127ec575060408051601f3d908101601f191682019092526127e991810190613a20565b60015b612849573d80801561281a576040519150601f19603f3d011682016040523d82523d6000602084013e61281f565b606091505b5080516000036128415760405162461bcd60e51b8152600401610a59906138e1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f8e565b506001949350505050565b600080608083901c156128865760809290921c916010015b604083901c1561289b5760409290921c916008015b602083901c156128b05760209290921c916004015b601083901c156128c55760109290921c916002015b600883901c156106d75760010192915050565b606060006128e783600261355d565b6128f29060026134a2565b6001600160401b0381111561290957612909612c7d565b6040519080825280601f01601f191660200182016040528015612933576020820181803683370190505b509050600360fc1b8160008151811061294e5761294e61340c565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061297d5761297d61340c565b60200101906001600160f81b031916908160001a90535060006129a184600261355d565b6129ac9060016134a2565b90505b6001811115612a24576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106129e0576129e061340c565b1a60f81b8282815181106129f6576129f661340c565b60200101906001600160f81b031916908160001a90535060049490941c93612a1d81613a3d565b90506129af565b508315610ba25760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a59565b600054610100900460ff16610e595760405162461bcd60e51b8152600401610a5990613933565b600054610100900460ff16612ac15760405162461bcd60e51b8152600401610a5990613933565b6097612acd83826135e4565b506098610b0c82826135e4565b600054610100900460ff16612b015760405162461bcd60e51b8152600401610a5990613933565b610e59612b0c611e74565b6123d1565b600054610100900460ff16612b385760405162461bcd60e51b8152600401610a5990613933565b612b57600080516020613a55833981519152612b52611e74565b6120f5565b612b6f600080516020613a55833981519152856120f5565b612b87600080516020613a55833981519152866120f5565b612b90836119ac565b61010082905560ff80546001600160a01b038084166001600160a01b031992831617909255610101805492871692909116919091179055612bcf611e74565b6001600160a01b0316856001600160a01b031614612bf057612bf085611c84565b5050505050565b60606106d76001600160a01b03831660146128d8565b6001600160e01b031981168114610d3b57600080fd5b600060208284031215612c3557600080fd5b8135610ba281612c0d565b6001600160a01b0381168114610d3b57600080fd5b8035611e6f81612c40565b600060208284031215612c7257600080fd5b8135610ba281612c40565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612cbb57612cbb612c7d565b604052919050565b60006001600160401b03831115612cdc57612cdc612c7d565b612cef601f8401601f1916602001612c93565b9050828152838383011115612d0357600080fd5b828260208301376000602084830101529392505050565b600082601f830112612d2b57600080fd5b610ba283833560208501612cc3565b60006001600160401b03821115612d5357612d53612c7d565b5060051b60200190565b600080600080600060a08688031215612d7557600080fd5b85356001600160401b0380821115612d8c57600080fd5b612d9889838a01612d1a565b9650602091508188013581811115612daf57600080fd5b612dbb8a828b01612d1a565b965050604088013581811115612dd057600080fd5b612ddc8a828b01612d1a565b95505060608801359350608088013581811115612df857600080fd5b88019050601f81018913612e0b57600080fd5b8035612e1e612e1982612d3a565b612c93565b81815260059190911b8201830190838101908b831115612e3d57600080fd5b928401925b82841015612e64578335612e5581612c40565b82529284019290840190612e42565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612ea5578181015183820152602001612e8d565b50506000910152565b60008151808452612ec6816020860160208601612e8a565b601f01601f19169290920160200192915050565b602081526000610ba26020830184612eae565b600060208284031215612eff57600080fd5b5035919050565b60008060408385031215612f1957600080fd5b8235612f2481612c40565b946020939093013593505050565b600080600060608486031215612f4757600080fd5b8335612f5281612c40565b95602085013595506040909401359392505050565b60008060408385031215612f7a57600080fd5b8235915060208301356001600160401b03811115612f9757600080fd5b610d8a85828601612d1a565b600080600060608486031215612fb857600080fd5b8335612fc381612c40565b92506020840135612fd381612c40565b929592945050506040919091013590565b60008060408385031215612ff757600080fd5b50508035926020909101359150565b6000806040838503121561301957600080fd5b82359150602083013561302b81612c40565b809150509250929050565b841515815283602082015282604082015260806060820152600061305d6080830184612eae565b9695505050505050565b6000602080838503121561307a57600080fd5b82356001600160401b0381111561309057600080fd5b8301601f810185136130a157600080fd5b80356130af612e1982612d3a565b81815260059190911b820183019083810190878311156130ce57600080fd5b928401925b828410156130ec578335825292840192908401906130d3565b979650505050505050565b60008060006060848603121561310c57600080fd5b833592506020840135612fd381612c40565b8015158114610d3b57600080fd5b6000806040838503121561313f57600080fd5b823561314a81612c40565b9150602083013561302b8161311e565b6000806000806080858703121561317057600080fd5b843561317b81612c40565b9350602085013561318b81612c40565b92506040850135915060608501356001600160401b038111156131ad57600080fd5b8501601f810187136131be57600080fd5b6131cd87823560208401612cc3565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b8281101561322557815180518552868101518786015285015185850152606090930192908501906001016131f6565b5091979650505050505050565b60006020828403121561324457600080fd5b81356001600160401b0381111561325a57600080fd5b611f8e84828501612d1a565b600080600080600080600060e0888a03121561328157600080fd5b873561328c81612c40565b9650602088013561329c81612c40565b955060408801356001600160401b03808211156132b857600080fd5b6132c48b838c01612d1a565b965060608a01359150808211156132da57600080fd5b6132e68b838c01612d1a565b955060808a01359150808211156132fc57600080fd5b506133098a828b01612d1a565b93505060a0880135915061331f60c08901612c55565b905092959891949750929550565b6020808252825182820181905260009190848201906040850190845b8181101561336557835183529284019291840191600101613349565b50909695505050505050565b6000806040838503121561338457600080fd5b823561338f81612c40565b9150602083013561302b81612c40565b600060018060a01b03808a168352808916602084015260e060408401526133c960e0840189612eae565b83810360608501526133db8189612eae565b905083810360808501526133ef8188612eae565b60a0850196909652509290921660c0909101525095945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161344a5761344a613422565b5060010190565b600181811c9082168061346557607f821691505b60208210810361188757634e487b7160e01b600052602260045260246000fd5b60006020828403121561349757600080fd5b8151610ba28161311e565b808201808211156106d7576106d7613422565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106d7576106d7613422565b60008261359157634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610b0c57600081815260208120601f850160051c810160208610156135bd5750805b601f850160051c820191505b818110156135dc578281556001016135c9565b505050505050565b81516001600160401b038111156135fd576135fd612c7d565b6136118161360b8454613451565b84613596565b602080601f831160018114613646576000841561362e5750858301515b600019600386901b1c1916600185901b1785556135dc565b600085815260208120601f198616915b8281101561367557888601518255948401946001909101908401613656565b50858210156136935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906136e39083016136a3565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a0820152600061305d60e083016136a3565b818103818111156106d7576106d7613422565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906136e390830161374c565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a0820152600061305d60e0830161374c565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351613810818460208801612e8a565b835190830190613824818360208801612e8a565b01949350505050565b6000825161383f818460208701612e8a565b9190910192915050565b60006020828403121561385b57600080fd5b8151610ba281612c40565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516139b0816017850160208801612e8a565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516139e1816028840160208801612e8a565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061305d90830184612eae565b600060208284031215613a3257600080fd5b8151610ba281612c0d565b600081613a4c57613a4c613422565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220226b11127bd8abfbb9aac8fb063a7cfe58665bcc594068743c344c08e8f33a2964736f6c63430008110033", - "address": "0x17d059d9298278BB0B4eFAc41e93B3AEEE1517dE", - "implementation": "0x3D4348D49B77c0C0a0E30018e518990c4f1f38e7", - "version": "v3.5.0", + "address": "0x168bc74Fd30D1559A0dF48cF61AC7dD4F23e1dA1", + "implementation": "0xA4DF3a00A815A75bC174338328D95a911F045d0E", + "version": "v3.5.2", "libraries": {} } \ No newline at end of file From 98b1dc4f550189676c34a0f76591ec307d1ab27a Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:20:15 +0200 Subject: [PATCH 111/151] fix: adapting to time subscriptions --- integration/nevermined/NVMAppFlows.ts | 255 +++++++++++++++--- integration/utils/utils.ts | 2 +- .../contracts/templates/NFTAccessTemplate.ts | 36 ++- src/utils/DDOHelpers.ts | 2 +- 4 files changed, 260 insertions(+), 35 deletions(-) diff --git a/integration/nevermined/NVMAppFlows.ts b/integration/nevermined/NVMAppFlows.ts index a17716360..a1a3784f1 100644 --- a/integration/nevermined/NVMAppFlows.ts +++ b/integration/nevermined/NVMAppFlows.ts @@ -16,6 +16,7 @@ import { SubscriptionCreditsNFTApi, } from '../../src/nevermined' import { mineBlocks } from '../utils/utils' +import { sleep } from '@opengsn/provider' chai.use(chaiAsPromised) @@ -27,7 +28,8 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { let nevermined: Nevermined let token: Token let transferNftCondition: TransferNFTCondition - let subscriptionDDO: DDO + let creditSubscriptionDDO: DDO + let timeSubscriptionDDO: DDO let datasetDDO: DDO let agreementId: string @@ -35,24 +37,29 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { const amounts1 = [15n, 5n] const amounts2 = [30n, 10n] let receivers: string[] + let subsBronzePrice: AssetPrice let subsSilverPrice: AssetPrice let subsGoldPrice: AssetPrice let royaltyAttributes: RoyaltyAttributes let subscriptionMetadata: MetaData + let timeSubscriptionMetadata: MetaData let datasetMetadata: MetaData const preMint = false const royalties = 0 const nftTransfer = false + const subscriptionBronzeDuration = 9 // in blocks const subscriptionSilverDuration = 10 // in blocks const subscriptionGoldDuration = 20 // in blocks + const subscriptionBronzePrice = 15n const subscriptionSilverPrice = 20n const subscriptionGoldPrice = 40n // This is the number of credits that the subscriber will get when purchase the subscription // In the DDO this will be added in the `_numberNFTs` value of the `nft-sales` service of the subscription + const subscriptionBronzeCredits = 1n const subscriptionSilverCredits = 15n const subscriptionGoldCredits = 50n // This is the number of credits that cost get access to the service attached to the subscription @@ -81,6 +88,7 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { payload = decodeJwt(config.marketplaceAuthToken) datasetMetadata = getMetadata() + timeSubscriptionMetadata = getMetadata(undefined, 'NVM App Time only Subscription') subscriptionMetadata = getMetadata(undefined, 'NVM App Credits Subscription') subscriptionMetadata.main.type = 'subscription' @@ -96,6 +104,13 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { // scale = 10n ** BigInt(await token.decimals()) receivers = [publisher.getId(), reseller.getId()] + subsBronzePrice = new AssetPrice( + new Map([ + [receivers[0], amounts1[0]], + [receivers[1], amounts1[1]], + ]), + ).setTokenAddress(token.address) + subsSilverPrice = new AssetPrice( new Map([ [receivers[0], amounts1[0]], @@ -159,7 +174,173 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { }) }) - describe('As publisher I can register a time based Smart Subscription', () => { + describe('As publisher I can register a TIME ONLY Smart Subscription', () => { + it('As publisher I can register a time based Smart Subscription as part of the NFT1155', async () => { + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: timeSubscriptionMetadata, + services: [ + { + serviceType: 'nft-sales', + price: subsBronzePrice, + nft: { + duration: subscriptionBronzeDuration, + amount: subscriptionBronzeCredits, + nftTransfer, + }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + timeSubscriptionDDO = await nevermined.nfts1155.create(nftAttributes, publisher) + + assert.equal(await subscriptionNFT.balance(timeSubscriptionDDO.id, publisher.getId()), 0n) + assert.isDefined(timeSubscriptionDDO) + console.log(`Subscription DID: ${timeSubscriptionDDO.id}`) + + salesServices = timeSubscriptionDDO.getServicesByType('nft-sales') + assert.equal(salesServices.length, 1) + }) + + it('As publisher I can register an off-chain dataset associated to a TIME ONLY subscription', async () => { + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: getMetadata(), + services: [ + { + serviceType: 'nft-access', + nft: { + tokenId: timeSubscriptionDDO.shortId(), + // TODO: Review + duration: subscriptionBronzeDuration, + amount: 0n, + nftTransfer, + }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + datasetDDO = await nevermined.nfts1155.create(nftAttributes, publisher, { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.OnlyOffchain, + }) + assert.isDefined(datasetDDO) + console.log(`Asset DID: ${datasetDDO.id}`) + + accessServices = datasetDDO.getServicesByType('nft-access') + assert.equal(accessServices.length, 1) + + const tokenId = DDO.getTokenIdFromService(accessServices[0]) + assert.equal(tokenId, timeSubscriptionDDO.shortId()) + + const amount = DDO.getNftAmountFromService(accessServices[0]) + assert.equal(amount, 0n) + }) + }) + + describe('As a subscriber I can purchase a TIME based Smart Subscription based on NFT1155', () => { + let agreementId: string + + it('I can order and claim the subscription', async () => { + await subscriber.requestTokens(subscriptionBronzePrice) + + const bronzeSalesService = timeSubscriptionDDO.getServicesByType('nft-sales')[0] + console.log( + `Bronze Sales Service with index ${bronzeSalesService.index} and Price ${bronzeSalesService.attributes.main.price}`, + ) + agreementId = await nevermined.nfts1155.order( + timeSubscriptionDDO.id, + subscriptionBronzeCredits, + subscriber, + bronzeSalesService.index, + ) + assert.isDefined(agreementId) + + try { + const receipt = await nevermined.nfts1155.claim( + agreementId, + publisher.getId(), + subscriber.getId(), + subscriptionBronzeCredits, + timeSubscriptionDDO.id, + bronzeSalesService.index, + ) + assert.isTrue(receipt) + } catch (e) { + console.error(e.message) + assert.fail(e.message) + } + }) + + it('I can download a dataset using my subscription', async () => { + const balanceBefore = await subscriptionNFT.balance( + timeSubscriptionDDO.id, + subscriber.getId(), + ) + console.log(`Balance Before: ${balanceBefore}`) + + console.log(`Time based AgreementId: ${agreementId}`) + for (let i = 0; i < 3; i++) { + const result = await nevermined.nfts1155.access( + datasetDDO.id, + subscriber, + '/tmp/.nevermined/downloads/0/', + undefined, + agreementId, + ) + await sleep(1000) + assert.isTrue(result) + console.log(`Asset downloaded ${i} time/s`) + } + + const minted = await subscriptionNFT.getContract.getMintedEntries( + subscriber.getId(), + timeSubscriptionDDO.shortId(), + ) + console.log(`Current Block Number: ${await nevermined.web3.getBlockNumber()}`) + console.log(`Minted entries: ${minted.length}`) + minted.map((m) => + console.log( + `Minted ${m.amountMinted} tokens on block ${m.mintBlock} and expiring on ${m.expirationBlock} block`, + ), + ) + + const balanceAfter = await subscriptionNFT.balance(timeSubscriptionDDO.id, subscriber.getId()) + console.log(`Balance After: ${balanceAfter}`) + + assert.equal(balanceBefore, balanceAfter) + }) + }) + + describe('Subscriptions expires', () => { + it('When subscription expires my balance is back to 0', async () => { + await mineBlocks(nevermined, subscriber, subscriptionBronzeDuration + 1) + const balanceAfter = await subscriptionNFT.balance(timeSubscriptionDDO.id, subscriber.getId()) + console.log(`Balance After Expiring duration: ${balanceAfter}`) + assert.isTrue(balanceAfter === 0n) + }) + + it('As a subscriber I can not access to the dataset using my expired subscription', async () => { + try { + await nevermined.nfts1155.access( + datasetDDO.id, + subscriber, + '/tmp/.nevermined/downloads/0/', + undefined, + agreementId, + ) + assert.fail('Should not be able to access the dataset') + } catch (e) { + assert.isTrue(true) + } + }) + }) + + describe('As publisher I can register a TIME & CREDITS based Smart Subscription', () => { it('As publisher I can register a time based Smart Subscription as part of the NFT1155', async () => { const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ metadata: subscriptionMetadata, @@ -188,13 +369,13 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { preMint, royaltyAttributes: royaltyAttributes, }) - subscriptionDDO = await nevermined.nfts1155.create(nftAttributes, publisher) + creditSubscriptionDDO = await nevermined.nfts1155.create(nftAttributes, publisher) - assert.equal(await subscriptionNFT.balance(subscriptionDDO.id, publisher.getId()), 0n) - assert.isDefined(subscriptionDDO) - console.log(`Subscription DID: ${subscriptionDDO.id}`) + assert.equal(await subscriptionNFT.balance(creditSubscriptionDDO.id, publisher.getId()), 0n) + assert.isDefined(creditSubscriptionDDO) + console.log(`Subscription DID: ${creditSubscriptionDDO.id}`) - salesServices = subscriptionDDO.getServicesByType('nft-sales') + salesServices = creditSubscriptionDDO.getServicesByType('nft-sales') assert.equal(salesServices.length, 2) assert.equal( salesServices[0].attributes.main.price.toString(), @@ -206,14 +387,14 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { ) }) - it('As publisher I can register an off-chain dataset associated to a time subscription', async () => { + it('As publisher I can register an off-chain dataset associated to a time and credits subscription', async () => { const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ metadata: datasetMetadata, services: [ { serviceType: 'nft-access', nft: { - tokenId: subscriptionDDO.shortId(), + tokenId: creditSubscriptionDDO.shortId(), // TODO: Review duration: subscriptionSilverDuration, amount: accessCostInCreditsDataset, @@ -237,24 +418,24 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { assert.equal(accessServices.length, 1) const tokenId = DDO.getTokenIdFromService(accessServices[0]) - assert.equal(tokenId, subscriptionDDO.shortId()) + assert.equal(tokenId, creditSubscriptionDDO.shortId()) }) it.skip('As a publisher I can register an off-chain webservice associated to a time subscription', async () => {}) }) - describe('As a subscriber I can purchase a time based Smart Subscription based on NFT1155', () => { + describe('As a subscriber I can purchase a time and credits based Smart Subscription based on NFT1155', () => { let agreementId: string it('I can order and claim the subscription', async () => { await subscriber.requestTokens(subscriptionSilverPrice) - const silverSalesService = subscriptionDDO.getServicesByType('nft-sales')[0] + const silverSalesService = creditSubscriptionDDO.getServicesByType('nft-sales')[0] console.log( `Silver Sales Service with index ${silverSalesService.index} and Price ${silverSalesService.attributes.main.price}`, ) agreementId = await nevermined.nfts1155.order( - subscriptionDDO.id, + creditSubscriptionDDO.id, subscriptionSilverCredits, subscriber, silverSalesService.index, @@ -267,7 +448,7 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { publisher.getId(), subscriber.getId(), subscriptionSilverCredits, - subscriptionDDO.id, + creditSubscriptionDDO.id, silverSalesService.index, ) assert.isTrue(receipt) @@ -278,7 +459,10 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { }) it('I can download a dataset using my subscription', async () => { - const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + const balanceBefore = await subscriptionNFT.balance( + creditSubscriptionDDO.id, + subscriber.getId(), + ) console.log(`Balance Before: ${balanceBefore}`) console.log(`First AgreementId: ${agreementId}`) @@ -291,7 +475,10 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { ) assert.isTrue(result) - const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + const balanceAfter = await subscriptionNFT.balance( + creditSubscriptionDDO.id, + subscriber.getId(), + ) console.log(`Balance After: ${balanceAfter}`) assert.equal(balanceBefore - accessCostInCreditsDataset, balanceAfter) @@ -303,7 +490,10 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { describe('Subscriptions expires', () => { it('When subscription expires my balance is back to 0', async () => { await mineBlocks(nevermined, subscriber, subscriptionSilverDuration + 1) - const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + const balanceAfter = await subscriptionNFT.balance( + creditSubscriptionDDO.id, + subscriber.getId(), + ) console.log(`Balance After Expiring duration: ${balanceAfter}`) assert.isTrue(balanceAfter === 0n) }) @@ -328,13 +518,13 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { describe('As a subscriber I want to topup my subscription purchasing a GOLD plan', () => { it('I check the details of the subscription NFT', async () => { - const details = await nevermined.nfts1155.details(subscriptionDDO.id) + const details = await nevermined.nfts1155.details(creditSubscriptionDDO.id) assert.equal(details.owner, publisher.getId()) }) it('I am ordering the GOLD plan associated to the subscription NFT', async () => { const balanceBeforeTopup = await subscriptionNFT.balance( - subscriptionDDO.id, + creditSubscriptionDDO.id, subscriber.getId(), ) @@ -342,12 +532,12 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { await subscriber.requestTokens(subscriptionGoldPrice) - const goldSalesService = subscriptionDDO.getServicesByType('nft-sales')[1] + const goldSalesService = creditSubscriptionDDO.getServicesByType('nft-sales')[1] console.log( `Gold Sales Service with index ${goldSalesService.index} and Price ${goldSalesService.attributes.main.price}`, ) agreementId = await nevermined.nfts1155.order( - subscriptionDDO.id, + creditSubscriptionDDO.id, subscriptionGoldCredits, subscriber, goldSalesService.index, @@ -361,7 +551,7 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { publisher.getId(), subscriber.getId(), subscriptionGoldCredits, - subscriptionDDO.id, + creditSubscriptionDDO.id, goldSalesService.index, ) assert.isTrue(receipt) @@ -371,14 +561,14 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { } const balanceAfterTopup = await subscriptionNFT.balance( - subscriptionDDO.id, + creditSubscriptionDDO.id, subscriber.getId(), ) console.log(`Balance After Topup: ${balanceAfterTopup}`) const minted = await subscriptionNFT.getContract.getMintedEntries( subscriber.getId(), - subscriptionDDO.shortId(), + creditSubscriptionDDO.shortId(), ) console.log(`Current Block Number: ${await nevermined.web3.getBlockNumber()}`) console.log(`Minted entries: ${minted.length}`) @@ -392,7 +582,10 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { }) it('I can download again using my toped up subscription', async () => { - const balanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + const balanceBefore = await subscriptionNFT.balance( + creditSubscriptionDDO.id, + subscriber.getId(), + ) console.log(`Balance Before: ${balanceBefore}`) console.log(`Using Agreement Id ${agreementId}`) @@ -403,20 +596,18 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { undefined, agreementId, ) - // for (let i = 0; i < 5; i++) { - // await nevermined.nfts1155.access(datasetDDO.id, subscriber, '/tmp/', undefined, agreementId) - // await sleep(1000) - // console.log(`Balance After Access: ${await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId())}`) - // } assert.isTrue(result) - const balanceAfter = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + const balanceAfter = await subscriptionNFT.balance( + creditSubscriptionDDO.id, + subscriber.getId(), + ) console.log(`Balance After: ${balanceAfter}`) const minted = await subscriptionNFT.getContract.getMintedEntries( subscriber.getId(), - subscriptionDDO.shortId(), + creditSubscriptionDDO.shortId(), ) console.log(`Current Block Number: ${await nevermined.web3.getBlockNumber()}`) console.log(`Minted entries: ${minted.length}`) diff --git a/integration/utils/utils.ts b/integration/utils/utils.ts index e8d38e200..ee4dc0838 100644 --- a/integration/utils/utils.ts +++ b/integration/utils/utils.ts @@ -49,7 +49,7 @@ export async function mineBlocks(nevermined: Nevermined, account: Account, block account.getId(), account.getId(), ethers.zeroPadValue('0x', 32), - 'mining', + `miningBlock${index}`, account, ) await sleep(100) diff --git a/src/keeper/contracts/templates/NFTAccessTemplate.ts b/src/keeper/contracts/templates/NFTAccessTemplate.ts index cd409a004..87628aaf6 100644 --- a/src/keeper/contracts/templates/NFTAccessTemplate.ts +++ b/src/keeper/contracts/templates/NFTAccessTemplate.ts @@ -72,6 +72,38 @@ export class NFTAccessTemplate extends BaseTemplate { + await this.validateAgreement( + params.agreement_id, + params.did, + await this.paramsGen(params), + from, + await this.extraGen(params), + txparams, + ) + } + + public async validateAgreement( + agreement_id: string, + did: string, + params: NFTAccessTemplateParams, + from: Account, + extra: any = {}, + txparams?: TxParameters, + ): Promise { + const ddo = await this.nevermined.assets.resolve(did) + const metadataService = ddo.findServiceByType('metadata') + const isNft1155Credit = + metadataService.attributes.main.nftType.toString() === + NeverminedNFT1155Type.nft1155Credit.toString() + if (isNft1155Credit) return + return this.validateAgreement(agreement_id, did, params, from, extra, txparams) + } + public async accept(params: ValidationParams): Promise { const ddo = await this.nevermined.assets.resolve(params.did) @@ -129,11 +161,13 @@ export class NFTAccessTemplate extends BaseTemplate= 1 ? nftAmount.toString() : '1' + return nftAmount.toString() case 'tokenAddress': return erc20TokenContract case 'contract': From fd20f69f4bc491a067487fad8b367c15f25dbb9b Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:33:52 +0200 Subject: [PATCH 112/151] ci: using more reliable source of data --- integration/utils/ddo-metadata-generator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration/utils/ddo-metadata-generator.ts b/integration/utils/ddo-metadata-generator.ts index c7c65fb4f..7ddeae5bf 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/integration/utils/ddo-metadata-generator.ts @@ -12,12 +12,12 @@ const metadata: Partial = { { index: 0, contentType: 'application/json', - url: 'https://github.com/nevermined-io/docs-legacy/raw/master/docs/architecture/specs/metadata/examples/ddo-example.json', + url: 'https://storage.googleapis.com/nvm-static-assets/files/ci/ddo-example.json', }, { index: 1, contentType: 'text/plain', - url: 'https://github.com/nevermined-io/docs-legacy/raw/master/README.md', + url: 'https://storage.googleapis.com/nvm-static-assets/files/ci/README.md', }, ], }, From 8f4879a6c16991172c893a4dade5cbfa1806c205 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:41:30 +0200 Subject: [PATCH 113/151] test: fixing assets test --- integration/nevermined/Assets.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/nevermined/Assets.test.ts b/integration/nevermined/Assets.test.ts index e119af427..5110c17c2 100644 --- a/integration/nevermined/Assets.test.ts +++ b/integration/nevermined/Assets.test.ts @@ -207,7 +207,7 @@ describe('Assets', () => { }) it('should be able to download the updated files', async () => { - const folder = fs.mkdirSync('/tmp/sdk-js/updated-files', { recursive: true }) + const folder = '/tmp/sdk-js/updated-files' const path = (await nevermined.assets.download(ddo.id, publisher, folder, -1)) as string assert.include(path, folder, 'The storage path is not correct.') From 467d492cc04c58f0fdc1e8f51daecdb7e8babcae Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 3 Oct 2023 08:39:24 +0200 Subject: [PATCH 114/151] chore: adding v2.0.0-rc10 Changelog updates --- CHANGELOG.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ce473d52..ab12e3321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,14 +66,32 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc1...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc10...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc10](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc1...v2.0.0-rc10) + +> 2 October 2023 + +- updating for contracts 3.5.0 [`#584`](https://github.com/nevermined-io/sdk-js/pull/584) +- Feat/node 18 [`#580`](https://github.com/nevermined-io/sdk-js/pull/580) +- Getting url from DDO when claiming NFT [`#582`](https://github.com/nevermined-io/sdk-js/pull/582) +- Fix/arbitrum fees [`#577`](https://github.com/nevermined-io/sdk-js/pull/577) +- Making Curve & Aave contracts optional [`#576`](https://github.com/nevermined-io/sdk-js/pull/576) +- Allowing to update files and services private stuff (SDKv1) [`#575`](https://github.com/nevermined-io/sdk-js/pull/575) +- fix: allowing to update files and services private metadata [`#574`](https://github.com/nevermined-io/sdk-js/pull/574) +- Allow off-chain register and resolve methods [`#573`](https://github.com/nevermined-io/sdk-js/pull/573) +- chore(deps): bump whatwg-url from 7.1.0 to 13.0.0 [`#527`](https://github.com/nevermined-io/sdk-js/pull/527) +- test: validating downloads by owner without access service [`#570`](https://github.com/nevermined-io/sdk-js/pull/570) +- Adapting to contracts v3.3.x [`#566`](https://github.com/nevermined-io/sdk-js/pull/566) +- E2E integration with Credit Subscriptions [`#563`](https://github.com/nevermined-io/sdk-js/pull/563) +- Feat/update mocha [`#564`](https://github.com/nevermined-io/sdk-js/pull/564) +- feat: reduce number of calls to chainId [`#560`](https://github.com/nevermined-io/sdk-js/pull/560) - Support of assets with multiple services of the same type [`#555`](https://github.com/nevermined-io/sdk-js/pull/555) -- feat: make keeper network info static [`89511f1`](https://github.com/nevermined-io/sdk-js/commit/89511f11140398c146246a19438e958938b83376) -- fix: bring back network info getters [`1ef0547`](https://github.com/nevermined-io/sdk-js/commit/1ef05470e53cbe91fcba5aa6e951bbd10b60decc) -- chore: coming back to original attribute name [`941f96f`](https://github.com/nevermined-io/sdk-js/commit/941f96f485fee18398fe7e1517e8a43e85361754) +- test: e2e tests for credit subscriptions [`5070f31`](https://github.com/nevermined-io/sdk-js/commit/5070f319baaa7fa361e103c6e1a4ffac2548012f) +- fix: resolving integration problems [`87d7beb`](https://github.com/nevermined-io/sdk-js/commit/87d7beb3eb3897bcf7b5babb510d118f05d36c73) +- test: e2e testing of NVM App flows [`886f0ae`](https://github.com/nevermined-io/sdk-js/commit/886f0ae27dab2dc6b1205f6b35c5861a5efaf9e2) #### [v2.0.0-rc1](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc0...v2.0.0-rc1) From e85a141336b9ced2d65d012a1bf8183189f1c139 Mon Sep 17 00:00:00 2001 From: enrique Date: Tue, 3 Oct 2023 09:13:32 +0200 Subject: [PATCH 115/151] fix: signTypedData --- src/nevermined/utils/JwtUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index 34104422c..d3491ff75 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -55,7 +55,7 @@ export class EthSignJWT extends SignJWT { message: eip712Data.message, token: decoder.decode(data), } - sign = await (signer as any)._signTypedData(domain, types, value) + sign = await signer.signTypedData(domain, types, value) } else { sign = await EthSignJWT.signText(decoder.decode(data), signer) } From f7d7f504faef71d5dc25dcf22a3b453fa7b2991c Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:37:04 +0200 Subject: [PATCH 116/151] fix: form-data lib was missing --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 94854e790..352cb1622 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc10", + "version": "2.0.0-rc11", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", @@ -59,6 +59,7 @@ "ethers": "^6.7.1", "graphql": "^16.7.1", "https-browserify": "^1.0.0", + "form-data": "^4.0.0", "jose": "^4.5.1", "js-file-download": "^0.4.12", "lodash": "^4.17.21", From 222bec960167fa95caabcff30d29fef68623332a Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:41:52 +0200 Subject: [PATCH 117/151] chore: adding v2.0.0-rc11 Changelog updates --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab12e3321..475aa06d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc10...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc11...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc11](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc10...v2.0.0-rc11) + +> 3 October 2023 + +- fix: form-data lib was missing [`#588`](https://github.com/nevermined-io/sdk-js/pull/588) +- fix: signTypedData [`#587`](https://github.com/nevermined-io/sdk-js/pull/587) +- test: e2e testing of NVM App flows [`#585`](https://github.com/nevermined-io/sdk-js/pull/585) +- chore: adding v2.0.0-rc10 Changelog updates [`467d492`](https://github.com/nevermined-io/sdk-js/commit/467d492cc04c58f0fdc1e8f51daecdb7e8babcae) + #### [v2.0.0-rc10](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc1...v2.0.0-rc10) > 2 October 2023 From f93664d07747e6e714f43d51ccf4d5184e3201fe Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:57:11 +0200 Subject: [PATCH 118/151] test: fix services e2e services flow --- integration/external/Services.e2e.test.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index dfdd99c99..6b79ad7e5 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -9,7 +9,12 @@ import { NFTAttributes, ResourceAuthentication, } from '../../src' -import { EscrowPaymentCondition, TransferNFT721Condition, Token } from '../../src/keeper' +import { + EscrowPaymentCondition, + TransferNFT721Condition, + Token, + ContractHandler, +} from '../../src/keeper' import { config } from '../config' import { generateWebServiceMetadata, getMetadata } from '../utils' import TestContractHandler from '../../test/keeper/TestContractHandler' @@ -209,10 +214,12 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { // Deploy NFT TestContractHandler.setConfig(config) - const contractABI = await TestContractHandler.getABI( + const contractABI = await ContractHandler.getABI( 'NFT721SubscriptionUpgradeable', - './test/resources/artifacts/', + config.artifactsFolder, + await nevermined.keeper.getNetworkName(), ) + subscriptionNFT = await SubscriptionNFTApi.deployInstance(config, contractABI, publisher, [ publisher.getId(), nevermined.keeper.didRegistry.address, @@ -346,13 +353,17 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) assert.equal(subscriberBalanceBefore, initialBalances.subscriber + subscriptionPrice) + console.log(`Subscriber balance before: ${subscriberBalanceBefore}`) + agreementId = await nevermined.nfts721.order(subscriptionDDO.id, subscriber) assert.isDefined(agreementId) const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) - assert.equal(subscriberBalanceAfter, subscriberBalanceAfter - initialBalances.subscriber) + console.log(`Subscriber balance after: ${subscriberBalanceAfter}`) + + assert.isTrue(subscriberBalanceAfter < subscriberBalanceBefore) }) it('The Publisher can check the payment and transfer the NFT to the Subscriber', async () => { @@ -491,11 +502,13 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { ) assert.equal(result.totalResults.value, 1) + // console.log(`QUERY RESULTS = ${JSON.stringify(result.results)}`) + assert.isTrue( result.results.every((r) => r .findServiceByType('metadata') - .attributes.main.webService.openEndpoints.some((e) => e === '/openapi.json'), + .attributes.main.webService.openEndpoints.some((e) => e.includes('.json')), ), ) }) From e97c3acfb5b80d22aca29328e92f2c9f66a153bd Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:34:43 +0200 Subject: [PATCH 119/151] fix: adaptations and tests for NVM App 1155 flows --- integration/external/Datasets.e2e.test.ts | 6 +- .../external/Services_NFT1155.e2e.test.ts | 553 ++++++++++++++++++ ...2e.test.ts => Services_NFT721.e2e.test.ts} | 4 +- integration/nevermined/NVMAppFlows.ts | 1 - package.json | 2 +- src/nevermined/api/SearchApi.ts | 87 ++- src/nevermined/api/nfts/NFT721Api.ts | 21 - src/nevermined/api/nfts/NFTsBaseApi.ts | 21 + 8 files changed, 651 insertions(+), 44 deletions(-) create mode 100644 integration/external/Services_NFT1155.e2e.test.ts rename integration/external/{Services.e2e.test.ts => Services_NFT721.e2e.test.ts} (99%) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index 91c6b70d3..b533384f2 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -335,7 +335,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve subscriptions purchased', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber) + const result = await nevermined.search.subscriptionsPurchased(subscriber, 721) assert.isAbove(result.totalResults.value, 1) const dids = result.results.map((ddo) => ddo.id) @@ -363,7 +363,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve subscriptions purchased filtering by tags', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber, tagsFilter) + const result = await nevermined.search.subscriptionsPurchased(subscriber, 721, tagsFilter) assert.isAbove(result.totalResults.value, 1) assert.isTrue( @@ -376,7 +376,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should not be able to retrieve not subscriptions purchased filtering by tags which do not exist', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber, tagsFilter2) + const result = await nevermined.search.subscriptionsPurchased(subscriber, 721, tagsFilter2) assert.equal(result.totalResults.value, 0) }) diff --git a/integration/external/Services_NFT1155.e2e.test.ts b/integration/external/Services_NFT1155.e2e.test.ts new file mode 100644 index 000000000..0a162110b --- /dev/null +++ b/integration/external/Services_NFT1155.e2e.test.ts @@ -0,0 +1,553 @@ +import { assert } from 'chai' +import { decodeJwt, JWTPayload } from 'jose' +import { + Account, + DDO, + MetaData, + Nevermined, + AssetPrice, + NFTAttributes, + ResourceAuthentication, +} from '../../src' +import { + EscrowPaymentCondition, + TransferNFTCondition, + Token, + ContractHandler, +} from '../../src/keeper' +import { config } from '../config' +import { generateWebServiceMetadata, getMetadata } from '../utils' +import TestContractHandler from '../../test/keeper/TestContractHandler' +import { ethers } from 'ethers' +import { didZeroX } from '../../src/utils' +import { EventOptions } from '../../src/events' +import { + getRoyaltyAttributes, + RoyaltyAttributes, + RoyaltyKind, + DID, + NFT1155Api, + SubscriptionCreditsNFTApi, + PublishMetadataOptions, + PublishOnChainOptions, +} from '../../src/nevermined' +import { RequestInit } from 'node-fetch' +import fetch from 'node-fetch' + +describe('Gate-keeping of Web Services using NFT ERC-1155 End-to-End', () => { + let publisher: Account + let subscriber: Account + let reseller: Account + + let nevermined: Nevermined + let token: Token + let escrowPaymentCondition: EscrowPaymentCondition + let transferNftCondition: TransferNFTCondition + let subscriptionDDO: DDO + let serviceDDO: DDO + + let agreementId: string + + // Configuration of First Sale: + // Editor -> Subscriber, the Reseller get a cut (25%) + let subscriptionPrice = 20n + let amounts = [15n, 5n] + let receivers: string[] + let assetPrice: AssetPrice + let royaltyAttributes: RoyaltyAttributes + + let subscriptionMetadata: MetaData + let serviceMetadata: MetaData + + const preMint = false + const royalties = 0 + const nftTransfer = false + const subscriptionDuration = 1000 // in blocks + const subscriptionCredits = 10n // How much credits are giving purchasing the subscription + const costServiceInCredits = 1n // How many credits cost every access to the service + + // The service to register into Nevermined and attach to a subscription + const SERVICE_ENDPOINT = process.env.SERVICE_ENDPOINT || 'http://127.0.0.1:3000' + + // The path of the SERVICE_ENDPOINT open that can be accessed via Proxy without authentication + const OPEN_PATH = process.env.OPEN_PATH || '/openapi.json' + + const SKIP_OPEN_ENDPOINT = process.env.SKIP_OPEN_ENDPOINT === 'true' + + // The URL of the OPEN API endpoint that can be accessed via Proxy without authentication + const OPEN_ENDPOINT = process.env.OPEN_ENDPOINT || `${SERVICE_ENDPOINT}${OPEN_PATH}` + + // We separate how the authorization of the service is done. + // If oauth we will use the AUTHORIZATION_TOKEN env + // If basic we will use the AUTHORIZATION_USER and AUTHORIZATION_PASSWORD envs + const AUTHORIZATION_TYPE = (process.env.AUTHORIZATION_TYPE || + 'oauth') as ResourceAuthentication['type'] + + // The http authorization bearer token required by the service + const AUTHORIZATION_TOKEN = process.env.AUTHORIZATION_TOKEN || 'new_authorization_token' + + // If the Authe + const AUTHORIZATION_USER = process.env.AUTHORIZATION_USER || 'user' + + const AUTHORIZATION_PASSWORD = process.env.AUTHORIZATION_PASSWORD || 'password' + + // The NVM proxy that will be used to authorize the service requests + const PROXY_URL = process.env.PROXY_URL || 'http://127.0.0.1:3128' + + // Required because we are dealing with self signed certificates locally + process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' + + // let proxyAgent + const opts: RequestInit = {} + + let initialBalances: any + let scale: bigint + + // let nft: ethers.Contract + let subscriptionNFT: NFT1155Api + let neverminedNodeAddress + + let payload: JWTPayload + + let accessToken: string + + before(async () => { + TestContractHandler.setConfig(config) + + nevermined = await Nevermined.getInstance(config) + ;[, publisher, subscriber, , reseller] = await nevermined.accounts.list() + + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(publisher) + + await nevermined.services.marketplace.login(clientAssertion) + payload = decodeJwt(config.marketplaceAuthToken) + + neverminedNodeAddress = await nevermined.services.node.getProviderAddress() + + // conditions + ;({ escrowPaymentCondition, transferNftCondition } = nevermined.keeper.conditions) + + // components + ;({ token } = nevermined.keeper) + + scale = 10n ** BigInt(await token.decimals()) + + subscriptionPrice = subscriptionPrice * scale + amounts = amounts.map((v) => v * scale) + receivers = [publisher.getId(), reseller.getId()] + assetPrice = new AssetPrice( + new Map([ + [receivers[0], amounts[0]], + [receivers[1], amounts[1]], + ]), + ).setTokenAddress(token.address) + + royaltyAttributes = getRoyaltyAttributes(nevermined, RoyaltyKind.Standard, royalties) + + initialBalances = { + editor: await token.balanceOf(publisher.getId()), + subscriber: await token.balanceOf(subscriber.getId()), + reseller: await token.balanceOf(reseller.getId()), + escrowPaymentCondition: Number(await token.balanceOf(escrowPaymentCondition.address)), + } + + console.log(`USING CONFIG:`) + console.log(` PROXY_URL=${PROXY_URL}`) + console.log(` SERVICE_ENDPOINT=${SERVICE_ENDPOINT}`) + console.log(` OPEN_ENDPOINT=${OPEN_ENDPOINT}`) + console.log(` AUTHORIZATION_TYPE=${AUTHORIZATION_TYPE}`) + if (AUTHORIZATION_TYPE === 'oauth') console.log(` AUTHORIZATION_TOKEN=${AUTHORIZATION_TOKEN}`) + else { + console.log(` AUTHORIZATION_USER=${AUTHORIZATION_USER}`) + console.log(` AUTHORIZATION_PASSWORD=${AUTHORIZATION_PASSWORD}`) + } + console.log(` REQUEST_DATA=${process.env.REQUEST_DATA}`) + }) + + describe('As Subscriber I want to get access to a web service I am not subscribed', () => { + it('The subscriber can not access the service endpoints because does not have a subscription yet', async () => { + const result = await fetch(SERVICE_ENDPOINT, opts) + + assert.isFalse(result.ok) + assert.isTrue(result.status >= 400) + }) + }) + + describe('As Publisher I want to register new web service and provide access via subscriptions to it', () => { + it('I want to register a subscription NFT that gives access to a web service to the holders', async () => { + // Deploy NFT + TestContractHandler.setConfig(config) + + const contractABI = await ContractHandler.getABI( + 'NFT1155SubscriptionUpgradeable', + config.artifactsFolder, + await nevermined.keeper.getNetworkName(), + ) + + subscriptionNFT = await SubscriptionCreditsNFTApi.deployInstance( + config, + contractABI, + publisher, + [ + publisher.getId(), + nevermined.keeper.didRegistry.address, + 'Subscription Service NFT1155', + 'NVM', + '', + nevermined.keeper.nvmConfig.address, + ], + ) + + await nevermined.contracts.loadNft1155(subscriptionNFT.address) + + await subscriptionNFT.grantOperatorRole(transferNftCondition.address, publisher) + + const isOperator = await subscriptionNFT.getContract.isOperator(transferNftCondition.address) + assert.isTrue(isOperator) + + subscriptionMetadata = getMetadata(undefined, 'Service Subscription NFT1155') + subscriptionMetadata.main.type = 'subscription' + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: subscriptionMetadata, + services: [ + { + serviceType: 'nft-sales', + price: assetPrice, + nft: { + duration: subscriptionDuration, + amount: subscriptionCredits, + nftTransfer, + }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + subscriptionDDO = await nevermined.nfts1155.create(nftAttributes, publisher) + console.log(`Subscription registered with DID: ${subscriptionDDO.id}`) + assert.isDefined(subscriptionDDO) + }) + + it('I want to register a new web service and tokenize (via NFT)', async () => { + serviceMetadata = generateWebServiceMetadata( + 'Nevermined Web Service Metadata', + // regex to match the service endpoints + // works with: https://www.npmjs.com/package/path-to-regexp + // Example of regex: `https://api.openai.com/v1/(.*)`, + `${SERVICE_ENDPOINT}(.*)`, + [OPEN_ENDPOINT], + AUTHORIZATION_TYPE, + AUTHORIZATION_TOKEN, + AUTHORIZATION_USER, + AUTHORIZATION_PASSWORD, + ) as MetaData + serviceMetadata.userId = payload.sub + + console.log(`Registering service with metadata: ${JSON.stringify(serviceMetadata)}`) + + const nftAttributes = NFTAttributes.getCreditsSubscriptionInstance({ + metadata: serviceMetadata, + services: [ + { + serviceType: 'nft-access', + nft: { + tokenId: subscriptionDDO.shortId(), + duration: 0, // Doesnt expire + amount: costServiceInCredits, // The cost of accessing the service + nftTransfer, + }, + }, + ], + providers: [neverminedNodeAddress], + nftContractAddress: subscriptionNFT.address, + preMint, + royaltyAttributes: royaltyAttributes, + }) + serviceDDO = await nevermined.nfts1155.create(nftAttributes, publisher, { + metadata: PublishMetadataOptions.OnlyMetadataAPI, + did: PublishOnChainOptions.OnlyOffchain, + }) + console.log(`Using NFT contract address: ${subscriptionNFT.address}`) + console.log(`Service registered with DID: ${serviceDDO.id}`) + assert.isDefined(serviceDDO) + }) + }) + + describe('As random user I want to get access to the OPEN endpoints WITHOUT a subscription', () => { + it('The user can access the open service endpoints directly', async function () { + if (SKIP_OPEN_ENDPOINT) { + console.log(`Skipping Open Endpoints test because SKIP_OPEN_ENDPOINT is set to true`) + this.skip() + } + console.log(`Using Open Endpoint: ${OPEN_ENDPOINT}`) + + const result = await fetch(OPEN_ENDPOINT, opts) + + assert.isTrue(result.ok) + assert.isTrue(result.status === 200) + }) + + it('The subscriber can access the open service endpoints through the proxy', async function () { + if (SKIP_OPEN_ENDPOINT) { + console.log(`Skipping Open Endpoints test because SKIP_OPEN_ENDPOINT is set to true`) + this.skip() + } + + const proxyUrl = new URL(PROXY_URL) + const serviceDID = DID.parse(serviceDDO.id) + const subdomain = serviceDID.getEncoded() + + const OPEN_PROXY_URL = `${proxyUrl.protocol}//${subdomain}.${proxyUrl.host}${OPEN_PATH}` + + console.log(`Using Proxied Open Endpoint: ${OPEN_PROXY_URL} for DID: ${serviceDDO.id}`) + + const didFromEncoded = DID.fromEncoded(subdomain) + + console.log(`DID from encoded: ${didFromEncoded.getDid()}`) + + const result = await fetch(OPEN_PROXY_URL, opts) + + assert.isTrue(result.ok) + assert.isTrue(result.status === 200) + }) + }) + + describe('As a Subscriber I want to get access to a web service', () => { + it('I check the details of the subscription NFT', async () => { + const details = await nevermined.nfts1155.details(subscriptionDDO.id) + assert.equal(details.owner, publisher.getId()) + }) + + it('I am ordering the subscription NFT', async () => { + await subscriber.requestTokens(subscriptionPrice / scale) + + const subscriberBalanceBefore = await token.balanceOf(subscriber.getId()) + assert.equal(subscriberBalanceBefore, initialBalances.subscriber + subscriptionPrice) + + console.log(`Subscriber balance before: ${subscriberBalanceBefore}`) + + agreementId = await nevermined.nfts1155.order( + subscriptionDDO.id, + subscriptionCredits, + subscriber, + ) + + assert.isDefined(agreementId) + + const subscriberBalanceAfter = await token.balanceOf(subscriber.getId()) + + console.log(`Subscriber balance after: ${subscriberBalanceAfter}`) + + assert.isTrue(subscriberBalanceAfter < subscriberBalanceBefore) + }) + + it('The Publisher can check the payment and transfer the NFT to the Subscriber', async () => { + // Let's use the Node to mint the subscription and release the payments + + const receipt = await nevermined.nfts1155.claim( + agreementId, + publisher.getId(), + subscriber.getId(), + subscriptionCredits, + ) + assert.isTrue(receipt) + }) + + it('the Publisher and reseller can receive their payment', async () => { + const receiver0Balance = await token.balanceOf(assetPrice.getReceivers()[0]) + const receiver1Balance = await token.balanceOf(assetPrice.getReceivers()[1]) + + assert.equal(receiver0Balance, initialBalances.editor + assetPrice.getAmounts()[0]) + assert.equal(receiver1Balance, initialBalances.reseller + assetPrice.getAmounts()[1]) + }) + + it('the subscription can be checked on chain', async () => { + const eventOptions: EventOptions = { + eventName: 'Fulfilled', + filterSubgraph: { + where: { + _did: didZeroX(subscriptionDDO.id), + _receiver: subscriber.getId(), + }, + }, + filterJsonRpc: { + _did: didZeroX(subscriptionDDO.id), + _receiver: subscriber.getId(), + }, + result: { + _agreementId: true, + _did: true, + _receiver: true, + }, + } + // wait for the event to be picked by the subgraph + await nevermined.keeper.conditions.transferNftCondition.events.once((e) => e, eventOptions) + const [event] = await nevermined.keeper.conditions.transferNftCondition.events.getPastEvents( + eventOptions, + ) + + // subgraph event or json-rpc event? + const eventValues = event.args || event + + assert.equal(eventValues._agreementId, agreementId) + assert.equal(eventValues._did, didZeroX(subscriptionDDO.id)) + + // thegraph stores the addresses in lower case + assert.equal(ethers.getAddress(eventValues._receiver), subscriber.getId()) + }) + }) + + describe('As a subscriber I want to get an access token for the web service', () => { + it('Nevermined One issues an access token', async () => { + const response = await nevermined.nfts1155.getSubscriptionToken(serviceDDO.id, subscriber) + accessToken = response.accessToken + + assert.isDefined(accessToken) + }) + }) + + describe('As Subscriber I want to get access to the web service as part of my subscription', () => { + let creditsBalanceBefore: bigint + + it('As subscriber I can see my credits balance', async () => { + creditsBalanceBefore = await subscriptionNFT.balance(subscriptionDDO.id, subscriber.getId()) + + console.log(`Credits balance before: ${creditsBalanceBefore}`) + assert.equal(creditsBalanceBefore, subscriptionCredits) + }) + + it('The subscriber access the service endpoints available', async () => { + const url = new URL(SERVICE_ENDPOINT) + const proxyEndpoint = `${PROXY_URL}${url.pathname}` + + console.log(accessToken) + opts.headers = { + // The proxy expects the `HTTP Authorization` header with the JWT + authorization: `Bearer ${accessToken}`, + 'content-type': 'application/json', + // Host header is not required anymore from the proxy, it picks this up from the JWT + // host: url.port ? url.hostname.concat(`:${url.port}`) : url.hostname, + } + + if (process.env.REQUEST_DATA) { + opts.method = 'POST' + opts.body = JSON.stringify(JSON.parse(process.env.REQUEST_DATA)) + } + + // console.debug(JSON.stringify(opts)) + const result = await fetch(proxyEndpoint, opts) + + console.debug(` ${result.status} - ${await result.text()}`) + + assert.isTrue(result.ok) + assert.equal(result.status, 200) + }) + + it.skip('As subscriber I can see my credits are burned after accessing the service', async () => { + const creditsBalanceAfter = await subscriptionNFT.balance( + subscriptionDDO.id, + subscriber.getId(), + ) + + console.log(`Credits balance after: ${creditsBalanceAfter}`) + assert.equal(creditsBalanceBefore - 1n, creditsBalanceAfter) + }) + }) + + describe('As a user I want to be able to search DDOs by subscriptions', () => { + const endpointsFilter = [ + { + nested: { + path: ['service'], + query: { + bool: { + filter: [ + { match: { 'service.type': 'metadata' } }, + { + match: { + 'service.attributes.main.webService.openEndpoints': '/openapi.json', + }, + }, + ], + }, + }, + }, + }, + ] + + const endpointsFilter2 = [ + { + nested: { + path: ['service'], + query: { + bool: { + filter: [ + { match: { 'service.type': 'metadata' } }, + { + match: { + 'service.attributes.main.webService.openEndpoints': '/nvm.json', + }, + }, + ], + }, + }, + }, + }, + ] + + it('should be able to retrieve the subscriptionDDO by contractAddress', async () => { + const result = await nevermined.search.bySubscriptionContractAddress(subscriptionNFT.address) + assert.equal(result.totalResults.value, 1) + }) + + it('should be able to retrieve subscriptions created', async () => { + const result = await nevermined.search.subscriptionsCreated(publisher) + assert.isAbove(result.totalResults.value, 1) + + const dids = result.results.map((ddo) => ddo.id) + assert.include(dids, subscriptionDDO.id) + }) + + it('should be able to retrieve subscriptions purchased', async () => { + const result = await nevermined.search.subscriptionsPurchased(subscriber, 1155) + assert.isAbove(result.totalResults.value, 1) + + const dids = result.results.map((ddo) => ddo.id) + assert.include(dids, subscriptionDDO.id) + }) + + it('should be able to retrieve all services associated with a subscription', async () => { + const result = await nevermined.search.servicesBySubscription(subscriptionDDO.id) + assert.equal(result.totalResults.value, 1) + + const ddo = result.results.pop() + assert.equal(ddo.id, serviceDDO.id) + }) + + it('should be able to retrieve services associated with a subscription filtering by endpoints', async () => { + const result = await nevermined.search.servicesBySubscription( + subscriptionDDO.id, + endpointsFilter, + ) + assert.equal(result.totalResults.value, 1) + + assert.isTrue( + result.results.every((r) => + r + .findServiceByType('metadata') + .attributes.main.webService.openEndpoints.some((e) => e.includes('.json')), + ), + ) + }) + + it('should not be able to retrieve any services associated with a subscription filtering by endpoints which do not exist', async () => { + const result = await nevermined.search.servicesBySubscription( + subscriptionDDO.id, + endpointsFilter2, + ) + assert.equal(result.totalResults.value, 0) + }) + }) +}) diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services_NFT721.e2e.test.ts similarity index 99% rename from integration/external/Services.e2e.test.ts rename to integration/external/Services_NFT721.e2e.test.ts index 6b79ad7e5..ccb184bbc 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services_NFT721.e2e.test.ts @@ -480,7 +480,7 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve subscriptions purchased', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber) + const result = await nevermined.search.subscriptionsPurchased(subscriber, 721) assert.isAbove(result.totalResults.value, 1) const dids = result.results.map((ddo) => ddo.id) @@ -502,8 +502,6 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { ) assert.equal(result.totalResults.value, 1) - // console.log(`QUERY RESULTS = ${JSON.stringify(result.results)}`) - assert.isTrue( result.results.every((r) => r diff --git a/integration/nevermined/NVMAppFlows.ts b/integration/nevermined/NVMAppFlows.ts index a1a3784f1..8f73acaef 100644 --- a/integration/nevermined/NVMAppFlows.ts +++ b/integration/nevermined/NVMAppFlows.ts @@ -212,7 +212,6 @@ describe('NVM App main flows using Credit NFTs (ERC-1155)', () => { serviceType: 'nft-access', nft: { tokenId: timeSubscriptionDDO.shortId(), - // TODO: Review duration: subscriptionBronzeDuration, amount: 0n, nftTransfer, diff --git a/package.json b/package.json index 352cb1622..07500453e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc11", + "version": "2.0.0-rc12", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 216b70eeb..3e7e9bb1f 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -6,6 +6,7 @@ import { DID, didPrefixed, EventOptions, + NeverminedNFT1155Type, NeverminedNFT721Type, SearchQuery, } from '../../sdk' @@ -151,7 +152,7 @@ export class SearchApi extends Instantiable { /** * Search for all subscription DDOs with `contractAddress` * - * @param contractAddress - The address of the NFT-721 subscription contract + * @param contractAddress - The address of the subscription contract * @param offset - The number of results to return * @param customNestedQueries - Custom nested queries to add to the search * @param page @@ -177,8 +178,20 @@ export class SearchApi extends Instantiable { filter: [ { match: { 'service.type': 'metadata' } }, { - match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721Subscription, + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, }, ], @@ -255,8 +268,20 @@ export class SearchApi extends Instantiable { filter: [ { match: { 'service.type': 'metadata' } }, { - match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721Subscription, + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, }, ], @@ -305,13 +330,14 @@ export class SearchApi extends Instantiable { */ public async subscriptionsPurchased( account: Account, + ercType: 721 | 1155, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, sort = 'desc', appId?: string, ): Promise { - // get on chain dids for nft-721 bought + // get on chain dids for nft bought const eventOptions: EventOptions = { eventName: 'Fulfilled', filterSubgraph: { @@ -328,9 +354,14 @@ export class SearchApi extends Instantiable { } const events = - await this.nevermined.keeper.conditions.transferNft721Condition.events.getPastEvents( - eventOptions, - ) + ercType === 721 + ? await this.nevermined.keeper.conditions.transferNft721Condition.events.getPastEvents( + eventOptions, + ) + : await this.nevermined.keeper.conditions.transferNftCondition.events.getPastEvents( + eventOptions, + ) + const dids = events.map((e) => e._did || e.args._did).map((did) => didPrefixed(did)) let search: SearchQuery['query'][] = [ @@ -342,8 +373,20 @@ export class SearchApi extends Instantiable { filter: [ { match: { 'service.type': 'metadata' } }, { - match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721Subscription, + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, }, ], @@ -407,8 +450,15 @@ export class SearchApi extends Instantiable { filter: [ { match: { 'service.type': 'metadata' } }, { - match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721, + bool: { + should: [ + { match: { 'service.attributes.main.nftType': NeverminedNFT721Type.nft721 } }, + { + match: { + 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, }, { @@ -537,8 +587,15 @@ export class SearchApi extends Instantiable { filter: [ { match: { 'service.type': 'metadata' } }, { - match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721, + bool: { + should: [ + { match: { 'service.attributes.main.nftType': NeverminedNFT721Type.nft721 } }, + { + match: { + 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, }, { diff --git a/src/nevermined/api/nfts/NFT721Api.ts b/src/nevermined/api/nfts/NFT721Api.ts index b06bd3b4d..efcd82979 100644 --- a/src/nevermined/api/nfts/NFT721Api.ts +++ b/src/nevermined/api/nfts/NFT721Api.ts @@ -13,7 +13,6 @@ import { NFTError } from '../../../errors/NFTError' import { ContractTransactionReceipt, ethers } from 'ethers' import { NFTsBaseApi } from './NFTsBaseApi' import { CreateProgressStep, OrderProgressStep } from '../../ProgressSteps' -import { SubscriptionToken } from '../../../services' /** * Allows the interaction with external ERC-721 NFT contracts built on top of the Nevermined NFT extra features. @@ -641,26 +640,6 @@ export class NFT721Api extends NFTsBaseApi { return this._details(did, 721) } - /** - * Get a JWT token for an asset associated with a webService - * - * @example - * ```ts - * const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) - * - * assert.isDefined(response.accessToken) - * assert.isDefined(response.neverminedProxyUri) - * ``` - * - * @param did - The did of the asset with a webService resource and an associated subscription - * @param account - Account of the user requesting the token - * - * @returns {@link SubscriptionToken} - */ - public async getSubscriptionToken(did: string, account: Account): Promise { - return this.nevermined.services.node.getSubscriptionToken(did, account) - } - public async isOperatorOfDID(did: string, address: string): Promise { return super.isOperatorOfDID(did, address, 721) } diff --git a/src/nevermined/api/nfts/NFTsBaseApi.ts b/src/nevermined/api/nfts/NFTsBaseApi.ts index af96e6cb7..b93e1a648 100644 --- a/src/nevermined/api/nfts/NFTsBaseApi.ts +++ b/src/nevermined/api/nfts/NFTsBaseApi.ts @@ -8,6 +8,7 @@ import { ServiceSecondary } from '../../../ddo' import { NFTError } from '../../../errors' import { generateId } from '../../../utils' import { RegistryBaseApi } from '../RegistryBaseApi' +import { SubscriptionToken } from '../../../services' /** * Abstract class providing common NFT methods for different ERC implementations. @@ -457,4 +458,24 @@ export abstract class NFTsBaseApi extends RegistryBaseApi { } return result } + + /** + * Get a JWT token for an asset associated with a webService + * + * @example + * ```ts + * const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) + * + * assert.isDefined(response.accessToken) + * assert.isDefined(response.neverminedProxyUri) + * ``` + * + * @param did - The did of the asset with a webService resource and an associated subscription + * @param account - Account of the user requesting the token + * + * @returns {@link SubscriptionToken} + */ + public async getSubscriptionToken(did: string, account: Account): Promise { + return this.nevermined.services.node.getSubscriptionToken(did, account) + } } From 1108abab1cf0bb137ee6d88f0393e7d10453db30 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:09:49 +0200 Subject: [PATCH 120/151] chore: adding v2.0.0-rc12 Changelog updates --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 475aa06d0..d03fbe65f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,18 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc11...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc12...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc12](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc11...v2.0.0-rc12) + +> 3 October 2023 + +- fix: adaptations and tests for NVM App 1155 flows [`e97c3ac`](https://github.com/nevermined-io/sdk-js/commit/e97c3acfb5b80d22aca29328e92f2c9f66a153bd) +- test: fix services e2e services flow [`f93664d`](https://github.com/nevermined-io/sdk-js/commit/f93664d07747e6e714f43d51ccf4d5184e3201fe) +- chore: adding v2.0.0-rc11 Changelog updates [`222bec9`](https://github.com/nevermined-io/sdk-js/commit/222bec960167fa95caabcff30d29fef68623332a) + #### [v2.0.0-rc11](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc10...v2.0.0-rc11) > 3 October 2023 From c4d50f8eec0dc90a58e17630657b5febf2ded2ab Mon Sep 17 00:00:00 2001 From: enrique Date: Wed, 4 Oct 2023 09:25:51 +0200 Subject: [PATCH 121/151] feat: support search base on nftType --- integration/external/Datasets.e2e.test.ts | 49 +++++++++++++++++++---- integration/external/Services.e2e.test.ts | 16 ++++++-- src/nevermined/api/SearchApi.ts | 22 ++++++++-- 3 files changed, 73 insertions(+), 14 deletions(-) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index 91c6b70d3..c756912e3 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -1,6 +1,14 @@ import { assert } from 'chai' import { decodeJwt, JWTPayload } from 'jose' -import { Account, DDO, MetaData, Nevermined, AssetPrice, NFTAttributes } from '../../src' +import { + Account, + DDO, + MetaData, + Nevermined, + AssetPrice, + NFTAttributes, + NeverminedNFT721Type, +} from '../../src' import { EscrowPaymentCondition, TransferNFT721Condition, Token } from '../../src/keeper' import { config } from '../config' import { generateMetadata, getMetadata } from '../utils' @@ -322,12 +330,18 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { describe('As a user I want to be able to search DDOs by subscriptions', () => { it('should be able to retrieve the subscriptionDDO by contractAddress', async () => { - const result = await nevermined.search.bySubscriptionContractAddress(subscriptionNFT.address) + const result = await nevermined.search.bySubscriptionContractAddress( + subscriptionNFT.address, + NeverminedNFT721Type.nft721Subscription, + ) assert.equal(result.totalResults.value, 1) }) it('should be able to retrieve subscriptions created', async () => { - const result = await nevermined.search.subscriptionsCreated(publisher) + const result = await nevermined.search.subscriptionsCreated( + publisher, + NeverminedNFT721Type.nft721Subscription, + ) assert.isAbove(result.totalResults.value, 1) const dids = result.results.map((ddo) => ddo.id) @@ -335,7 +349,10 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve subscriptions purchased', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber) + const result = await nevermined.search.subscriptionsPurchased( + subscriber, + NeverminedNFT721Type.nft721Subscription, + ) assert.isAbove(result.totalResults.value, 1) const dids = result.results.map((ddo) => ddo.id) @@ -343,7 +360,11 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve subscriptions published filtering by tags', async () => { - const result = await nevermined.search.subscriptionsCreated(publisher, tagsFilter) + const result = await nevermined.search.subscriptionsCreated( + publisher, + NeverminedNFT721Type.nft721Subscription, + tagsFilter, + ) assert.isAbove(result.totalResults.value, 1) @@ -357,13 +378,21 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should not be able to retrieve any subscriptions published filtering by tags which not exist', async () => { - const result = await nevermined.search.subscriptionsCreated(publisher, tagsFilter2) + const result = await nevermined.search.subscriptionsCreated( + publisher, + NeverminedNFT721Type.nft721Subscription, + tagsFilter2, + ) assert.equal(result.totalResults.value, 0) }) it('should be able to retrieve subscriptions purchased filtering by tags', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber, tagsFilter) + const result = await nevermined.search.subscriptionsPurchased( + subscriber, + NeverminedNFT721Type.nft721Subscription, + tagsFilter, + ) assert.isAbove(result.totalResults.value, 1) assert.isTrue( @@ -376,7 +405,11 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should not be able to retrieve not subscriptions purchased filtering by tags which do not exist', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber, tagsFilter2) + const result = await nevermined.search.subscriptionsPurchased( + subscriber, + NeverminedNFT721Type.nft721Subscription, + tagsFilter2, + ) assert.equal(result.totalResults.value, 0) }) diff --git a/integration/external/Services.e2e.test.ts b/integration/external/Services.e2e.test.ts index dfdd99c99..0dfdd3ac2 100644 --- a/integration/external/Services.e2e.test.ts +++ b/integration/external/Services.e2e.test.ts @@ -8,6 +8,7 @@ import { AssetPrice, NFTAttributes, ResourceAuthentication, + NeverminedNFT721Type, } from '../../src' import { EscrowPaymentCondition, TransferNFT721Condition, Token } from '../../src/keeper' import { config } from '../config' @@ -456,12 +457,18 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { describe('As a user I want to be able to search DDOs by subscriptions', () => { it('should be able to retrieve the subscriptionDDO by contractAddress', async () => { - const result = await nevermined.search.bySubscriptionContractAddress(subscriptionNFT.address) + const result = await nevermined.search.bySubscriptionContractAddress( + subscriptionNFT.address, + NeverminedNFT721Type.nft721Subscription, + ) assert.equal(result.totalResults.value, 1) }) it('should be able to retrieve subscriptions created', async () => { - const result = await nevermined.search.subscriptionsCreated(publisher) + const result = await nevermined.search.subscriptionsCreated( + publisher, + NeverminedNFT721Type.nft721Subscription, + ) assert.isAbove(result.totalResults.value, 1) const dids = result.results.map((ddo) => ddo.id) @@ -469,7 +476,10 @@ describe('Gate-keeping of Web Services using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve subscriptions purchased', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber) + const result = await nevermined.search.subscriptionsPurchased( + subscriber, + NeverminedNFT721Type.nft721Subscription, + ) assert.isAbove(result.totalResults.value, 1) const dids = result.results.map((ddo) => ddo.id) diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 216b70eeb..8904b1c44 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -156,12 +156,14 @@ export class SearchApi extends Instantiable { * @param customNestedQueries - Custom nested queries to add to the search * @param page * @param sort - The sort order + * @param nftType - The nftType * @param appId - The appId used to filter the results * * @returns {@link Promise} */ public async bySubscriptionContractAddress( contractAddress: string, + nftType: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -178,7 +180,7 @@ export class SearchApi extends Instantiable { { match: { 'service.type': 'metadata' } }, { match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721Subscription, + 'service.attributes.main.nftType': nftType, }, }, ], @@ -234,12 +236,14 @@ export class SearchApi extends Instantiable { * @param offset - The number of results to return * @param page * @param sort - The sort order + * @param nftType - The nftType * @param appId - The appId used to filter the results * * @returns {@link Promise} */ public async subscriptionsCreated( account: Account, + nftType: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -256,7 +260,12 @@ export class SearchApi extends Instantiable { { match: { 'service.type': 'metadata' } }, { match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721Subscription, + 'service.attributes.main.nftType': nftType, + }, + }, + { + match: { + 'service.attributes.main.type': 'subscription', }, }, ], @@ -299,12 +308,14 @@ export class SearchApi extends Instantiable { * @param offset - The number of results to return * @param page * @param sort - The sort order + * @param nftType - The nftType * @param appId - The appId used to filter the results * * @returns {@link Promise} */ public async subscriptionsPurchased( account: Account, + nftType: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -343,7 +354,12 @@ export class SearchApi extends Instantiable { { match: { 'service.type': 'metadata' } }, { match: { - 'service.attributes.main.nftType': NeverminedNFT721Type.nft721Subscription, + 'service.attributes.main.nftType': nftType, + }, + }, + { + match: { + 'service.attributes.main.type': 'subscription', }, }, ], From b31609f21de1aac7ff9009e8d6bed51a28b2669b Mon Sep 17 00:00:00 2001 From: enrique Date: Wed, 4 Oct 2023 13:57:41 +0200 Subject: [PATCH 122/151] feat: update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 07500453e..9fb2a98e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc12", + "version": "2.0.0-rc13", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 68be908cd268fde9007bbca70ff6184c29afaf0c Mon Sep 17 00:00:00 2001 From: enrique Date: Wed, 4 Oct 2023 14:42:15 +0200 Subject: [PATCH 123/151] fix: query logic --- src/nevermined/api/SearchApi.ts | 126 +++++++++++++++++--------------- 1 file changed, 66 insertions(+), 60 deletions(-) diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 7507f2445..80a7496ea 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -179,28 +179,30 @@ export class SearchApi extends Instantiable { bool: { filter: [ { match: { 'service.type': 'metadata' } }, - nftType && { - match: { - 'service.attributes.main.nftType': nftType, - }, - }, - !nftType && { - bool: { - should: [ - { - match: { - 'service.attributes.main.nftType': - NeverminedNFT721Type.nft721Subscription, - }, + nftType + ? { + match: { + 'service.attributes.main.nftType': nftType, }, - { - match: { - 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, - }, + } + : { + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, - ], - }, - }, + }, ], }, }, @@ -282,28 +284,30 @@ export class SearchApi extends Instantiable { }, }, - nftType && { - match: { - 'service.attributes.main.nftType': nftType, - }, - }, - !nftType && { - bool: { - should: [ - { - match: { - 'service.attributes.main.nftType': - NeverminedNFT721Type.nft721Subscription, - }, + nftType + ? { + match: { + 'service.attributes.main.nftType': nftType, }, - { - match: { - 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, - }, + } + : { + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, - ], - }, - }, + }, ], }, }, @@ -394,33 +398,35 @@ export class SearchApi extends Instantiable { bool: { filter: [ { match: { 'service.type': 'metadata' } }, - nftType && { - match: { - 'service.attributes.main.nftType': nftType, - }, - }, { match: { 'service.attributes.main.type': 'subscription', }, }, - !nftType && { - bool: { - should: [ - { - match: { - 'service.attributes.main.nftType': - NeverminedNFT721Type.nft721Subscription, - }, + nftType + ? { + match: { + 'service.attributes.main.nftType': nftType, }, - { - match: { - 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, - }, + } + : { + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], }, - ], - }, - }, + }, ], }, }, From 4cedc9b58bf4e500c6a97d9379f1897dbf365622 Mon Sep 17 00:00:00 2001 From: enrique Date: Wed, 4 Oct 2023 14:43:25 +0200 Subject: [PATCH 124/151] feat: update to rc14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9fb2a98e2..69307a80c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc13", + "version": "2.0.0-rc14", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From fb540a1a6826f7a163ae00a849167ca5612a0132 Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Wed, 4 Oct 2023 13:06:24 +0000 Subject: [PATCH 125/151] Automated CHANGELOG.md update Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d03fbe65f..b9503bcac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,26 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc12...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc14...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc14](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc13...v2.0.0-rc14) + +> 4 October 2023 + +- fix: query logic [`68be908`](https://github.com/nevermined-io/sdk-js/commit/68be908cd268fde9007bbca70ff6184c29afaf0c) +- feat: update to rc14 [`4cedc9b`](https://github.com/nevermined-io/sdk-js/commit/4cedc9b58bf4e500c6a97d9379f1897dbf365622) + +#### [v2.0.0-rc13](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc12...v2.0.0-rc13) + +> 4 October 2023 + +- Small fixes and tests for NFT1155 flows [`#589`](https://github.com/nevermined-io/sdk-js/pull/589) +- feat: update version [`b31609f`](https://github.com/nevermined-io/sdk-js/commit/b31609f21de1aac7ff9009e8d6bed51a28b2669b) +- fix: conflicts [`2fbdcba`](https://github.com/nevermined-io/sdk-js/commit/2fbdcba4e55c9359ddfe251c4542506b08854121) +- feat: support search base on nftType [`c4d50f8`](https://github.com/nevermined-io/sdk-js/commit/c4d50f8eec0dc90a58e17630657b5febf2ded2ab) + #### [v2.0.0-rc12](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc11...v2.0.0-rc12) > 3 October 2023 @@ -481,7 +497,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384) - linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4) -#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) +### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) > 14 February 2023 @@ -1220,7 +1236,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1483,7 +1499,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -1989,7 +2005,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -2028,7 +2044,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 7ae842e74e72faca84b6945fba9c6d968ee1873a Mon Sep 17 00:00:00 2001 From: enrique Date: Thu, 5 Oct 2023 09:44:57 +0200 Subject: [PATCH 126/151] fix: nft1155 test --- integration/external/Services_NFT1155.e2e.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/integration/external/Services_NFT1155.e2e.test.ts b/integration/external/Services_NFT1155.e2e.test.ts index 0a162110b..d73bcb35f 100644 --- a/integration/external/Services_NFT1155.e2e.test.ts +++ b/integration/external/Services_NFT1155.e2e.test.ts @@ -8,6 +8,7 @@ import { AssetPrice, NFTAttributes, ResourceAuthentication, + NeverminedNFT1155Type, } from '../../src' import { EscrowPaymentCondition, @@ -498,7 +499,10 @@ describe('Gate-keeping of Web Services using NFT ERC-1155 End-to-End', () => { ] it('should be able to retrieve the subscriptionDDO by contractAddress', async () => { - const result = await nevermined.search.bySubscriptionContractAddress(subscriptionNFT.address) + const result = await nevermined.search.bySubscriptionContractAddress( + subscriptionNFT.address, + NeverminedNFT1155Type.nft1155Credit, + ) assert.equal(result.totalResults.value, 1) }) @@ -511,7 +515,11 @@ describe('Gate-keeping of Web Services using NFT ERC-1155 End-to-End', () => { }) it('should be able to retrieve subscriptions purchased', async () => { - const result = await nevermined.search.subscriptionsPurchased(subscriber, 1155) + const result = await nevermined.search.subscriptionsPurchased( + subscriber, + NeverminedNFT1155Type.nft1155Credit, + 1155, + ) assert.isAbove(result.totalResults.value, 1) const dids = result.results.map((ddo) => ddo.id) From af30abe281a00084ba12ba570f1daf3056c6c175 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:39:51 +0200 Subject: [PATCH 127/151] feat: utility improvements and typo --- src/Instantiable.abstract.ts | 2 +- src/keeper/Keeper.ts | 4 ++-- src/nevermined/Nevermined.ts | 4 ++-- src/utils/MakeAccounts.ts | 12 ++++++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index 081489615..7ab1ee682 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -13,7 +13,7 @@ export interface InstantiableConfig { circuitsFolder?: string } -export async function generateIntantiableConfigFromConfig( +export async function generateInstantiableConfigFromConfig( config: NeverminedOptions, ): Promise> { const logLevel = diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index cdb49b9fb..3d666fa5d 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -116,7 +116,7 @@ export class Keeper extends Instantiable { nftSalesTemplate: NFTSalesTemplate.getInstance(this.instanceConfig), nft721SalesTemplate: NFT721SalesTemplate.getInstance(this.instanceConfig), standardRoyalties: StandardRoyalties.getInstance(this.instanceConfig), // optional - rewardsDistributor: RewardsDistributor.getInstance(this.instanceConfig), + rewardsDistributor: undefined, // RewardsDistributor.getInstance(this.instanceConfig), // optional nftUpgradeable: Nft1155Contract.getInstance(this.instanceConfig), }) @@ -125,7 +125,7 @@ export class Keeper extends Instantiable { curve: undefined, } - this.rewardsDistributor = this.instances.rewardsDistributor + this.rewardsDistributor = undefined // this.instances.rewardsDistributor const templates = [ this.instances.accessTemplate, diff --git a/src/nevermined/Nevermined.ts b/src/nevermined/Nevermined.ts index e14fe3ec8..e107ef388 100644 --- a/src/nevermined/Nevermined.ts +++ b/src/nevermined/Nevermined.ts @@ -5,7 +5,7 @@ import { ProvenanceApi } from './api/ProvenanceApi' import { UtilsApi } from './api/UtilsApi' import { Keeper, CustomToken, Nft1155Contract, Nft721Contract } from '../keeper' import { NeverminedOptions } from '../models' -import { Instantiable, generateIntantiableConfigFromConfig } from '../Instantiable.abstract' +import { Instantiable, generateInstantiableConfigFromConfig } from '../Instantiable.abstract' import { NFT1155Api } from './api/nfts/NFT1155Api' import { NFT721Api } from './api/nfts/NFT721Api' import { SearchApi } from './api/SearchApi' @@ -35,7 +35,7 @@ export class Nevermined extends Instantiable { const instance = new Nevermined() const instanceConfig = { - ...(await generateIntantiableConfigFromConfig(config)), + ...(await generateInstantiableConfigFromConfig(config)), nevermined: instance, } instance.setInstanceConfig(instanceConfig) diff --git a/src/utils/MakeAccounts.ts b/src/utils/MakeAccounts.ts index 88f5c614a..bb3a882a8 100644 --- a/src/utils/MakeAccounts.ts +++ b/src/utils/MakeAccounts.ts @@ -1,14 +1,22 @@ import { Mnemonic, ethers, getIndexedAccountPath } from 'ethers' -export function makeAccounts(seedphrase: string): ethers.Wallet[] { +export function makeAccounts(seedphrase: string, numAccounts = 10): ethers.Wallet[] { const mnemonic = Mnemonic.fromPhrase(seedphrase) const node = ethers.HDNodeWallet.fromSeed(mnemonic.computeSeed()) const accounts: ethers.Wallet[] = [] - for (let i = 0; i < 10; i++) { + for (let i = 0; i < numAccounts; i++) { const acc = node.derivePath(getIndexedAccountPath(i)) const wallet = new ethers.Wallet(acc.privateKey) accounts.push(wallet) } return accounts } + +export function makeAccount(seedphrase: string, accountIndex: number = 0): ethers.Wallet { + const mnemonic = Mnemonic.fromPhrase(seedphrase) + const node = ethers.HDNodeWallet.fromSeed(mnemonic.computeSeed()) + + const acc = node.derivePath(getIndexedAccountPath(accountIndex)) + return new ethers.Wallet(acc.privateKey) +} From c3118cf1a7b3eb8ea467fb61ad6b3232ca70da52 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Thu, 5 Oct 2023 19:05:11 +0200 Subject: [PATCH 128/151] fix: adapting to different erc types --- src/keeper/contracts/NFTContractsBase.ts | 5 ++++- src/keeper/contracts/Nft1155Contract.ts | 2 +- src/keeper/contracts/Nft721Contract.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/keeper/contracts/NFTContractsBase.ts b/src/keeper/contracts/NFTContractsBase.ts index a8f7e5e99..57a7405f7 100644 --- a/src/keeper/contracts/NFTContractsBase.ts +++ b/src/keeper/contracts/NFTContractsBase.ts @@ -32,6 +32,7 @@ export class NFTContractsBase extends ContractBase { * @returns Contract Receipt */ protected async _createClone( + ercType: 721 | 1155, name: string, symbol: string, uri: string, @@ -43,7 +44,9 @@ export class NFTContractsBase extends ContractBase { try { const contractReceipt: ContractTransactionReceipt = await this.sendFrom( 'createClone', - cap ? [name, symbol, uri, String(cap), operators] : [name, symbol, uri, operators], + ercType === 721 + ? [name, symbol, uri, String(cap), operators] + : [name, symbol, uri, operators], from, txParams, ) diff --git a/src/keeper/contracts/Nft1155Contract.ts b/src/keeper/contracts/Nft1155Contract.ts index bac30d3b4..e54e05575 100644 --- a/src/keeper/contracts/Nft1155Contract.ts +++ b/src/keeper/contracts/Nft1155Contract.ts @@ -74,7 +74,7 @@ export class Nft1155Contract extends NFTContractsBase { from?: Account, txParams?: TxParameters, ) { - return this._createClone(name, symbol, uri, undefined, operators, from, txParams) + return this._createClone(1155, name, symbol, uri, undefined, operators, from, txParams) } /** diff --git a/src/keeper/contracts/Nft721Contract.ts b/src/keeper/contracts/Nft721Contract.ts index 61e51cf2c..0bcf5ff0c 100644 --- a/src/keeper/contracts/Nft721Contract.ts +++ b/src/keeper/contracts/Nft721Contract.ts @@ -72,7 +72,7 @@ export class Nft721Contract extends NFTContractsBase { from?: Account, txParams?: TxParameters, ) { - return this._createClone(name, symbol, uri, cap, operators, from, txParams) + return this._createClone(721, name, symbol, uri, cap, operators, from, txParams) } public async mint(did: string, from: string, txParams?: TxParameters) { From aea4dd2259c9b553446e7bd173d5cb49f4a06b2d Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:26:51 +0200 Subject: [PATCH 129/151] chore: updating version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 69307a80c..a0463a91e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc14", + "version": "2.0.0-rc15", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 176132c2d10383607b0001dba620a5ebd5669e99 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:55:30 +0200 Subject: [PATCH 130/151] chore: adding v2.0.0-rc15 Changelog updates --- CHANGELOG.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9503bcac..947c0becf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc14...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc15...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc15](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc14...v2.0.0-rc15) + +> 6 October 2023 + +- feat: support search base on nftType [`#590`](https://github.com/nevermined-io/sdk-js/pull/590) +- Automated CHANGELOG.md update [`fb540a1`](https://github.com/nevermined-io/sdk-js/commit/fb540a1a6826f7a163ae00a849167ca5612a0132) +- feat: utility improvements and typo [`af30abe`](https://github.com/nevermined-io/sdk-js/commit/af30abe281a00084ba12ba570f1daf3056c6c175) +- fix: nft1155 test [`7ae842e`](https://github.com/nevermined-io/sdk-js/commit/7ae842e74e72faca84b6945fba9c6d968ee1873a) + #### [v2.0.0-rc14](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc13...v2.0.0-rc14) > 4 October 2023 @@ -497,7 +506,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384) - linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4) -### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) +#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) > 14 February 2023 @@ -1236,7 +1245,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1499,7 +1508,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -2005,7 +2014,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -2044,7 +2053,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 53d2658742ec82486c404fc23fae19dc75d5c0db Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:40:15 +0200 Subject: [PATCH 131/151] fix: skip the encryption through the Node when there is no files --- package.json | 2 +- src/nevermined/api/RegistryBaseApi.ts | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a0463a91e..544281fe9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc15", + "version": "2.0.0-rc16", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 7e952a510..8f32390d9 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -132,12 +132,15 @@ export abstract class RegistryBaseApi extends Instantiable { let encryptedFiles, encryptedAttributes if (!['workflow'].includes(assetAttributes.metadata.main.type)) { - const encryptedFilesResponse = await this.nevermined.services.node.encrypt( - ddo.id, - JSON.stringify(assetAttributes.metadata.main.files), - new String(assetAttributes.encryptionMethod), - ) - encryptedFiles = JSON.parse(encryptedFilesResponse)['hash'] + if (assetAttributes.metadata.main.files) { + // If we have files to encrypt we encrypt them + const encryptedFilesResponse = await this.nevermined.services.node.encrypt( + ddo.id, + JSON.stringify(assetAttributes.metadata.main.files), + new String(assetAttributes.encryptionMethod), + ) + encryptedFiles = JSON.parse(encryptedFilesResponse)['hash'] + } if (assetAttributes.metadata.main.type === 'service') { const encryptedServiceAttributesResponse = await this.nevermined.services.node.encrypt( From 176899afa7c4fb3bf8d28eb7bfa689e9ffca67fe Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 9 Oct 2023 18:09:10 +0200 Subject: [PATCH 132/151] chore: adding v2.0.0-rc16 Changelog updates --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 947c0becf..fea4f7b0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,18 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc15...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc16...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc16](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc15...v2.0.0-rc16) + +> 9 October 2023 + +- fix: skip the encryption through the Node when there is no files [`#594`](https://github.com/nevermined-io/sdk-js/pull/594) +- Small utility improvements [`#592`](https://github.com/nevermined-io/sdk-js/pull/592) +- chore: adding v2.0.0-rc15 Changelog updates [`176132c`](https://github.com/nevermined-io/sdk-js/commit/176132c2d10383607b0001dba620a5ebd5669e99) + #### [v2.0.0-rc15](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc14...v2.0.0-rc15) > 6 October 2023 From 6e77cb12531ae7f74cd5703cc6846605c6b3bfdb Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:30:00 +0200 Subject: [PATCH 133/151] fix: the `tokenId` attribute in the DDO is now clean (no DID prefix) --- package.json | 2 +- src/utils/DDOHelpers.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 544281fe9..967d82b00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc16", + "version": "2.0.0-rc17", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index ac7a4bf15..a9106d1bf 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -112,7 +112,7 @@ function getParameter( case 'duration': return String(duration) case 'tokenId': - return tokenId ? tokenId : '' + return tokenId ? tokenId.replace('did:nv:', '') : '' } return '' From ce8106b4b9e671841a3669d36aa056e6b0e8e2ce Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:11:02 +0200 Subject: [PATCH 134/151] chore: adding v2.0.0-rc17 Changelog updates --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fea4f7b0e..674de7f2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc16...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc17...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc17](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc16...v2.0.0-rc17) + +> 11 October 2023 + +- chore: adding v2.0.0-rc16 Changelog updates [`176899a`](https://github.com/nevermined-io/sdk-js/commit/176899afa7c4fb3bf8d28eb7bfa689e9ffca67fe) +- fix: the `tokenId` attribute in the DDO is now clean (no DID prefix) [`6e77cb1`](https://github.com/nevermined-io/sdk-js/commit/6e77cb12531ae7f74cd5703cc6846605c6b3bfdb) + #### [v2.0.0-rc16](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc15...v2.0.0-rc16) > 9 October 2023 From 849b02c17ae97c944c477ae69ba1d37d0e8cc997 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 12 Oct 2023 18:28:02 +0200 Subject: [PATCH 135/151] feat: update to latest version of nvm-tools-actions --- .github/workflows/testing-nightly.yml | 6 +++--- .github/workflows/testing-node.yml | 2 +- .github/workflows/testing.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index 4d678317c..220c7c69e 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -56,7 +56,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' @@ -98,7 +98,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' @@ -132,7 +132,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 78e03f800..6af7c5751 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -20,7 +20,7 @@ jobs: # TODO: remove this when Node integrated with SDKv2 is integraged ref: develop token: ${{ secrets.API_TOKEN_GITHUB }} - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7f7998cee..d2aeca9fe 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' From 17d9e60a88ea3a6f6fdb5061682970734c3a7e6b Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:16:23 +0200 Subject: [PATCH 136/151] fix: adding additional external resource attributes --- src/ddo/types.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ddo/types.ts b/src/ddo/types.ts index 32167b8bb..1a88c629b 100644 --- a/src/ddo/types.ts +++ b/src/ddo/types.ts @@ -101,6 +101,15 @@ export interface ServiceMetadata { definition: ServiceDefinition } +export enum ExternalResourceFileType { + Avatar = 'Avatar', + Private = 'Private', + CoverImage = 'CoverImage', + TermsAndConditions = 'TermsAndConditions', + SampleData = 'SampleData', + Other = 'Other', +} + export interface MetaDataExternalResource { /** * File name. @@ -139,7 +148,13 @@ export interface MetaDataExternalResource { contentLength?: string /** - * Resource ID (depending on the source). + * The type of the external resource file + */ + resourceType?: ExternalResourceFileType + + /** + * Resource ID (depending on the source). It is used to reference the id of the file in an external source. + * For example the `ugcId` */ resourceId?: string From 0c66298ca58111f7fac59afa306d5320f8a56d4d Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:16:48 +0200 Subject: [PATCH 137/151] chore: bumping version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 967d82b00..3ec92351a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc17", + "version": "2.0.0-rc18", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From cd8cb489d36fb0296ee08b3e10457e1d5d62e4a3 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:19:40 +0200 Subject: [PATCH 138/151] chore: adding v2.0.0-rc18 Changelog updates --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 674de7f2f..1f2f22c80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,18 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc17...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc18...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc18](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc17...v2.0.0-rc18) + +> 16 October 2023 + +- fix: adding additional external resource attributes [`17d9e60`](https://github.com/nevermined-io/sdk-js/commit/17d9e60a88ea3a6f6fdb5061682970734c3a7e6b) +- chore: adding v2.0.0-rc17 Changelog updates [`ce8106b`](https://github.com/nevermined-io/sdk-js/commit/ce8106b4b9e671841a3669d36aa056e6b0e8e2ce) +- chore: bumping version [`0c66298`](https://github.com/nevermined-io/sdk-js/commit/0c66298ca58111f7fac59afa306d5320f8a56d4d) + #### [v2.0.0-rc17](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc16...v2.0.0-rc17) > 11 October 2023 From c2a70078805da0ec46bead9fc2b56d452a5c3817 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:07:07 +0200 Subject: [PATCH 139/151] ci: nvm tools v0.15.0 --- .github/workflows/testing-nightly.yml | 6 +++--- .github/workflows/testing-node.yml | 2 +- .github/workflows/testing.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing-nightly.yml b/.github/workflows/testing-nightly.yml index 4d678317c..220c7c69e 100644 --- a/.github/workflows/testing-nightly.yml +++ b/.github/workflows/testing-nightly.yml @@ -56,7 +56,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' @@ -98,7 +98,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' @@ -132,7 +132,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 78e03f800..6af7c5751 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -20,7 +20,7 @@ jobs: # TODO: remove this when Node integrated with SDKv2 is integraged ref: develop token: ${{ secrets.API_TOKEN_GITHUB }} - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7f7998cee..d2aeca9fe 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: nevermined-io/nvm-tools-actions@v0.14.0 + - uses: nevermined-io/nvm-tools-actions@v0.15.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' From be0d6811ade79a81746be3522ad5fc1a826f732d Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 18 Oct 2023 18:28:27 +0200 Subject: [PATCH 140/151] feat: e2e asset creation working --- integration/external/Zerodev.test.ts | 139 +++++++++++++++++---------- integration/tsconfig.json | 2 +- package.json | 4 +- src/keeper/ContractHandler.ts | 4 +- src/keeper/contracts/ContractBase.ts | 89 ++++++++++++++++- src/keeper/utils.ts | 27 +++++- src/models/NeverminedOptions.ts | 4 +- src/nevermined/Account.ts | 22 ++++- src/nevermined/api/AccountsApi.ts | 21 +++- src/nevermined/utils/JwtUtils.ts | 78 ++++++++++++--- 10 files changed, 314 insertions(+), 76 deletions(-) diff --git a/integration/external/Zerodev.test.ts b/integration/external/Zerodev.test.ts index c3a9a9361..390bbfa30 100644 --- a/integration/external/Zerodev.test.ts +++ b/integration/external/Zerodev.test.ts @@ -1,90 +1,131 @@ -import { HDNodeWallet, Wallet } from 'ethers' -import { assert } from 'chai' -import { ZeroDevEthersProvider, convertEthersSignerToAccountSigner } from '@zerodev/sdk' +import { ethers } from 'ethers' +import { ZeroDevEthersProvider } from '@zerodev/sdk' +import { verifyMessage } from '@ambire/signature-validator' import { Account, AssetAttributes, AssetPrice, - EthSignJWT, Nevermined, - NeverminedOptions, + convertEthersV6SignerToAccountSigner, } from '../../src' +import { assert } from 'chai' +import { decodeJwt } from 'jose' +import { config } from '../config' import { getMetadata } from '../utils' describe('Nevermined sdk with zerodev', () => { - let projectId: string - let owner: HDNodeWallet - let config: NeverminedOptions - let nevermined: Nevermined - let account: Account let zerodevProvider: ZeroDevEthersProvider<'ECDSA'> + let nevermined: Nevermined + let clientAssertion: string + let userId: string before(async () => { - projectId = process.env.PROJECT_ID! - owner = Wallet.createRandom() - account = new Account(await owner.getAddress()) - const infuraToken = process.env.INFURA_TOKEN! - - config = { - marketplaceUri: 'https://marketplace-api.mumbai.nevermined.app', - neverminedNodeUri: 'https://node.mumbai.nevermined.app', - graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public', - neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc', - artifactsFolder: './artifacts', - web3ProviderUri: `https://polygon-mumbai.infura.io/v3/${infuraToken}`, - } - }) + const projectId = process.env.PROJECT_ID! + const owner = ethers.Wallet.createRandom() - it('should instantiate nevermined sdk with a zerodev provider', async () => { zerodevProvider = await ZeroDevEthersProvider.init('ECDSA', { projectId, - owner: convertEthersSignerToAccountSigner(owner as any), + owner: convertEthersV6SignerToAccountSigner(owner), }) + }) - nevermined = await Nevermined.getInstance({ - ...config, - zerodevProvider: zerodevProvider, + it('should produce a valid EIP-6492 signature', async () => { + const signer = zerodevProvider.getAccountSigner() + + const signature = await signer.signMessageWith6492('nevermined') + const isValidSignature = await verifyMessage({ + signer: await signer.getAddress(), + message: 'nevermined', + signature: signature, + provider: zerodevProvider, }) - assert.isDefined(nevermined) + assert.isTrue(isValidSignature) }) - it('should login to the marketplace api', async () => { - const accountSigner = zerodevProvider.getAccountSigner() + it('should provide a valid EIP-6492 typed signature', async () => { + const domain = { + name: 'Nevermined', + version: '1', + chainId: 80001, + } + const types = { + Nevermined: [{ name: 'message', type: 'string' }], + } + const message = { + message: 'nevermined', + } - const clientAssertion = await new EthSignJWT({ - iss: account.getId(), + const signer = zerodevProvider.getAccountSigner() + const signature = await signer.signTypedDataWith6492({ + domain, + types, + message, + primaryType: '', }) - .setProtectedHeader({ alg: 'ES256K' }) - .setIssuedAt() - .setExpirationTime('1h') - .ethSign(accountSigner as any) - await nevermined.services.marketplace.login(clientAssertion) + const isValidSignature = await verifyMessage({ + signer: await signer.getAddress(), + signature: signature, + typedData: { + types, + domain, + message, + }, + provider: zerodevProvider, + }) + + assert.isTrue(isValidSignature) + }) + + it('should initialize nevermined with zerodev provider', async () => { + nevermined = await Nevermined.getInstance(config) + assert.isDefined(nevermined) + }) + + it('should generate a client assertion with a zerodev signer', async () => { + const signer = zerodevProvider.getAccountSigner() + const account = await Account.fromZeroDevSigner(signer) + + clientAssertion = await nevermined.utils.jwt.generateClientAssertion(account, 'hello world') + assert.isDefined(clientAssertion) + + const jwtPayload = decodeJwt(clientAssertion) + assert.equal(jwtPayload.iss, await signer.getAddress()) }) - it('should request some nevermined tokens', async () => { - const accountSigner = zerodevProvider.getAccountSigner() - const accountAddress = await accountSigner.getAddress() + it('should login to the marketplace api', async () => { + const accessToken = await nevermined.services.marketplace.login(clientAssertion) + assert.isDefined(accessToken) + + const jwtPayload = decodeJwt(accessToken) + const signer = zerodevProvider.getAccountSigner() + assert.equal(jwtPayload.iss, await signer.getAddress()) + assert.isDefined(jwtPayload.sub) - console.log('requesting tokens for account', accountAddress) - const result = await nevermined.keeper.dispenser.requestTokens(10, accountAddress) - assert.isDefined(result) + userId = jwtPayload.sub }) - it('should create a new asset with zerodev provider', async () => { + it('should register an asset with a zerodev account', async () => { + const metadata = getMetadata() + metadata.userId = userId const assetAttributes = AssetAttributes.getInstance({ - metadata: getMetadata(), + metadata, services: [ { serviceType: 'access', - price: new AssetPrice(await owner.getAddress(), 0n), + price: new AssetPrice(), }, ], providers: [config.neverminedNodeAddress], }) - const ddo = await nevermined.assets.create(assetAttributes, account) + const signer = zerodevProvider.getAccountSigner() + const account = await nevermined.accounts.fromZeroDevSigner(signer) + const ddo = await nevermined.assets.create(assetAttributes, account, undefined, { + zeroDevSigner: signer, + }) assert.isDefined(ddo) + console.log(ddo) }) }) diff --git a/integration/tsconfig.json b/integration/tsconfig.json index bd2f066ca..4dcca442c 100644 --- a/integration/tsconfig.json +++ b/integration/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "moduleResolution": "NodeNext", + "moduleResolution": "Node", "resolveJsonModule": true, "lib": ["es6", "es7", "dom", "ES2020"], "target": "ES2020", diff --git a/package.json b/package.json index 188f2a5f1..128521d15 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,9 @@ }, "homepage": "https://github.com/nevermined-io/sdk-js#readme", "dependencies": { + "@alchemy/aa-core": "^0.1.0-alpha.32", "@apollo/client": "^3.7.16", - "@zerodev/sdk": "^4.0.17", + "@zerodev/sdk": "^4.0.29", "assert": "^2.0.0", "cross-fetch": "^4.0.0", "crypto-browserify": "^3.12.0", @@ -76,6 +77,7 @@ "whatwg-url": "^13.0.0" }, "devDependencies": { + "@ambire/signature-validator": "^1.3.1", "@commitlint/cli": "^17.4.2", "@commitlint/config-conventional": "^17.4.2", "@faker-js/faker": "^6.3.1", diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index dcdc5e3d1..0ecf446e8 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -121,7 +121,7 @@ export class ContractHandler extends Instantiable { this.logger.debug(`Deploying abi using account: ${from.getId()}`) const signer = await this.nevermined.accounts.findSigner(from.getId()) - const contract = new ethers.ContractFactory(artifact.abi, artifact.bytecode, signer) + const contract = new ethers.ContractFactory(artifact.abi, artifact.bytecode, signer as any) const isZos = contract.interface.hasFunction('initialize') const argument = isZos ? [] : args @@ -144,7 +144,7 @@ export class ContractHandler extends Instantiable { if (isZos) { const methodSignature = ContractHandler.getSignatureOfMethod(baseContract, 'initialize', args) - const contract = baseContract.connect(signer) + const contract = baseContract.connect(signer as any) // estimate gas const gasLimit = await contract[methodSignature].estimateGas(...args, { diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 6e59a857e..e1bab8271 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -7,9 +7,11 @@ import { ContractTransactionReceipt, ContractTransactionResponse, FunctionFragment, + TransactionReceipt, ethers, } from 'ethers' import { jsonReplacer, parseUnits } from '../../sdk' +import { ZeroDevAccountSigner } from '@zerodev/sdk' export interface TxParameters { value?: string gasLimit?: bigint @@ -18,6 +20,7 @@ export interface TxParameters { maxPriorityFeePerGas?: string maxFeePerGas?: string signer?: ethers.Signer + zeroDevSigner?: ZeroDevAccountSigner<'ECDSA'> nonce?: number progress?: (data: any) => void } @@ -144,13 +147,80 @@ export abstract class ContractBase extends Instantiable { }) } - // const transactionReceipt: ContractTransactionReceipt = await transactionResponse.wait() + const transactionReceipt: ContractTransactionReceipt = await transactionResponse.wait() if (progress) { progress({ stage: 'receipt', args: this.searchMethodInputs(name, args), - // transactionReceipt, + transactionReceipt, + method: name, + from, + value, + contractName: this.contractName, + contractAddress: this.address, + gasLimit, + }) + } + + return transactionResponse as any + } + + private async internalSendZeroDev( + name: string, + from: string, + args: any[], + txparams: any, + contract: ethers.BaseContract, + progress: (data: any) => void, + ): Promise { + const methodSignature = this.getSignatureOfMethod(name, args) + // Uncomment to debug contract calls + // console.debug(`Making contract call ....: ${name} - ${from}`) + // console.debug(`With args - ${JSON.stringify(args)}`) + // console.debug(`And signature - ${methodSignature}`) + + const { gasLimit, value } = txparams + // make the call + if (progress) { + progress({ + stage: 'sending', + args: this.searchMethodInputs(name, args), + method: name, + from, + value, + contractName: this.contractName, + contractAddress: this.address, + gasLimit, + }) + } + + const transactionResponse: ContractTransactionResponse = await contract[methodSignature]( + ...args, + txparams, + ) + if (progress) { + progress({ + stage: 'sent', + args: this.searchMethodInputs(name, args), + transactionResponse, + method: name, + from, + value, + contractName: this.contractName, + contractAddress: this.address, + gasLimit, + }) + } + + const transactionReceipt: TransactionReceipt = + await transactionResponse.provider.waitForTransaction(transactionResponse.hash) + + if (progress) { + progress({ + stage: 'receipt', + args: this.searchMethodInputs(name, args), + transactionReceipt, method: name, from, value, @@ -169,6 +239,19 @@ export abstract class ContractBase extends Instantiable { args: any[], params: TxParameters = {}, ): Promise { + if (params.zeroDevSigner) { + const paramsFixed = { ...params, signer: undefined } + const contract = this.contract.connect(params.zeroDevSigner as any) + return await this.internalSendZeroDev( + name, + from, + args, + paramsFixed, + contract, + params.progress, + ) + } + if (this.config.zerodevProvider) { const signer = this.config.zerodevProvider.getAccountSigner() const contract = new Contract(this.address, this.contract.interface, signer as any) @@ -185,7 +268,7 @@ export abstract class ContractBase extends Instantiable { // get signer const signer = await this.nevermined.accounts.findSigner(from) - const contract = this.contract.connect(signer) + const contract = this.contract.connect(signer as any) // calculate gas cost let { gasLimit } = params diff --git a/src/keeper/utils.ts b/src/keeper/utils.ts index ff33a2ec3..d16b555a4 100644 --- a/src/keeper/utils.ts +++ b/src/keeper/utils.ts @@ -1,4 +1,5 @@ -import { ethers } from 'ethers' +import { Signer, TypedDataField, Wallet, ethers } from 'ethers' +import { SmartAccountSigner, SignTypedDataParams, Hex } from '@alchemy/aa-core' import { KeeperError } from '../errors' export async function getNetworkName(networkId: number): Promise { @@ -91,3 +92,27 @@ export class Web3ProviderWrapper { .then((result) => callback(null, { jsonrpc: payload.jsonrpc, id, result })) } } + +const isWalletEthersV6 = (signer: any): signer is Wallet => + signer && signer.signTypedData !== undefined + +// zerodev ethersV6 compatibility +export const convertEthersV6SignerToAccountSigner = ( + signer: Signer | Wallet, +): SmartAccountSigner => { + return { + getAddress: async () => Promise.resolve((await signer.getAddress()) as `0x${string}`), + signMessage: async (msg: Uint8Array | string) => + (await signer.signMessage(msg)) as `0x${string}`, + signTypedData: async (params: SignTypedDataParams) => { + if (!isWalletEthersV6(signer)) { + throw Error('signTypedData method not implemented in signer') + } + return (await signer.signTypedData( + params.domain!, + params.types as unknown as Record, + params.message, + )) as Hex + }, + } +} diff --git a/src/models/NeverminedOptions.ts b/src/models/NeverminedOptions.ts index 3ce241324..41fefd0b2 100644 --- a/src/models/NeverminedOptions.ts +++ b/src/models/NeverminedOptions.ts @@ -1,7 +1,7 @@ import { ethers } from 'ethers' import { LogLevel } from '../utils' import { AaveConfig } from './' -import { ZeroDevEthersProvider } from '@zerodev/sdk' +import { ZeroDevAccountSigner, ZeroDevEthersProvider } from '@zerodev/sdk' export class NeverminedOptions { /** @@ -69,6 +69,8 @@ export class NeverminedOptions { public accounts?: ethers.Signer[] + public zeroDevAccounts?: ZeroDevAccountSigner<'ECDSA'>[] + /** * IPFS variables enable the resolution of DDOs (via `assets.resolve`) from CID urls * INFO: For performance purposes, it is recommended to setup a IPFS Infura endpoint to accelerate diff --git a/src/nevermined/Account.ts b/src/nevermined/Account.ts index aa7c9725b..40b2c78b2 100644 --- a/src/nevermined/Account.ts +++ b/src/nevermined/Account.ts @@ -4,18 +4,17 @@ import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { TxParameters } from '../keeper' import { KeeperError } from '../errors' import { BigNumberish } from '../sdk' +import { ZeroDevAccountSigner } from '@zerodev/sdk' /** * Account information. */ export class Account extends Instantiable { private password?: string - - private token?: string - public babyX?: string public babyY?: string public babySecret?: string + public zeroDevSigner: ZeroDevAccountSigner<'ECDSA'> constructor(private id: string = '0x0', config?: InstantiableConfig) { super() @@ -24,6 +23,23 @@ export class Account extends Instantiable { } } + /** + * Returns a nevermined Account from a zerodev signer + * + * @param signer - A zerodev account signer + * @returns The nevermined account + */ + static async fromZeroDevSigner(signer: ZeroDevAccountSigner<'ECDSA'>): Promise { + const address = await signer.getAddress() + const account = new Account(address) + account.zeroDevSigner = signer + return account + } + + public isZeroDev(): boolean { + return this.zeroDevSigner !== undefined + } + public getId() { return this.id } diff --git a/src/nevermined/api/AccountsApi.ts b/src/nevermined/api/AccountsApi.ts index ca6ae138c..52aa1dd44 100644 --- a/src/nevermined/api/AccountsApi.ts +++ b/src/nevermined/api/AccountsApi.ts @@ -3,6 +3,7 @@ import { Account } from '../../nevermined' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { TxParameters as txParams } from '../../keeper' import { ethers } from 'ethers' +import { ZeroDevAccountSigner } from '@zerodev/sdk' /** * Nevermined Accounts API. It allows execute operations related with Ethereum accounts. @@ -38,6 +39,17 @@ export class AccountsApi extends Instantiable { return new Account(address, this.instanceConfig) } + public async fromZeroDevSigner(signer: ZeroDevAccountSigner<'ECDSA'>): Promise { + if (!this.config.zeroDevAccounts) { + this.config.zeroDevAccounts = [] + } + this.config.zeroDevAccounts.push(signer) + const address = await signer.getAddress() + const account = this.getAccount(address) + account.zeroDevSigner = signer + return account + } + /** * Return account balance. * @param account - Account instance. @@ -67,13 +79,20 @@ export class AccountsApi extends Instantiable { } } - public async findSigner(from: string): Promise { + public async findSigner(from: string): Promise> { for (const acc of this.config.accounts || []) { const addr = await acc.getAddress() if (addr.toLowerCase() === from.toLowerCase()) { return acc.connect(this.web3) } } + + for (const acc of this.config.zeroDevAccounts || []) { + const addr = await acc.getAddress() + if (addr === from) { + return acc + } + } return this.web3.getSigner(from) } diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index d3491ff75..3ac99c984 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -3,12 +3,26 @@ import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { Account } from '../Account' import { ethers } from 'ethers' import { Babysig } from '../../models' +import { ZeroDevAccountSigner } from '@zerodev/sdk' export interface Eip712Data { message: string chainId: number } +export interface TypedDataDomain { + name: string + version: string + chainId: number +} + +export interface TypedDataTypes { + Nevermined: { + name: string + type: string + }[] +} + export class EthSignJWT extends SignJWT { protectedHeader: JWSHeaderParameters @@ -17,7 +31,10 @@ export class EthSignJWT extends SignJWT { return this } - public async ethSign(signer: ethers.Signer, eip712Data?: Eip712Data): Promise { + public async ethSign( + signer: ethers.Signer | ZeroDevAccountSigner<'ECDSA'>, + eip712Data?: Eip712Data, + ): Promise { const encoder = new TextEncoder() const decoder = new TextDecoder() @@ -55,9 +72,9 @@ export class EthSignJWT extends SignJWT { message: eip712Data.message, token: decoder.decode(data), } - sign = await signer.signTypedData(domain, types, value) + sign = await EthSignJWT.signTypedMessage(domain, types, value, signer) } else { - sign = await EthSignJWT.signText(decoder.decode(data), signer) + sign = await EthSignJWT.signMessage(decoder.decode(data), signer) } const input = ethers.getBytes(sign) @@ -80,6 +97,34 @@ export class EthSignJWT extends SignJWT { } } + private static async signMessage( + message: string | Uint8Array, + signer: ethers.Signer | ZeroDevAccountSigner<'ECDSA'>, + ): Promise { + if (signer instanceof ZeroDevAccountSigner) { + return signer.signMessageWith6492(message) + } + + return EthSignJWT.signText(message, signer) + } + + private static async signTypedMessage( + domain: TypedDataDomain, + types: TypedDataTypes, + value: Record, + signer: ethers.Signer | ZeroDevAccountSigner<'ECDSA'>, + ): Promise { + if (signer instanceof ZeroDevAccountSigner) { + return signer.signTypedDataWith6492({ + domain, + types: types as any, + message: value, + primaryType: '', + }) + } + return EthSignJWT.signTypedMessage(domain, types, value, signer) + } + private base64url(input: Uint8Array | string): string { return Buffer.from(input) .toString('base64') @@ -112,6 +157,13 @@ export class JwtUtils extends Instantiable { this.tokenCache = new Map() } + public async getSigner(account: Account): Promise> { + const address = ethers.getAddress(account.getId()) + return account.isZeroDev() + ? account.zeroDevSigner + : await this.nevermined.accounts.findSigner(address) + } + public generateCacheKey(...args: string[]): string { return args.join() } @@ -138,9 +190,6 @@ export class JwtUtils extends Instantiable { } public async generateClientAssertion(account: Account, message?: string) { - const address = ethers.getAddress(account.getId()) - const signer = await this.nevermined.accounts.findSigner(address) - let eip712Data: Eip712Data if (message) { eip712Data = { @@ -148,6 +197,9 @@ export class JwtUtils extends Instantiable { chainId: await this.nevermined.keeper.getNetworkId(), } } + + const address = ethers.getAddress(account.getId()) + const signer = await this.getSigner(account) return new EthSignJWT({ iss: address, }) @@ -165,7 +217,7 @@ export class JwtUtils extends Instantiable { babysig?: Babysig, ): Promise { const address = ethers.getAddress(account.getId()) - const signer = await this.nevermined.accounts.findSigner(address) + const signer = await this.getSigner(account) return new EthSignJWT({ iss: address, @@ -190,7 +242,7 @@ export class JwtUtils extends Instantiable { obj: any, ): Promise { const address = ethers.getAddress(account.getId()) - const signer = await this.nevermined.accounts.findSigner(address) + const signer = await this.getSigner(account) return new EthSignJWT({ iss: address, @@ -213,8 +265,7 @@ export class JwtUtils extends Instantiable { babysig?: Babysig, ): Promise { const address = ethers.getAddress(account.getId()) - const signer = await this.nevermined.accounts.findSigner(address) - + const signer = await this.getSigner(account) return new EthSignJWT({ iss: address, aud: this.BASE_AUD + '/download', @@ -254,7 +305,7 @@ export class JwtUtils extends Instantiable { workflowId: string, ): Promise { const address = ethers.getAddress(account.getId()) - const signer = await this.nevermined.accounts.findSigner(address) + const signer = await this.getSigner(account) return new EthSignJWT({ iss: address, @@ -275,7 +326,7 @@ export class JwtUtils extends Instantiable { executionId: string, ): Promise { const address = ethers.getAddress(account.getId()) - const signer = await this.nevermined.accounts.findSigner(address) + const signer = await this.getSigner(account) return new EthSignJWT({ iss: address, @@ -299,8 +350,7 @@ export class JwtUtils extends Instantiable { babysig?: Babysig, ): Promise { const address = ethers.getAddress(account.getId()) - const signer = await this.nevermined.accounts.findSigner(address) - + const signer = await this.getSigner(account) const params = { iss: address, aud: this.BASE_AUD + '/nft-access', From cda807a3c82b77be582b1072b230902144ca23f7 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Wed, 18 Oct 2023 19:19:10 +0200 Subject: [PATCH 141/151] feat: code cleanup and tests --- integration/external/Zerodev.test.ts | 256 +++++++++++++++++--------- src/keeper/ContractHandler.ts | 4 +- src/keeper/contracts/ContractBase.ts | 13 +- src/models/NeverminedOptions.ts | 5 - src/nevermined/api/AccountsApi.ts | 21 +-- src/nevermined/api/RegistryBaseApi.ts | 4 - 6 files changed, 176 insertions(+), 127 deletions(-) diff --git a/integration/external/Zerodev.test.ts b/integration/external/Zerodev.test.ts index 390bbfa30..275f124ea 100644 --- a/integration/external/Zerodev.test.ts +++ b/integration/external/Zerodev.test.ts @@ -1,10 +1,13 @@ import { ethers } from 'ethers' import { ZeroDevEthersProvider } from '@zerodev/sdk' import { verifyMessage } from '@ambire/signature-validator' +import * as fs from 'fs' import { Account, AssetAttributes, AssetPrice, + DDO, + MetaData, Nevermined, convertEthersV6SignerToAccountSigner, } from '../../src' @@ -14,118 +17,199 @@ import { config } from '../config' import { getMetadata } from '../utils' describe('Nevermined sdk with zerodev', () => { - let zerodevProvider: ZeroDevEthersProvider<'ECDSA'> let nevermined: Nevermined - let clientAssertion: string - let userId: string before(async () => { - const projectId = process.env.PROJECT_ID! - const owner = ethers.Wallet.createRandom() - - zerodevProvider = await ZeroDevEthersProvider.init('ECDSA', { - projectId, - owner: convertEthersV6SignerToAccountSigner(owner), - }) + nevermined = await Nevermined.getInstance(config) }) - it('should produce a valid EIP-6492 signature', async () => { - const signer = zerodevProvider.getAccountSigner() + describe('Test zerodev signatures and login', () => { + let zerodevProvider: ZeroDevEthersProvider<'ECDSA'> + let clientAssertion: string - const signature = await signer.signMessageWith6492('nevermined') - const isValidSignature = await verifyMessage({ - signer: await signer.getAddress(), - message: 'nevermined', - signature: signature, - provider: zerodevProvider, + before(async () => { + const projectId = process.env.PROJECT_ID! + const owner = ethers.Wallet.createRandom() + + zerodevProvider = await ZeroDevEthersProvider.init('ECDSA', { + projectId, + owner: convertEthersV6SignerToAccountSigner(owner), + }) }) - assert.isTrue(isValidSignature) - }) + it('should produce a valid EIP-6492 signature', async () => { + const signer = zerodevProvider.getAccountSigner() + + const signature = await signer.signMessageWith6492('nevermined') + const isValidSignature = await verifyMessage({ + signer: await signer.getAddress(), + message: 'nevermined', + signature: signature, + provider: zerodevProvider, + }) - it('should provide a valid EIP-6492 typed signature', async () => { - const domain = { - name: 'Nevermined', - version: '1', - chainId: 80001, - } - const types = { - Nevermined: [{ name: 'message', type: 'string' }], - } - const message = { - message: 'nevermined', - } - - const signer = zerodevProvider.getAccountSigner() - const signature = await signer.signTypedDataWith6492({ - domain, - types, - message, - primaryType: '', + assert.isTrue(isValidSignature) }) - const isValidSignature = await verifyMessage({ - signer: await signer.getAddress(), - signature: signature, - typedData: { - types, + it('should provide a valid EIP-6492 typed signature', async () => { + const domain = { + name: 'Nevermined', + version: '1', + chainId: 80001, + } + const types = { + Nevermined: [{ name: 'message', type: 'string' }], + } + const message = { + message: 'nevermined', + } + + const signer = zerodevProvider.getAccountSigner() + const signature = await signer.signTypedDataWith6492({ domain, + types, message, - }, - provider: zerodevProvider, + primaryType: '', + }) + + const isValidSignature = await verifyMessage({ + signer: await signer.getAddress(), + signature: signature, + typedData: { + types, + domain, + message, + }, + provider: zerodevProvider, + }) + + assert.isTrue(isValidSignature) }) - assert.isTrue(isValidSignature) - }) + it('should generate a client assertion with a zerodev signer', async () => { + const signer = zerodevProvider.getAccountSigner() + const account = await Account.fromZeroDevSigner(signer) - it('should initialize nevermined with zerodev provider', async () => { - nevermined = await Nevermined.getInstance(config) - assert.isDefined(nevermined) - }) + clientAssertion = await nevermined.utils.jwt.generateClientAssertion(account, 'hello world') + assert.isDefined(clientAssertion) - it('should generate a client assertion with a zerodev signer', async () => { - const signer = zerodevProvider.getAccountSigner() - const account = await Account.fromZeroDevSigner(signer) + const jwtPayload = decodeJwt(clientAssertion) + assert.equal(jwtPayload.iss, await signer.getAddress()) + }) - clientAssertion = await nevermined.utils.jwt.generateClientAssertion(account, 'hello world') - assert.isDefined(clientAssertion) + it('should login to the marketplace api', async () => { + const accessToken = await nevermined.services.marketplace.login(clientAssertion) + assert.isDefined(accessToken) - const jwtPayload = decodeJwt(clientAssertion) - assert.equal(jwtPayload.iss, await signer.getAddress()) + const jwtPayload = decodeJwt(accessToken) + const signer = zerodevProvider.getAccountSigner() + assert.equal(jwtPayload.iss, await signer.getAddress()) + assert.isDefined(jwtPayload.sub) + }) }) - it('should login to the marketplace api', async () => { - const accessToken = await nevermined.services.marketplace.login(clientAssertion) - assert.isDefined(accessToken) + describe('E2E Asset flow with zerodev', () => { + let zerodevProviderPublisher: ZeroDevEthersProvider<'ECDSA'> + let zerodevProviderConsumer: ZeroDevEthersProvider<'ECDSA'> + let metadata: MetaData + let ddo: DDO + let agreementId: string + + before(async () => { + const projectId = process.env.PROJECT_ID! + const publisher = ethers.Wallet.createRandom() + const consumer = ethers.Wallet.createRandom() + + zerodevProviderPublisher = await ZeroDevEthersProvider.init('ECDSA', { + projectId, + owner: convertEthersV6SignerToAccountSigner(publisher), + }) + + zerodevProviderConsumer = await ZeroDevEthersProvider.init('ECDSA', { + projectId, + owner: convertEthersV6SignerToAccountSigner(consumer), + }) + + const signerPublisher = zerodevProviderPublisher.getAccountSigner() + const accountPublisher = await Account.fromZeroDevSigner(signerPublisher) + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(accountPublisher) + + const accessToken = await nevermined.services.marketplace.login(clientAssertion) + const payload = decodeJwt(accessToken) + + metadata = getMetadata() + metadata.userId = payload.sub + }) - const jwtPayload = decodeJwt(accessToken) - const signer = zerodevProvider.getAccountSigner() - assert.equal(jwtPayload.iss, await signer.getAddress()) - assert.isDefined(jwtPayload.sub) + it('should register an asset with a zerodev account', async () => { + const assetAttributes = AssetAttributes.getInstance({ + metadata, + services: [ + { + serviceType: 'access', + price: new AssetPrice(), + }, + ], + providers: [config.neverminedNodeAddress], + }) + + const signerPublisher = zerodevProviderPublisher.getAccountSigner() + const publisher = await Account.fromZeroDevSigner(signerPublisher) + ddo = await nevermined.assets.create(assetAttributes, publisher, undefined, { + zeroDevSigner: signerPublisher, + }) + + assert.isDefined(ddo) + assert.equal(ddo.publicKey[0].owner, await signerPublisher.getAddress()) + assert.equal(ddo.proof.creator, await signerPublisher.getAddress()) + }) - userId = jwtPayload.sub - }) + it('owner should be able to download the asset', async () => { + const signerPublisher = zerodevProviderPublisher.getAccountSigner() + const publisher = await Account.fromZeroDevSigner(signerPublisher) + const folder = '/tmp/nevermined/sdk-js' - it('should register an asset with a zerodev account', async () => { - const metadata = getMetadata() - metadata.userId = userId - const assetAttributes = AssetAttributes.getInstance({ - metadata, - services: [ - { - serviceType: 'access', - price: new AssetPrice(), - }, - ], - providers: [config.neverminedNodeAddress], + const path = (await nevermined.assets.download(ddo.id, publisher, folder, -1)) as string + const files = await new Promise((resolve) => { + fs.readdir(path, (e, fileList) => { + resolve(fileList) + }) + }) + + assert.deepEqual(files, ['README.md', 'ddo-example.json']) + }) + + it('consumer should be able to order the asset with a zerodev account', async () => { + const signerConsumer = zerodevProviderConsumer.getAccountSigner() + const consumer = await Account.fromZeroDevSigner(signerConsumer) + agreementId = await nevermined.assets.order(ddo.id, 'access', consumer, { + zeroDevSigner: signerConsumer, + }) + + assert.isDefined(agreementId) }) - const signer = zerodevProvider.getAccountSigner() - const account = await nevermined.accounts.fromZeroDevSigner(signer) - const ddo = await nevermined.assets.create(assetAttributes, account, undefined, { - zeroDevSigner: signer, + it('consumer should be able to access ordered assets with zerodev account', async () => { + const signerConsumer = zerodevProviderConsumer.getAccountSigner() + const consumer = await Account.fromZeroDevSigner(signerConsumer) + const folder = '/tmp/nevermined/sdk-js' + + const path = (await nevermined.assets.access( + agreementId, + ddo.id, + 'access', + consumer, + folder, + -1, + )) as string + + const files = await new Promise((resolve) => { + fs.readdir(path, (e, fileList) => { + resolve(fileList) + }) + }) + + assert.deepEqual(files, ['README.md', 'ddo-example.json']) }) - assert.isDefined(ddo) - console.log(ddo) }) }) diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index 0ecf446e8..dcdc5e3d1 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -121,7 +121,7 @@ export class ContractHandler extends Instantiable { this.logger.debug(`Deploying abi using account: ${from.getId()}`) const signer = await this.nevermined.accounts.findSigner(from.getId()) - const contract = new ethers.ContractFactory(artifact.abi, artifact.bytecode, signer as any) + const contract = new ethers.ContractFactory(artifact.abi, artifact.bytecode, signer) const isZos = contract.interface.hasFunction('initialize') const argument = isZos ? [] : args @@ -144,7 +144,7 @@ export class ContractHandler extends Instantiable { if (isZos) { const methodSignature = ContractHandler.getSignatureOfMethod(baseContract, 'initialize', args) - const contract = baseContract.connect(signer as any) + const contract = baseContract.connect(signer) // estimate gas const gasLimit = await contract[methodSignature].estimateGas(...args, { diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index e1bab8271..f9c05c006 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -3,7 +3,6 @@ import { ContractEvent, EventHandler, SubgraphEvent } from '../../events' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { KeeperError } from '../../errors' import { - Contract, ContractTransactionReceipt, ContractTransactionResponse, FunctionFragment, @@ -163,7 +162,7 @@ export abstract class ContractBase extends Instantiable { }) } - return transactionResponse as any + return transactionReceipt } private async internalSendZeroDev( @@ -230,7 +229,7 @@ export abstract class ContractBase extends Instantiable { }) } - return transactionResponse as any + return transactionReceipt as ContractTransactionReceipt } public async send( @@ -252,12 +251,6 @@ export abstract class ContractBase extends Instantiable { ) } - if (this.config.zerodevProvider) { - const signer = this.config.zerodevProvider.getAccountSigner() - const contract = new Contract(this.address, this.contract.interface, signer as any) - return await this.internalSend(name, from, args, params, contract, params.progress) - } - if (params.signer) { const paramsFixed = { ...params, signer: undefined } const contract = this.contract.connect(params.signer) @@ -268,7 +261,7 @@ export abstract class ContractBase extends Instantiable { // get signer const signer = await this.nevermined.accounts.findSigner(from) - const contract = this.contract.connect(signer as any) + const contract = this.contract.connect(signer) // calculate gas cost let { gasLimit } = params diff --git a/src/models/NeverminedOptions.ts b/src/models/NeverminedOptions.ts index 41fefd0b2..82eb17872 100644 --- a/src/models/NeverminedOptions.ts +++ b/src/models/NeverminedOptions.ts @@ -1,7 +1,6 @@ import { ethers } from 'ethers' import { LogLevel } from '../utils' import { AaveConfig } from './' -import { ZeroDevAccountSigner, ZeroDevEthersProvider } from '@zerodev/sdk' export class NeverminedOptions { /** @@ -69,8 +68,6 @@ export class NeverminedOptions { public accounts?: ethers.Signer[] - public zeroDevAccounts?: ZeroDevAccountSigner<'ECDSA'>[] - /** * IPFS variables enable the resolution of DDOs (via `assets.resolve`) from CID urls * INFO: For performance purposes, it is recommended to setup a IPFS Infura endpoint to accelerate @@ -86,6 +83,4 @@ export class NeverminedOptions { * Use a gas station to calculate transaction fees */ public gasStationUri?: string - - public zerodevProvider?: ZeroDevEthersProvider<'ECDSA'> } diff --git a/src/nevermined/api/AccountsApi.ts b/src/nevermined/api/AccountsApi.ts index 52aa1dd44..ca6ae138c 100644 --- a/src/nevermined/api/AccountsApi.ts +++ b/src/nevermined/api/AccountsApi.ts @@ -3,7 +3,6 @@ import { Account } from '../../nevermined' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { TxParameters as txParams } from '../../keeper' import { ethers } from 'ethers' -import { ZeroDevAccountSigner } from '@zerodev/sdk' /** * Nevermined Accounts API. It allows execute operations related with Ethereum accounts. @@ -39,17 +38,6 @@ export class AccountsApi extends Instantiable { return new Account(address, this.instanceConfig) } - public async fromZeroDevSigner(signer: ZeroDevAccountSigner<'ECDSA'>): Promise { - if (!this.config.zeroDevAccounts) { - this.config.zeroDevAccounts = [] - } - this.config.zeroDevAccounts.push(signer) - const address = await signer.getAddress() - const account = this.getAccount(address) - account.zeroDevSigner = signer - return account - } - /** * Return account balance. * @param account - Account instance. @@ -79,20 +67,13 @@ export class AccountsApi extends Instantiable { } } - public async findSigner(from: string): Promise> { + public async findSigner(from: string): Promise { for (const acc of this.config.accounts || []) { const addr = await acc.getAddress() if (addr.toLowerCase() === from.toLowerCase()) { return acc.connect(this.web3) } } - - for (const acc of this.config.zeroDevAccounts || []) { - const addr = await acc.getAddress() - if (addr === from) { - return acc - } - } return this.web3.getSigner(from) } diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 8f32390d9..dd8b748b7 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -575,10 +575,6 @@ export abstract class RegistryBaseApi extends Instantiable { const service = ddo.findServiceByReference(serviceReference) const templateName = service.attributes.serviceAgreementTemplate.contractName - console.log( - `Ordering Asset with reference ${serviceReference}, template ${templateName} and price ${service.attributes.main.price}`, - ) - const template = keeper.getAccessTemplateByName(templateName) this.logger.log(`Creating ${serviceReference} agreement and paying`) From 61c758d707e39cadd4445afb5bea182f9448909d Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 19 Oct 2023 11:04:15 +0200 Subject: [PATCH 142/151] fix: update an pin zerodev sdk and alchemy aa-core to latest versions --- package.json | 6 +++--- src/keeper/utils.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 128521d15..1e3a6ed0e 100644 --- a/package.json +++ b/package.json @@ -51,17 +51,17 @@ }, "homepage": "https://github.com/nevermined-io/sdk-js#readme", "dependencies": { - "@alchemy/aa-core": "^0.1.0-alpha.32", + "@alchemy/aa-core": "0.1.0", "@apollo/client": "^3.7.16", - "@zerodev/sdk": "^4.0.29", + "@zerodev/sdk": "4.0.30", "assert": "^2.0.0", "cross-fetch": "^4.0.0", "crypto-browserify": "^3.12.0", "deprecated-decorator": "^0.1.6", "ethers": "^6.7.1", + "form-data": "^4.0.0", "graphql": "^16.7.1", "https-browserify": "^1.0.0", - "form-data": "^4.0.0", "jose": "^4.5.1", "js-file-download": "^0.4.12", "lodash": "^4.17.21", diff --git a/src/keeper/utils.ts b/src/keeper/utils.ts index d16b555a4..dfdbb65fc 100644 --- a/src/keeper/utils.ts +++ b/src/keeper/utils.ts @@ -101,6 +101,7 @@ export const convertEthersV6SignerToAccountSigner = ( signer: Signer | Wallet, ): SmartAccountSigner => { return { + signerType: '', getAddress: async () => Promise.resolve((await signer.getAddress()) as `0x${string}`), signMessage: async (msg: Uint8Array | string) => (await signer.signMessage(msg)) as `0x${string}`, From 85d6d59d768be9f91c1084d502230f7056a5cfb0 Mon Sep 17 00:00:00 2001 From: enrique Date: Thu, 19 Oct 2023 11:28:16 +0200 Subject: [PATCH 143/151] fix: search by subscription needs to filter by tokenId --- src/nevermined/api/SearchApi.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 80a7496ea..8cb788929 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -473,6 +473,7 @@ export class SearchApi extends Instantiable { */ public async servicesByNftContract( nftContractAddress: string, + tokenId: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -522,6 +523,12 @@ export class SearchApi extends Instantiable { nftContractAddress, }, }, + { + match: { + 'service.attributes.serviceAgreementTemplate.conditions.parameters.value': + tokenId, + }, + }, ], }, }, @@ -588,6 +595,7 @@ export class SearchApi extends Instantiable { return this.servicesByNftContract( nftContractAddress, + subscriptionDid, customNestedQueries, offset, page, @@ -610,6 +618,7 @@ export class SearchApi extends Instantiable { */ public async datasetsByNftContract( nftContractAddress: string, + tokenId: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -659,6 +668,12 @@ export class SearchApi extends Instantiable { nftContractAddress, }, }, + { + match: { + 'service.attributes.serviceAgreementTemplate.conditions.parameters.value': + tokenId, + }, + }, ], }, }, @@ -725,6 +740,7 @@ export class SearchApi extends Instantiable { return this.datasetsByNftContract( nftContractAddress, + subscriptionDid, customNestedQueries, offset, page, From dc6e90675c88565fc4739ab9fdd63263f7f67f0b Mon Sep 17 00:00:00 2001 From: enrique Date: Thu, 19 Oct 2023 11:36:36 +0200 Subject: [PATCH 144/151] feat: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3ec92351a..770f35222 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc18", + "version": "2.0.0-rc19", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 418877ed6097e73d0119e533c66e616ea729f012 Mon Sep 17 00:00:00 2001 From: enrique Date: Thu, 19 Oct 2023 11:50:59 +0200 Subject: [PATCH 145/151] fix: add filter by nft type --- src/nevermined/api/SearchApi.ts | 82 ++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 26 deletions(-) diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 8cb788929..77f9a19c3 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -473,7 +473,8 @@ export class SearchApi extends Instantiable { */ public async servicesByNftContract( nftContractAddress: string, - tokenId: string, + nftType?: string, + tokenId?: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -488,18 +489,30 @@ export class SearchApi extends Instantiable { bool: { filter: [ { match: { 'service.type': 'metadata' } }, - { - bool: { - should: [ - { match: { 'service.attributes.main.nftType': NeverminedNFT721Type.nft721 } }, - { - match: { - 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, - }, + nftType + ? { + match: { + 'service.attributes.main.nftType': nftType, }, - ], - }, - }, + } + : { + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], + }, + }, { exists: { field: 'service.attributes.main.webService', @@ -523,7 +536,7 @@ export class SearchApi extends Instantiable { nftContractAddress, }, }, - { + tokenId && { match: { 'service.attributes.serviceAgreementTemplate.conditions.parameters.value': tokenId, @@ -570,6 +583,7 @@ export class SearchApi extends Instantiable { */ public async servicesBySubscription( subscriptionDid: string, + nftType?: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -595,6 +609,7 @@ export class SearchApi extends Instantiable { return this.servicesByNftContract( nftContractAddress, + nftType, subscriptionDid, customNestedQueries, offset, @@ -618,7 +633,8 @@ export class SearchApi extends Instantiable { */ public async datasetsByNftContract( nftContractAddress: string, - tokenId: string, + nftType?: string, + tokenId?: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -633,18 +649,30 @@ export class SearchApi extends Instantiable { bool: { filter: [ { match: { 'service.type': 'metadata' } }, - { - bool: { - should: [ - { match: { 'service.attributes.main.nftType': NeverminedNFT721Type.nft721 } }, - { - match: { - 'service.attributes.main.nftType': NeverminedNFT1155Type.nft1155Credit, - }, + nftType + ? { + match: { + 'service.attributes.main.nftType': nftType, }, - ], - }, - }, + } + : { + bool: { + should: [ + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT721Type.nft721Subscription, + }, + }, + { + match: { + 'service.attributes.main.nftType': + NeverminedNFT1155Type.nft1155Credit, + }, + }, + ], + }, + }, { match: { 'service.attributes.main.type': 'dataset', @@ -668,7 +696,7 @@ export class SearchApi extends Instantiable { nftContractAddress, }, }, - { + tokenId && { match: { 'service.attributes.serviceAgreementTemplate.conditions.parameters.value': tokenId, @@ -715,6 +743,7 @@ export class SearchApi extends Instantiable { */ public async datasetsBySubscription( subscriptionDid: string, + nftType?: string, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -740,6 +769,7 @@ export class SearchApi extends Instantiable { return this.datasetsByNftContract( nftContractAddress, + nftType, subscriptionDid, customNestedQueries, offset, From 538cb1421c053bae32548eb67ed564769c4d58d7 Mon Sep 17 00:00:00 2001 From: enrique Date: Thu, 19 Oct 2023 12:01:32 +0200 Subject: [PATCH 146/151] fix: add type2 --- src/nevermined/api/SearchApi.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 77f9a19c3..62075d7e2 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -263,7 +263,7 @@ export class SearchApi extends Instantiable { */ public async subscriptionsCreated( account: Account, - nftType?: string, + nftType?: NeverminedNFT721Type | NeverminedNFT1155Type, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -355,8 +355,8 @@ export class SearchApi extends Instantiable { */ public async subscriptionsPurchased( account: Account, - nftType: string, - ercType: 721 | 1155, + nftType?: NeverminedNFT721Type | NeverminedNFT1155Type, + ercType?: 721 | 1155, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -473,7 +473,7 @@ export class SearchApi extends Instantiable { */ public async servicesByNftContract( nftContractAddress: string, - nftType?: string, + nftType?: NeverminedNFT721Type | NeverminedNFT1155Type, tokenId?: string, customNestedQueries?: SearchQuery['query'][], offset = 100, @@ -583,7 +583,7 @@ export class SearchApi extends Instantiable { */ public async servicesBySubscription( subscriptionDid: string, - nftType?: string, + nftType?: NeverminedNFT721Type | NeverminedNFT1155Type, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, @@ -633,7 +633,7 @@ export class SearchApi extends Instantiable { */ public async datasetsByNftContract( nftContractAddress: string, - nftType?: string, + nftType?: NeverminedNFT721Type | NeverminedNFT1155Type, tokenId?: string, customNestedQueries?: SearchQuery['query'][], offset = 100, @@ -743,7 +743,7 @@ export class SearchApi extends Instantiable { */ public async datasetsBySubscription( subscriptionDid: string, - nftType?: string, + nftType?: NeverminedNFT721Type | NeverminedNFT1155Type, customNestedQueries?: SearchQuery['query'][], offset = 100, page = 1, From afbfae6e58139d5432898ea0dc018c909fe71d74 Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Thu, 19 Oct 2023 10:22:20 +0000 Subject: [PATCH 147/151] Automated CHANGELOG.md update Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f2f22c80..35e6d119f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,10 +66,22 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) - chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) -#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc18...v2.0.0-rc2) +#### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc19...v2.0.0-rc2) > 26 July 2023 +#### [v2.0.0-rc19](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc18...v2.0.0-rc19) + +> 19 October 2023 + +- fix: search by subscription needs to filter by tokenId [`#598`](https://github.com/nevermined-io/sdk-js/pull/598) +- Feat/nvm tools actions v0.15.0 [`#596`](https://github.com/nevermined-io/sdk-js/pull/596) +- Adding optional resource type attributes [`#597`](https://github.com/nevermined-io/sdk-js/pull/597) +- Cleaning tokenId prefix on DDO attribute [`#595`](https://github.com/nevermined-io/sdk-js/pull/595) +- fix: add filter by nft type [`418877e`](https://github.com/nevermined-io/sdk-js/commit/418877ed6097e73d0119e533c66e616ea729f012) +- fix: add type2 [`538cb14`](https://github.com/nevermined-io/sdk-js/commit/538cb1421c053bae32548eb67ed564769c4d58d7) +- ci: nvm tools v0.15.0 [`c2a7007`](https://github.com/nevermined-io/sdk-js/commit/c2a70078805da0ec46bead9fc2b56d452a5c3817) + #### [v2.0.0-rc18](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc17...v2.0.0-rc18) > 16 October 2023 @@ -529,7 +541,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384) - linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4) -#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) +### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) > 14 February 2023 @@ -1268,7 +1280,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -1531,7 +1543,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -2037,7 +2049,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -2076,7 +2088,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 3a13b536e792aa7c7725b4ff7f65f4b0af0f0e07 Mon Sep 17 00:00:00 2001 From: enrique Date: Thu, 19 Oct 2023 13:47:18 +0200 Subject: [PATCH 148/151] fix: filter by token id without did:nv: --- package.json | 2 +- src/nevermined/api/SearchApi.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 770f35222..10585ba96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc19", + "version": "2.0.0-rc20", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 62075d7e2..8fb482eb5 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -610,7 +610,7 @@ export class SearchApi extends Instantiable { return this.servicesByNftContract( nftContractAddress, nftType, - subscriptionDid, + subscriptionDid.replace('did:nv:', ''), customNestedQueries, offset, page, @@ -770,7 +770,7 @@ export class SearchApi extends Instantiable { return this.datasetsByNftContract( nftContractAddress, nftType, - subscriptionDid, + subscriptionDid.replace('did:nv:', ''), customNestedQueries, offset, page, From 7fb5baacb7394e991721ca10210be2397a357939 Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Thu, 19 Oct 2023 12:15:17 +0000 Subject: [PATCH 149/151] Automated CHANGELOG.md update Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35e6d119f..f8d8a86ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,14 +57,44 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore: tests [`bd17944`](https://github.com/nevermined-io/sdk-js/commit/bd17944285e34a775adf83352ecd07766cf42bc4) - chore: adding v2.0.0-rc3 Changelog updates [`4d125f2`](https://github.com/nevermined-io/sdk-js/commit/4d125f2f39e7387488bf107966e9d5c2ef9b88d8) -#### [v2.0.0-rc3](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc2...v2.0.0-rc3) +#### [v2.0.0-rc3](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc20...v2.0.0-rc3) > 27 July 2023 +#### [v2.0.0-rc20](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc2...v2.0.0-rc20) + +> 19 October 2023 + +- fix: filter by token id without did:nv: [`#599`](https://github.com/nevermined-io/sdk-js/pull/599) +- feat: initial support for zerodev [`#578`](https://github.com/nevermined-io/sdk-js/pull/578) +- fix: search by subscription needs to filter by tokenId [`#598`](https://github.com/nevermined-io/sdk-js/pull/598) +- Feat/nvm tools actions v0.15.0 [`#596`](https://github.com/nevermined-io/sdk-js/pull/596) +- Adding optional resource type attributes [`#597`](https://github.com/nevermined-io/sdk-js/pull/597) +- Cleaning tokenId prefix on DDO attribute [`#595`](https://github.com/nevermined-io/sdk-js/pull/595) +- fix: skip the encryption through the Node when there is no files [`#594`](https://github.com/nevermined-io/sdk-js/pull/594) +- Small utility improvements [`#592`](https://github.com/nevermined-io/sdk-js/pull/592) +- feat: support search base on nftType [`#590`](https://github.com/nevermined-io/sdk-js/pull/590) +- Small fixes and tests for NFT1155 flows [`#589`](https://github.com/nevermined-io/sdk-js/pull/589) +- fix: form-data lib was missing [`#588`](https://github.com/nevermined-io/sdk-js/pull/588) +- fix: signTypedData [`#587`](https://github.com/nevermined-io/sdk-js/pull/587) +- test: e2e testing of NVM App flows [`#585`](https://github.com/nevermined-io/sdk-js/pull/585) +- updating for contracts 3.5.0 [`#584`](https://github.com/nevermined-io/sdk-js/pull/584) +- Feat/node 18 [`#580`](https://github.com/nevermined-io/sdk-js/pull/580) +- Getting url from DDO when claiming NFT [`#582`](https://github.com/nevermined-io/sdk-js/pull/582) +- Fix/arbitrum fees [`#577`](https://github.com/nevermined-io/sdk-js/pull/577) +- Making Curve & Aave contracts optional [`#576`](https://github.com/nevermined-io/sdk-js/pull/576) +- Allowing to update files and services private stuff (SDKv1) [`#575`](https://github.com/nevermined-io/sdk-js/pull/575) +- fix: allowing to update files and services private metadata [`#574`](https://github.com/nevermined-io/sdk-js/pull/574) +- Allow off-chain register and resolve methods [`#573`](https://github.com/nevermined-io/sdk-js/pull/573) +- chore(deps): bump whatwg-url from 7.1.0 to 13.0.0 [`#527`](https://github.com/nevermined-io/sdk-js/pull/527) +- test: validating downloads by owner without access service [`#570`](https://github.com/nevermined-io/sdk-js/pull/570) +- Adapting to contracts v3.3.x [`#566`](https://github.com/nevermined-io/sdk-js/pull/566) +- E2E integration with Credit Subscriptions [`#563`](https://github.com/nevermined-io/sdk-js/pull/563) +- Feat/update mocha [`#564`](https://github.com/nevermined-io/sdk-js/pull/564) - feat: reduce number of calls to chainId [`#560`](https://github.com/nevermined-io/sdk-js/pull/560) -- test: e2e tests for credit subscriptions [`5070f31`](https://github.com/nevermined-io/sdk-js/commit/5070f319baaa7fa361e103c6e1a4ffac2548012f) -- feat: subscription by credits api [`f97aa61`](https://github.com/nevermined-io/sdk-js/commit/f97aa61c4328a7bc8ea1f14f584b3664876970db) -- chore: adapting nft 1155 to duration and transfer params [`a133315`](https://github.com/nevermined-io/sdk-js/commit/a133315c8b217cec7d41e6f863277dfe94fce98a) +- fix: adaptations and tests for NVM App 1155 flows [`e97c3ac`](https://github.com/nevermined-io/sdk-js/commit/e97c3acfb5b80d22aca29328e92f2c9f66a153bd) +- fix: new artifacts for tokens [`65f0b90`](https://github.com/nevermined-io/sdk-js/commit/65f0b907b71bdf8ecf95b37acbb3220ee52fa7f2) +- feat: e2e asset creation working [`be0d681`](https://github.com/nevermined-io/sdk-js/commit/be0d6811ade79a81746be3522ad5fc1a826f732d) #### [v2.0.0-rc2](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc19...v2.0.0-rc2) From 54dd80f10ed6ab3a138058820641b3175c419985 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 19 Oct 2023 14:44:02 +0200 Subject: [PATCH 150/151] fix: docs build - updated typedoc related dependencies - updated auto-generated documentatio --- .../classes/AaveBorrowCondition.md | 968 +++++ .../classes/AaveCollateralDepositCondition.md | 972 +++++ .../AaveCollateralWithdrawCondition.md | 964 +++++ docs/api-reference/classes/AaveCredit.md | 682 ++++ .../classes/AaveCreditTemplate.md | 1600 +++++++++ .../classes/AaveRepayCondition.md | 968 +++++ docs/api-reference/classes/AccessCondition.md | 1006 ++++++ docs/api-reference/classes/AccessService.md | 402 +++ docs/api-reference/classes/AccessTemplate.md | 1439 ++++++++ docs/api-reference/classes/Account.md | 353 +- docs/api-reference/classes/Accounts.md | 489 --- docs/api-reference/classes/AccountsApi.md | 434 +++ .../classes/AgreementStoreManager.md | 705 ++++ .../classes/AgreementTemplate.md | 609 ++-- docs/api-reference/classes/AgreementsApi.md | 462 +++ docs/api-reference/classes/ApiError.md | 165 + docs/api-reference/classes/AssetAttributes.md | 218 ++ docs/api-reference/classes/AssetError.md | 165 + docs/api-reference/classes/AssetPrice.md | 352 ++ .../classes/AssetPublicationOptions.md | 40 + docs/api-reference/classes/AssetsApi.md | 1019 ++++++ ...abyjubPublicKey.md => BabyjubPublicKey.md} | 20 +- docs/api-reference/classes/BaseTemplate.md | 1450 ++++++++ docs/api-reference/classes/Bookmarks.md | 461 +++ docs/api-reference/classes/ClientError.md | 26 +- docs/api-reference/classes/ComputeApi.md | 729 ++++ .../classes/ComputeExecutionCondition.md | 985 ++++++ docs/api-reference/classes/Condition.md | 581 ++- docs/api-reference/classes/ConditionSmall.md | 734 ++++ .../classes/ConditionStoreManager.md | 684 ++++ docs/api-reference/classes/Config.md | 247 -- .../classes/ConsumerCondition.md | 972 +++++ docs/api-reference/classes/ContractBase.md | 642 ++++ docs/api-reference/classes/ContractEvent.md | 476 +++ docs/api-reference/classes/ContractHandler.md | 630 ++++ docs/api-reference/classes/CurveRoyalties.md | 597 ++++ docs/api-reference/classes/CustomToken.md | 788 +++++ docs/api-reference/classes/DDO.md | 794 ++++- docs/api-reference/classes/DDOError.md | 170 + .../classes/DDOPriceNotFoundError.md | 166 + .../classes/DDOServiceNotFoundError.md | 166 + docs/api-reference/classes/DID.md | 90 +- docs/api-reference/classes/DIDRegistry.md | 1491 ++++++++ .../api-reference/classes/DIDSalesTemplate.md | 1438 ++++++++ docs/api-reference/classes/Dispenser.md | 567 +++ .../DistributeNFTCollateralCondition.md | 976 +++++ .../classes/EscrowComputeExecutionTemplate.md | 1461 ++++++++ .../classes/EscrowPaymentCondition.md | 976 +++++ docs/api-reference/classes/EthSignJWT.md | 441 +++ ...events.EventHandler.md => EventHandler.md} | 55 +- docs/api-reference/classes/Files.md | 297 ++ docs/api-reference/classes/GenericContract.md | 573 +++ docs/api-reference/classes/GraphError.md | 165 + docs/api-reference/classes/HttpError.md | 166 + docs/api-reference/classes/Instantiable.md | 283 ++ docs/api-reference/classes/JwtUtils.md | 592 ++++ docs/api-reference/classes/Keeper.md | 415 +-- docs/api-reference/classes/KeeperError.md | 165 + .../classes/LockPaymentCondition.md | 949 +++++ docs/api-reference/classes/MarketplaceApi.md | 340 ++ docs/api-reference/classes/MetadataService.md | 671 ++++ ...eyTransfer.MimcCipher.md => MimcCipher.md} | 20 +- docs/api-reference/classes/NFT1155Api.md | 1598 +++++++++ .../classes/NFT721AccessTemplate.md | 1438 ++++++++ docs/api-reference/classes/NFT721Api.md | 1676 +++++++++ .../classes/NFT721HolderCondition.md | 976 +++++ .../classes/NFT721LockCondition.md | 975 +++++ .../classes/NFT721SalesTemplate.md | 1440 ++++++++ .../classes/NFTAccessCondition.md | 985 ++++++ .../api-reference/classes/NFTAccessService.md | 433 +++ .../classes/NFTAccessTemplate.md | 1439 ++++++++ docs/api-reference/classes/NFTAttributes.md | 501 +++ .../api-reference/classes/NFTContractsBase.md | 725 ++++ docs/api-reference/classes/NFTError.md | 165 + .../classes/NFTHolderCondition.md | 999 ++++++ .../api-reference/classes/NFTLockCondition.md | 955 +++++ docs/api-reference/classes/NFTSalesService.md | 433 +++ .../api-reference/classes/NFTSalesTemplate.md | 1467 ++++++++ .../classes/NFTServiceAttributes.md | 124 + docs/api-reference/classes/NFTsBaseApi.md | 881 +++++ docs/api-reference/classes/Nevermined.md | 434 +-- docs/api-reference/classes/NeverminedEvent.md | 412 +++ docs/api-reference/classes/NeverminedNode.md | 986 ++++++ .../classes/NeverminedNodeError.md | 165 + .../classes/NeverminedOptions.md | 250 ++ docs/api-reference/classes/Nft1155Contract.md | 1026 ++++++ docs/api-reference/classes/Nft721.md | 542 --- docs/api-reference/classes/Nft721Contract.md | 990 ++++++ docs/api-reference/classes/Nfts.md | 1219 ------- docs/api-reference/classes/Permissions.md | 486 +++ docs/api-reference/classes/Profiles.md | 454 +++ docs/api-reference/classes/ProvenanceApi.md | 592 ++++ .../classes/ProviderCondition.md | 1005 ++++++ docs/api-reference/classes/Providers.md | 356 ++ docs/api-reference/classes/RegistryBaseApi.md | 523 +++ .../classes/RewardsDistributor.md | 599 ++++ docs/api-reference/classes/RoyaltyScheme.md | 596 ++++ docs/api-reference/classes/SearchApi.md | 621 ++++ .../api-reference/classes/ServiceAgreement.md | 373 ++ docs/api-reference/classes/ServicesApi.md | 388 ++ docs/api-reference/classes/SignatureUtils.md | 340 ++ .../classes/StandardRoyalties.md | 597 ++++ docs/api-reference/classes/SubgraphEvent.md | 444 +++ ...bleObserver.md => SubscribableObserver.md} | 38 +- ...bablePromise.md => SubscribablePromise.md} | 72 +- .../classes/SubscriptionCreditsNFTApi.md | 1719 +++++++++ .../classes/SubscriptionNFTApi.md | 1809 ++++++++++ .../classes/TemplateStoreManager.md | 687 ++++ docs/api-reference/classes/Token.md | 728 ++++ docs/api-reference/classes/TokenUtils.md | 402 +++ .../classes/TransferDIDOwnershipCondition.md | 977 +++++ .../classes/TransferNFT721Condition.md | 1007 ++++++ .../classes/TransferNFTCondition.md | 1059 ++++++ docs/api-reference/classes/UtilsApi.md | 386 ++ docs/api-reference/classes/Versions.md | 294 ++ docs/api-reference/classes/Web3Error.md | 165 + docs/api-reference/classes/Web3Provider.md | 43 + .../classes/Web3ProviderWrapper.md | 64 + .../classes/WebServiceConnector.md | 586 +++ .../classes/conditions.AaveBorrowCondition.md | 1119 ------ ...nditions.AaveCollateralDepositCondition.md | 1123 ------ ...ditions.AaveCollateralWithdrawCondition.md | 1115 ------ .../classes/conditions.AaveRepayCondition.md | 1119 ------ .../classes/conditions.AccessCondition.md | 1157 ------ .../conditions.ComputeExecutionCondition.md | 1136 ------ .../classes/conditions.ConditionSmall.md | 885 ----- .../classes/conditions.ConsumerCondition.md | 1123 ------ ...itions.DistributeNFTCollateralCondition.md | 1127 ------ .../conditions.EscrowPaymentCondition.md | 1127 ------ .../conditions.LockPaymentCondition.md | 1100 ------ .../conditions.NFT721HolderCondition.md | 1127 ------ .../classes/conditions.NFT721LockCondition.md | 1126 ------ .../classes/conditions.NFTAccessCondition.md | 1136 ------ .../classes/conditions.NFTHolderCondition.md | 1127 ------ .../classes/conditions.NFTLockCondition.md | 1106 ------ .../classes/conditions.ProviderCondition.md | 1156 ------ ...onditions.TransferDIDOwnershipCondition.md | 1128 ------ .../conditions.TransferNFT721Condition.md | 1136 ------ .../conditions.TransferNFTCondition.md | 1172 ------ .../classes/events.ContractEvent.md | 585 --- .../classes/events.NeverminedEvent.md | 521 --- .../classes/events.SubgraphEvent.md | 590 --- .../classes/templates.AaveCreditTemplate.md | 1723 --------- .../classes/templates.AccessTemplate.md | 1562 -------- .../classes/templates.BaseTemplate.md | 1594 --------- .../classes/templates.DIDSalesTemplate.md | 1561 -------- ...emplates.EscrowComputeExecutionTemplate.md | 1576 --------- .../classes/templates.NFT721AccessTemplate.md | 1561 -------- .../classes/templates.NFT721SalesTemplate.md | 1562 -------- .../classes/templates.NFTAccessTemplate.md | 1562 -------- .../classes/templates.NFTSalesTemplate.md | 1563 -------- docs/api-reference/classes/utils.Logger.md | 193 - docs/api-reference/code-reference.md | 1199 ++++++- docs/api-reference/enums/AccessStatus.md | 63 + docs/api-reference/enums/AssetResult.md | 41 + docs/api-reference/enums/ConditionState.md | 8 +- .../api-reference/enums/CreateProgressStep.md | 37 +- docs/api-reference/enums/DIDResolvePolicy.md | 71 + docs/api-reference/enums/ERCType.md | 30 + .../enums/ExecuteProgressStep.md | 52 + .../enums/ExternalResourceFileType.md | 74 + docs/api-reference/enums/ImmutableBackends.md | 30 + .../enums/{utils.LogLevel.md => LogLevel.md} | 24 +- .../enums/NeverminedNFT1155Type.md | 30 + .../enums/NeverminedNFT721Type.md | 52 + .../api-reference/enums/NodeUploadBackends.md | 41 + docs/api-reference/enums/OrderProgressStep.md | 38 +- docs/api-reference/enums/PermissionType.md | 8 +- .../api-reference/enums/PlatformTechStatus.md | 8 +- docs/api-reference/enums/ProvenanceMethod.md | 26 +- .../enums/PublishMetadataOptions.md | 59 + .../enums/PublishOnChainOptions.md | 32 + docs/api-reference/enums/RoyaltyKind.md | 43 + docs/api-reference/enums/State.md | 6 +- docs/api-reference/enums/TemplateState.md | 52 + .../api-reference/enums/UpdateProgressStep.md | 96 + docs/api-reference/enums/ValueType.md | 52 + .../enums/utils.OrderProgressStep.md | 54 - docs/api-reference/interfaces/AaveConfig.md | 63 + .../interfaces/AaveCreditTemplateParams.md | 151 + .../interfaces/AccessProofTemplateParams.md | 41 + .../interfaces/ActedOnBehalfEvent.md | 137 + .../interfaces/AdditionalInformation.md | 55 +- ...Status.md => AgreementConditionsStatus.md} | 4 +- .../api-reference/interfaces/AgreementData.md | 96 + .../interfaces/AgreementInstance.md | 47 + .../interfaces/AgreementPrepareResult.md | 30 + docs/api-reference/interfaces/Algorithm.md | 10 +- docs/api-reference/interfaces/AuthToken.md | 19 + .../interfaces/Authentication.md | 30 + docs/api-reference/interfaces/Babysig.md | 30 + docs/api-reference/interfaces/Balance.md | 30 + docs/api-reference/interfaces/Bookmark.md | 10 +- .../interfaces/ConditionContext.md | 52 + .../api-reference/interfaces/ConditionData.md | 85 + .../interfaces/ConditionInstance.md | 121 + .../interfaces/ConditionInstanceSmall.md | 69 + .../interfaces/ConditionParameters.md | 51 + .../interfaces/ContractEventSubscription.md | 27 + docs/api-reference/interfaces/Curation.md | 8 +- docs/api-reference/interfaces/DDOStatus.md | 48 + docs/api-reference/interfaces/Eip712Data.md | 30 + ...events.EventEmitter.md => EventEmitter.md} | 12 +- docs/api-reference/interfaces/EventOptions.md | 74 + docs/api-reference/interfaces/File.md | 173 - docs/api-reference/interfaces/Filter.md | 7 + .../api-reference/interfaces/GenericAccess.md | 93 + docs/api-reference/interfaces/InputType.md | 30 + .../interfaces/InstantiableConfig.md | 74 + .../interfaces/JsonRpcPayload.md | 52 + .../interfaces/JsonRpcResponse.md | 52 + .../interfaces/KeyTransfer.Babysig.md | 32 - .../interfaces/MarketplaceResults.md | 58 + docs/api-reference/interfaces/MetaData.md | 10 +- .../interfaces/MetaDataExternalResource.md | 187 + docs/api-reference/interfaces/MetaDataMain.md | 60 +- .../interfaces/MethodReflection.md | 63 + docs/api-reference/interfaces/MintedEntry.md | 41 + docs/api-reference/interfaces/NewBookmark.md | 6 +- .../api-reference/interfaces/NewPermission.md | 8 +- docs/api-reference/interfaces/NewProfile.md | 14 +- docs/api-reference/interfaces/NvmConfig.md | 97 + .../interfaces/NvmConfigVersions.md | 77 + docs/api-reference/interfaces/PaymentData.md | 52 + docs/api-reference/interfaces/Permission.md | 12 +- .../interfaces/PlatformKeeperTech.md | 16 +- docs/api-reference/interfaces/PlatformTech.md | 8 +- .../interfaces/PlatformVersions.md | 18 +- docs/api-reference/interfaces/Profile.md | 20 +- docs/api-reference/interfaces/Proof.md | 63 + .../ProvenanceAttributeRegisteredEvent.md | 118 + .../interfaces/ProvenanceBaseEvent.md | 88 + .../interfaces/ProvenanceRegistry.md | 18 +- docs/api-reference/interfaces/Provider.md | 51 + docs/api-reference/interfaces/PublicKey.md | 94 + docs/api-reference/interfaces/QueryResult.md | 56 + .../interfaces/ResourceAuthentication.md | 63 + .../interfaces/RoyaltyAttributes.md | 43 + docs/api-reference/interfaces/SearchQuery.md | 14 +- docs/api-reference/interfaces/Service.md | 41 - .../interfaces/ServiceAaveCredit.md | 104 + .../api-reference/interfaces/ServiceAccess.md | 106 + .../interfaces/ServiceAgreementTemplate.md | 67 + .../ServiceAgreementTemplateCondition.md | 85 + .../ServiceAgreementTemplateEvent.md | 49 + .../ServiceAgreementTemplateParameter.md | 41 + .../interfaces/ServiceAttributes.md | 52 + .../interfaces/ServiceAuthorization.md | 100 + .../api-reference/interfaces/ServiceCommon.md | 81 + .../interfaces/ServiceCompute.md | 106 + .../interfaces/ServiceDefinition.md | 4 +- .../interfaces/ServiceMetadata.md | 122 + .../interfaces/ServiceNFTAccess.md | 104 + .../interfaces/ServiceNFTSales.md | 108 + .../api-reference/interfaces/ServicePlugin.md | 113 + .../interfaces/ServiceSecondary.md | 111 + docs/api-reference/interfaces/Stage.md | 23 +- docs/api-reference/interfaces/StageInput.md | 4 +- docs/api-reference/interfaces/StageOutput.md | 6 +- .../interfaces/StageRequirements.md | 27 - .../interfaces/StageTransformation.md | 2 +- .../interfaces/SubscriptionToken.md | 30 + .../interfaces/TemplateMetadata.md | 52 + docs/api-reference/interfaces/TxParameters.md | 132 + .../interfaces/TypedDataDomain.md | 41 + .../interfaces/TypedDataTypes.md | 19 + docs/api-reference/interfaces/UsedEvent.md | 126 + .../interfaces/ValidationParams.md | 118 + docs/api-reference/interfaces/ValuePair.md | 30 + .../interfaces/WasAssociatedWithEvent.md | 126 + .../interfaces/WasDerivedFromEvent.md | 137 + .../interfaces/WasGeneratedByEvent.md | 126 + docs/api-reference/interfaces/WebService.md | 65 + .../WebServiceInternalAttributes.md | 30 + docs/api-reference/interfaces/Workflow.md | 13 +- .../interfaces/conditions.ConditionContext.md | 54 - .../conditions.ConditionInstance.md | 123 - .../conditions.ConditionInstanceSmall.md | 71 - .../conditions.ConditionParameters.md | 53 - .../events.ContractEventSubscription.md | 29 - .../interfaces/events.EventOptions.md | 87 - .../api-reference/interfaces/events.Filter.md | 9 - .../interfaces/templates.AgreementInstance.md | 49 - .../interfaces/templates.PaymentData.md | 54 - docs/api-reference/modules/KeyTransfer.md | 14 - docs/api-reference/modules/conditions.md | 80 - docs/api-reference/modules/events.md | 33 - .../modules/subgraphs.AaveBorrowCondition.md | 508 --- ...ubgraphs.AaveCollateralDepositCondition.md | 508 --- ...bgraphs.AaveCollateralWithdrawCondition.md | 508 --- .../modules/subgraphs.AaveCreditTemplate.md | 729 ---- .../modules/subgraphs.AaveRepayCondition.md | 508 --- .../modules/subgraphs.AccessCondition.md | 516 --- .../modules/subgraphs.AccessProofCondition.md | 542 --- .../modules/subgraphs.AccessProofTemplate.md | 564 --- .../modules/subgraphs.AccessTemplate.md | 564 --- .../subgraphs.AgreementStoreManager.md | 822 ----- .../subgraphs.ComputeExecutionCondition.md | 516 --- .../subgraphs.ConditionStoreManager.md | 1130 ------ .../modules/subgraphs.DIDRegistry.md | 3149 ----------------- .../modules/subgraphs.DIDSalesTemplate.md | 564 --- .../modules/subgraphs.Dispenser.md | 663 ---- ...graphs.DistributeNFTCollateralCondition.md | 381 -- ...ubgraphs.EscrowComputeExecutionTemplate.md | 564 --- .../subgraphs.EscrowPaymentCondition.md | 675 ---- .../modules/subgraphs.HashLockCondition.md | 351 -- .../modules/subgraphs.LockPaymentCondition.md | 1011 ------ .../subgraphs.NFT721AccessProofTemplate.md | 564 --- .../subgraphs.NFT721AccessSwapTemplate.md | 564 --- .../modules/subgraphs.NFT721AccessTemplate.md | 564 --- .../subgraphs.NFT721EscrowPaymentCondition.md | 685 ---- .../subgraphs.NFT721HolderCondition.md | 526 --- .../modules/subgraphs.NFT721LockCondition.md | 391 -- .../modules/subgraphs.NFT721SalesTemplate.md | 564 --- ...subgraphs.NFT721SalesWithAccessTemplate.md | 564 --- .../modules/subgraphs.NFT721Upgradeable.md | 1450 -------- .../modules/subgraphs.NFTAccessCondition.md | 516 --- .../subgraphs.NFTAccessProofTemplate.md | 564 --- .../subgraphs.NFTAccessSwapTemplate.md | 564 --- .../modules/subgraphs.NFTAccessTemplate.md | 564 --- .../subgraphs.NFTEscrowPaymentCondition.md | 685 ---- .../modules/subgraphs.NFTHolderCondition.md | 526 --- .../modules/subgraphs.NFTLockCondition.md | 542 --- .../modules/subgraphs.NFTSalesTemplate.md | 564 --- .../subgraphs.NFTSalesWithAccessTemplate.md | 564 --- .../modules/subgraphs.NeverminedConfig.md | 971 ----- .../modules/subgraphs.NeverminedToken.md | 1140 ------ .../modules/subgraphs.RewardsDistributor.md | 202 -- .../modules/subgraphs.SignCondition.md | 351 -- .../modules/subgraphs.StandardRoyalties.md | 202 -- .../modules/subgraphs.TemplateStoreManager.md | 351 -- .../modules/subgraphs.ThresholdCondition.md | 351 -- ...subgraphs.TransferDIDOwnershipCondition.md | 516 --- .../subgraphs.TransferNFT721Condition.md | 1005 ------ .../modules/subgraphs.TransferNFTCondition.md | 1005 ------ .../subgraphs.WhitelistingCondition.md | 351 -- docs/api-reference/modules/subgraphs.md | 57 - docs/api-reference/modules/templates.md | 47 - docs/api-reference/modules/utils.md | 506 --- package.json | 4 +- 340 files changed, 81206 insertions(+), 76771 deletions(-) create mode 100644 docs/api-reference/classes/AaveBorrowCondition.md create mode 100644 docs/api-reference/classes/AaveCollateralDepositCondition.md create mode 100644 docs/api-reference/classes/AaveCollateralWithdrawCondition.md create mode 100644 docs/api-reference/classes/AaveCredit.md create mode 100644 docs/api-reference/classes/AaveCreditTemplate.md create mode 100644 docs/api-reference/classes/AaveRepayCondition.md create mode 100644 docs/api-reference/classes/AccessCondition.md create mode 100644 docs/api-reference/classes/AccessService.md create mode 100644 docs/api-reference/classes/AccessTemplate.md delete mode 100644 docs/api-reference/classes/Accounts.md create mode 100644 docs/api-reference/classes/AccountsApi.md create mode 100644 docs/api-reference/classes/AgreementStoreManager.md create mode 100644 docs/api-reference/classes/AgreementsApi.md create mode 100644 docs/api-reference/classes/ApiError.md create mode 100644 docs/api-reference/classes/AssetAttributes.md create mode 100644 docs/api-reference/classes/AssetError.md create mode 100644 docs/api-reference/classes/AssetPrice.md create mode 100644 docs/api-reference/classes/AssetPublicationOptions.md create mode 100644 docs/api-reference/classes/AssetsApi.md rename docs/api-reference/classes/{KeyTransfer.BabyjubPublicKey.md => BabyjubPublicKey.md} (57%) create mode 100644 docs/api-reference/classes/BaseTemplate.md create mode 100644 docs/api-reference/classes/Bookmarks.md create mode 100644 docs/api-reference/classes/ComputeApi.md create mode 100644 docs/api-reference/classes/ComputeExecutionCondition.md create mode 100644 docs/api-reference/classes/ConditionSmall.md create mode 100644 docs/api-reference/classes/ConditionStoreManager.md delete mode 100644 docs/api-reference/classes/Config.md create mode 100644 docs/api-reference/classes/ConsumerCondition.md create mode 100644 docs/api-reference/classes/ContractBase.md create mode 100644 docs/api-reference/classes/ContractEvent.md create mode 100644 docs/api-reference/classes/ContractHandler.md create mode 100644 docs/api-reference/classes/CurveRoyalties.md create mode 100644 docs/api-reference/classes/CustomToken.md create mode 100644 docs/api-reference/classes/DDOError.md create mode 100644 docs/api-reference/classes/DDOPriceNotFoundError.md create mode 100644 docs/api-reference/classes/DDOServiceNotFoundError.md create mode 100644 docs/api-reference/classes/DIDRegistry.md create mode 100644 docs/api-reference/classes/DIDSalesTemplate.md create mode 100644 docs/api-reference/classes/Dispenser.md create mode 100644 docs/api-reference/classes/DistributeNFTCollateralCondition.md create mode 100644 docs/api-reference/classes/EscrowComputeExecutionTemplate.md create mode 100644 docs/api-reference/classes/EscrowPaymentCondition.md create mode 100644 docs/api-reference/classes/EthSignJWT.md rename docs/api-reference/classes/{events.EventHandler.md => EventHandler.md} (59%) create mode 100644 docs/api-reference/classes/Files.md create mode 100644 docs/api-reference/classes/GenericContract.md create mode 100644 docs/api-reference/classes/GraphError.md create mode 100644 docs/api-reference/classes/HttpError.md create mode 100644 docs/api-reference/classes/Instantiable.md create mode 100644 docs/api-reference/classes/JwtUtils.md create mode 100644 docs/api-reference/classes/KeeperError.md create mode 100644 docs/api-reference/classes/LockPaymentCondition.md create mode 100644 docs/api-reference/classes/MarketplaceApi.md create mode 100644 docs/api-reference/classes/MetadataService.md rename docs/api-reference/classes/{KeyTransfer.MimcCipher.md => MimcCipher.md} (58%) create mode 100644 docs/api-reference/classes/NFT1155Api.md create mode 100644 docs/api-reference/classes/NFT721AccessTemplate.md create mode 100644 docs/api-reference/classes/NFT721Api.md create mode 100644 docs/api-reference/classes/NFT721HolderCondition.md create mode 100644 docs/api-reference/classes/NFT721LockCondition.md create mode 100644 docs/api-reference/classes/NFT721SalesTemplate.md create mode 100644 docs/api-reference/classes/NFTAccessCondition.md create mode 100644 docs/api-reference/classes/NFTAccessService.md create mode 100644 docs/api-reference/classes/NFTAccessTemplate.md create mode 100644 docs/api-reference/classes/NFTAttributes.md create mode 100644 docs/api-reference/classes/NFTContractsBase.md create mode 100644 docs/api-reference/classes/NFTError.md create mode 100644 docs/api-reference/classes/NFTHolderCondition.md create mode 100644 docs/api-reference/classes/NFTLockCondition.md create mode 100644 docs/api-reference/classes/NFTSalesService.md create mode 100644 docs/api-reference/classes/NFTSalesTemplate.md create mode 100644 docs/api-reference/classes/NFTServiceAttributes.md create mode 100644 docs/api-reference/classes/NFTsBaseApi.md create mode 100644 docs/api-reference/classes/NeverminedEvent.md create mode 100644 docs/api-reference/classes/NeverminedNode.md create mode 100644 docs/api-reference/classes/NeverminedNodeError.md create mode 100644 docs/api-reference/classes/NeverminedOptions.md create mode 100644 docs/api-reference/classes/Nft1155Contract.md delete mode 100644 docs/api-reference/classes/Nft721.md create mode 100644 docs/api-reference/classes/Nft721Contract.md delete mode 100644 docs/api-reference/classes/Nfts.md create mode 100644 docs/api-reference/classes/Permissions.md create mode 100644 docs/api-reference/classes/Profiles.md create mode 100644 docs/api-reference/classes/ProvenanceApi.md create mode 100644 docs/api-reference/classes/ProviderCondition.md create mode 100644 docs/api-reference/classes/Providers.md create mode 100644 docs/api-reference/classes/RegistryBaseApi.md create mode 100644 docs/api-reference/classes/RewardsDistributor.md create mode 100644 docs/api-reference/classes/RoyaltyScheme.md create mode 100644 docs/api-reference/classes/SearchApi.md create mode 100644 docs/api-reference/classes/ServiceAgreement.md create mode 100644 docs/api-reference/classes/ServicesApi.md create mode 100644 docs/api-reference/classes/SignatureUtils.md create mode 100644 docs/api-reference/classes/StandardRoyalties.md create mode 100644 docs/api-reference/classes/SubgraphEvent.md rename docs/api-reference/classes/{utils.SubscribableObserver.md => SubscribableObserver.md} (69%) rename docs/api-reference/classes/{utils.SubscribablePromise.md => SubscribablePromise.md} (54%) create mode 100644 docs/api-reference/classes/SubscriptionCreditsNFTApi.md create mode 100644 docs/api-reference/classes/SubscriptionNFTApi.md create mode 100644 docs/api-reference/classes/TemplateStoreManager.md create mode 100644 docs/api-reference/classes/Token.md create mode 100644 docs/api-reference/classes/TokenUtils.md create mode 100644 docs/api-reference/classes/TransferDIDOwnershipCondition.md create mode 100644 docs/api-reference/classes/TransferNFT721Condition.md create mode 100644 docs/api-reference/classes/TransferNFTCondition.md create mode 100644 docs/api-reference/classes/UtilsApi.md create mode 100644 docs/api-reference/classes/Versions.md create mode 100644 docs/api-reference/classes/Web3Error.md create mode 100644 docs/api-reference/classes/Web3Provider.md create mode 100644 docs/api-reference/classes/Web3ProviderWrapper.md create mode 100644 docs/api-reference/classes/WebServiceConnector.md delete mode 100644 docs/api-reference/classes/conditions.AaveBorrowCondition.md delete mode 100644 docs/api-reference/classes/conditions.AaveCollateralDepositCondition.md delete mode 100644 docs/api-reference/classes/conditions.AaveCollateralWithdrawCondition.md delete mode 100644 docs/api-reference/classes/conditions.AaveRepayCondition.md delete mode 100644 docs/api-reference/classes/conditions.AccessCondition.md delete mode 100644 docs/api-reference/classes/conditions.ComputeExecutionCondition.md delete mode 100644 docs/api-reference/classes/conditions.ConditionSmall.md delete mode 100644 docs/api-reference/classes/conditions.ConsumerCondition.md delete mode 100644 docs/api-reference/classes/conditions.DistributeNFTCollateralCondition.md delete mode 100644 docs/api-reference/classes/conditions.EscrowPaymentCondition.md delete mode 100644 docs/api-reference/classes/conditions.LockPaymentCondition.md delete mode 100644 docs/api-reference/classes/conditions.NFT721HolderCondition.md delete mode 100644 docs/api-reference/classes/conditions.NFT721LockCondition.md delete mode 100644 docs/api-reference/classes/conditions.NFTAccessCondition.md delete mode 100644 docs/api-reference/classes/conditions.NFTHolderCondition.md delete mode 100644 docs/api-reference/classes/conditions.NFTLockCondition.md delete mode 100644 docs/api-reference/classes/conditions.ProviderCondition.md delete mode 100644 docs/api-reference/classes/conditions.TransferDIDOwnershipCondition.md delete mode 100644 docs/api-reference/classes/conditions.TransferNFT721Condition.md delete mode 100644 docs/api-reference/classes/conditions.TransferNFTCondition.md delete mode 100644 docs/api-reference/classes/events.ContractEvent.md delete mode 100644 docs/api-reference/classes/events.NeverminedEvent.md delete mode 100644 docs/api-reference/classes/events.SubgraphEvent.md delete mode 100644 docs/api-reference/classes/templates.AaveCreditTemplate.md delete mode 100644 docs/api-reference/classes/templates.AccessTemplate.md delete mode 100644 docs/api-reference/classes/templates.BaseTemplate.md delete mode 100644 docs/api-reference/classes/templates.DIDSalesTemplate.md delete mode 100644 docs/api-reference/classes/templates.EscrowComputeExecutionTemplate.md delete mode 100644 docs/api-reference/classes/templates.NFT721AccessTemplate.md delete mode 100644 docs/api-reference/classes/templates.NFT721SalesTemplate.md delete mode 100644 docs/api-reference/classes/templates.NFTAccessTemplate.md delete mode 100644 docs/api-reference/classes/templates.NFTSalesTemplate.md delete mode 100644 docs/api-reference/classes/utils.Logger.md create mode 100644 docs/api-reference/enums/AccessStatus.md create mode 100644 docs/api-reference/enums/AssetResult.md create mode 100644 docs/api-reference/enums/DIDResolvePolicy.md create mode 100644 docs/api-reference/enums/ERCType.md create mode 100644 docs/api-reference/enums/ExecuteProgressStep.md create mode 100644 docs/api-reference/enums/ExternalResourceFileType.md create mode 100644 docs/api-reference/enums/ImmutableBackends.md rename docs/api-reference/enums/{utils.LogLevel.md => LogLevel.md} (58%) create mode 100644 docs/api-reference/enums/NeverminedNFT1155Type.md create mode 100644 docs/api-reference/enums/NeverminedNFT721Type.md create mode 100644 docs/api-reference/enums/NodeUploadBackends.md create mode 100644 docs/api-reference/enums/PublishMetadataOptions.md create mode 100644 docs/api-reference/enums/PublishOnChainOptions.md create mode 100644 docs/api-reference/enums/RoyaltyKind.md create mode 100644 docs/api-reference/enums/TemplateState.md create mode 100644 docs/api-reference/enums/UpdateProgressStep.md create mode 100644 docs/api-reference/enums/ValueType.md delete mode 100644 docs/api-reference/enums/utils.OrderProgressStep.md create mode 100644 docs/api-reference/interfaces/AaveConfig.md create mode 100644 docs/api-reference/interfaces/AaveCreditTemplateParams.md create mode 100644 docs/api-reference/interfaces/AccessProofTemplateParams.md create mode 100644 docs/api-reference/interfaces/ActedOnBehalfEvent.md rename docs/api-reference/interfaces/{templates.AgreementConditionsStatus.md => AgreementConditionsStatus.md} (58%) create mode 100644 docs/api-reference/interfaces/AgreementData.md create mode 100644 docs/api-reference/interfaces/AgreementInstance.md create mode 100644 docs/api-reference/interfaces/AgreementPrepareResult.md create mode 100644 docs/api-reference/interfaces/AuthToken.md create mode 100644 docs/api-reference/interfaces/Authentication.md create mode 100644 docs/api-reference/interfaces/Babysig.md create mode 100644 docs/api-reference/interfaces/Balance.md create mode 100644 docs/api-reference/interfaces/ConditionContext.md create mode 100644 docs/api-reference/interfaces/ConditionData.md create mode 100644 docs/api-reference/interfaces/ConditionInstance.md create mode 100644 docs/api-reference/interfaces/ConditionInstanceSmall.md create mode 100644 docs/api-reference/interfaces/ConditionParameters.md create mode 100644 docs/api-reference/interfaces/ContractEventSubscription.md create mode 100644 docs/api-reference/interfaces/DDOStatus.md create mode 100644 docs/api-reference/interfaces/Eip712Data.md rename docs/api-reference/interfaces/{events.EventEmitter.md => EventEmitter.md} (67%) create mode 100644 docs/api-reference/interfaces/EventOptions.md delete mode 100644 docs/api-reference/interfaces/File.md create mode 100644 docs/api-reference/interfaces/Filter.md create mode 100644 docs/api-reference/interfaces/GenericAccess.md create mode 100644 docs/api-reference/interfaces/InputType.md create mode 100644 docs/api-reference/interfaces/InstantiableConfig.md create mode 100644 docs/api-reference/interfaces/JsonRpcPayload.md create mode 100644 docs/api-reference/interfaces/JsonRpcResponse.md delete mode 100644 docs/api-reference/interfaces/KeyTransfer.Babysig.md create mode 100644 docs/api-reference/interfaces/MarketplaceResults.md create mode 100644 docs/api-reference/interfaces/MetaDataExternalResource.md create mode 100644 docs/api-reference/interfaces/MethodReflection.md create mode 100644 docs/api-reference/interfaces/MintedEntry.md create mode 100644 docs/api-reference/interfaces/NvmConfig.md create mode 100644 docs/api-reference/interfaces/NvmConfigVersions.md create mode 100644 docs/api-reference/interfaces/PaymentData.md create mode 100644 docs/api-reference/interfaces/Proof.md create mode 100644 docs/api-reference/interfaces/ProvenanceAttributeRegisteredEvent.md create mode 100644 docs/api-reference/interfaces/ProvenanceBaseEvent.md create mode 100644 docs/api-reference/interfaces/Provider.md create mode 100644 docs/api-reference/interfaces/PublicKey.md create mode 100644 docs/api-reference/interfaces/QueryResult.md create mode 100644 docs/api-reference/interfaces/ResourceAuthentication.md create mode 100644 docs/api-reference/interfaces/RoyaltyAttributes.md delete mode 100644 docs/api-reference/interfaces/Service.md create mode 100644 docs/api-reference/interfaces/ServiceAaveCredit.md create mode 100644 docs/api-reference/interfaces/ServiceAccess.md create mode 100644 docs/api-reference/interfaces/ServiceAgreementTemplate.md create mode 100644 docs/api-reference/interfaces/ServiceAgreementTemplateCondition.md create mode 100644 docs/api-reference/interfaces/ServiceAgreementTemplateEvent.md create mode 100644 docs/api-reference/interfaces/ServiceAgreementTemplateParameter.md create mode 100644 docs/api-reference/interfaces/ServiceAttributes.md create mode 100644 docs/api-reference/interfaces/ServiceAuthorization.md create mode 100644 docs/api-reference/interfaces/ServiceCommon.md create mode 100644 docs/api-reference/interfaces/ServiceCompute.md create mode 100644 docs/api-reference/interfaces/ServiceMetadata.md create mode 100644 docs/api-reference/interfaces/ServiceNFTAccess.md create mode 100644 docs/api-reference/interfaces/ServiceNFTSales.md create mode 100644 docs/api-reference/interfaces/ServicePlugin.md create mode 100644 docs/api-reference/interfaces/ServiceSecondary.md delete mode 100644 docs/api-reference/interfaces/StageRequirements.md create mode 100644 docs/api-reference/interfaces/SubscriptionToken.md create mode 100644 docs/api-reference/interfaces/TemplateMetadata.md create mode 100644 docs/api-reference/interfaces/TxParameters.md create mode 100644 docs/api-reference/interfaces/TypedDataDomain.md create mode 100644 docs/api-reference/interfaces/TypedDataTypes.md create mode 100644 docs/api-reference/interfaces/UsedEvent.md create mode 100644 docs/api-reference/interfaces/ValidationParams.md create mode 100644 docs/api-reference/interfaces/ValuePair.md create mode 100644 docs/api-reference/interfaces/WasAssociatedWithEvent.md create mode 100644 docs/api-reference/interfaces/WasDerivedFromEvent.md create mode 100644 docs/api-reference/interfaces/WasGeneratedByEvent.md create mode 100644 docs/api-reference/interfaces/WebService.md create mode 100644 docs/api-reference/interfaces/WebServiceInternalAttributes.md delete mode 100644 docs/api-reference/interfaces/conditions.ConditionContext.md delete mode 100644 docs/api-reference/interfaces/conditions.ConditionInstance.md delete mode 100644 docs/api-reference/interfaces/conditions.ConditionInstanceSmall.md delete mode 100644 docs/api-reference/interfaces/conditions.ConditionParameters.md delete mode 100644 docs/api-reference/interfaces/events.ContractEventSubscription.md delete mode 100644 docs/api-reference/interfaces/events.EventOptions.md delete mode 100644 docs/api-reference/interfaces/events.Filter.md delete mode 100644 docs/api-reference/interfaces/templates.AgreementInstance.md delete mode 100644 docs/api-reference/interfaces/templates.PaymentData.md delete mode 100644 docs/api-reference/modules/KeyTransfer.md delete mode 100644 docs/api-reference/modules/conditions.md delete mode 100644 docs/api-reference/modules/events.md delete mode 100644 docs/api-reference/modules/subgraphs.AaveBorrowCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.AaveCollateralDepositCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.AaveCollateralWithdrawCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.AaveCreditTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.AaveRepayCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.AccessCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.AccessProofCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.AccessProofTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.AccessTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.AgreementStoreManager.md delete mode 100644 docs/api-reference/modules/subgraphs.ComputeExecutionCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.ConditionStoreManager.md delete mode 100644 docs/api-reference/modules/subgraphs.DIDRegistry.md delete mode 100644 docs/api-reference/modules/subgraphs.DIDSalesTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.Dispenser.md delete mode 100644 docs/api-reference/modules/subgraphs.DistributeNFTCollateralCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.EscrowComputeExecutionTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.EscrowPaymentCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.HashLockCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.LockPaymentCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721AccessProofTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721AccessSwapTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721AccessTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721EscrowPaymentCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721HolderCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721LockCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721SalesTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721SalesWithAccessTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFT721Upgradeable.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTAccessCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTAccessProofTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTAccessSwapTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTAccessTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTEscrowPaymentCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTHolderCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTLockCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTSalesTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NFTSalesWithAccessTemplate.md delete mode 100644 docs/api-reference/modules/subgraphs.NeverminedConfig.md delete mode 100644 docs/api-reference/modules/subgraphs.NeverminedToken.md delete mode 100644 docs/api-reference/modules/subgraphs.RewardsDistributor.md delete mode 100644 docs/api-reference/modules/subgraphs.SignCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.StandardRoyalties.md delete mode 100644 docs/api-reference/modules/subgraphs.TemplateStoreManager.md delete mode 100644 docs/api-reference/modules/subgraphs.ThresholdCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.TransferDIDOwnershipCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.TransferNFT721Condition.md delete mode 100644 docs/api-reference/modules/subgraphs.TransferNFTCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.WhitelistingCondition.md delete mode 100644 docs/api-reference/modules/subgraphs.md delete mode 100644 docs/api-reference/modules/templates.md delete mode 100644 docs/api-reference/modules/utils.md diff --git a/docs/api-reference/classes/AaveBorrowCondition.md b/docs/api-reference/classes/AaveBorrowCondition.md new file mode 100644 index 000000000..82bedc5ee --- /dev/null +++ b/docs/api-reference/classes/AaveBorrowCondition.md @@ -0,0 +1,968 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveBorrowCondition + +# Class: AaveBorrowCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`AaveBorrowConditionContext`\> + + ↳ **`AaveBorrowCondition`** + +## Table of contents + +### Constructors + +- [constructor](AaveBorrowCondition.md#constructor) + +### Properties + +- [address](AaveBorrowCondition.md#address) +- [contract](AaveBorrowCondition.md#contract) +- [contractName](AaveBorrowCondition.md#contractname) +- [events](AaveBorrowCondition.md#events) +- [version](AaveBorrowCondition.md#version) + +### Accessors + +- [artifactsFolder](AaveBorrowCondition.md#artifactsfolder) +- [circuitsFolder](AaveBorrowCondition.md#circuitsfolder) +- [config](AaveBorrowCondition.md#config) +- [instanceConfig](AaveBorrowCondition.md#instanceconfig) +- [instantiableConfig](AaveBorrowCondition.md#instantiableconfig) +- [logger](AaveBorrowCondition.md#logger) +- [nevermined](AaveBorrowCondition.md#nevermined) +- [web3](AaveBorrowCondition.md#web3) + +### Methods + +- [abortByTimeOut](AaveBorrowCondition.md#abortbytimeout) +- [call](AaveBorrowCondition.md#call) +- [fulfill](AaveBorrowCondition.md#fulfill) +- [fulfillInstance](AaveBorrowCondition.md#fulfillinstance) +- [fulfillPlain](AaveBorrowCondition.md#fulfillplain) +- [fulfillWithNode](AaveBorrowCondition.md#fulfillwithnode) +- [generateId](AaveBorrowCondition.md#generateid) +- [generateIdHash](AaveBorrowCondition.md#generateidhash) +- [generateIdWithSeed](AaveBorrowCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](AaveBorrowCondition.md#getconditionfulfilledevent) +- [getFromAddress](AaveBorrowCondition.md#getfromaddress) +- [getInputsOfMethod](AaveBorrowCondition.md#getinputsofmethod) +- [getSignatureOfMethod](AaveBorrowCondition.md#getsignatureofmethod) +- [hashValues](AaveBorrowCondition.md#hashvalues) +- [hashValuesPlain](AaveBorrowCondition.md#hashvaluesplain) +- [init](AaveBorrowCondition.md#init) +- [instance](AaveBorrowCondition.md#instance) +- [instanceFromDDO](AaveBorrowCondition.md#instancefromddo) +- [nodeMethod](AaveBorrowCondition.md#nodemethod) +- [params](AaveBorrowCondition.md#params) +- [paramsFromDDO](AaveBorrowCondition.md#paramsfromddo) +- [send](AaveBorrowCondition.md#send) +- [sendFrom](AaveBorrowCondition.md#sendfrom) +- [setInstanceConfig](AaveBorrowCondition.md#setinstanceconfig) +- [getInstance](AaveBorrowCondition.md#getinstance) +- [setInstanceConfig](AaveBorrowCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AaveBorrowCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `assetToBorrow`, `amount`, `interestRateMode`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `vaultAddress` | `string` | +| `assetToBorrow` | `string` | +| `amount` | `string` | +| `interestRateMode` | `number` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/defi/AaveBorrowCondition.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveBorrowCondition.ts#L45) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `AaveBorrowConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `vaultAddress`, `assetToBorrow`, `amount`, `interestRateMode`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :----------------- | :------- | +| `did` | `string` | +| `vaultAddress` | `string` | +| `assetToBorrow` | `string` | +| `amount` | `string` | +| `interestRateMode` | `number` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/defi/AaveBorrowCondition.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveBorrowCondition.ts#L19) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :--------------------------- | +| `«destructured»` | `AaveBorrowConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/defi/AaveBorrowCondition.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveBorrowCondition.ts#L35) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AaveBorrowCondition`](AaveBorrowCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AaveBorrowCondition`](AaveBorrowCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/defi/AaveBorrowCondition.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveBorrowCondition.ts#L15) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AaveCollateralDepositCondition.md b/docs/api-reference/classes/AaveCollateralDepositCondition.md new file mode 100644 index 000000000..63f380c9a --- /dev/null +++ b/docs/api-reference/classes/AaveCollateralDepositCondition.md @@ -0,0 +1,972 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveCollateralDepositCondition + +# Class: AaveCollateralDepositCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`AaveCollateralDepositConditionContext`\> + + ↳ **`AaveCollateralDepositCondition`** + +## Table of contents + +### Constructors + +- [constructor](AaveCollateralDepositCondition.md#constructor) + +### Properties + +- [address](AaveCollateralDepositCondition.md#address) +- [contract](AaveCollateralDepositCondition.md#contract) +- [contractName](AaveCollateralDepositCondition.md#contractname) +- [events](AaveCollateralDepositCondition.md#events) +- [version](AaveCollateralDepositCondition.md#version) + +### Accessors + +- [artifactsFolder](AaveCollateralDepositCondition.md#artifactsfolder) +- [circuitsFolder](AaveCollateralDepositCondition.md#circuitsfolder) +- [config](AaveCollateralDepositCondition.md#config) +- [instanceConfig](AaveCollateralDepositCondition.md#instanceconfig) +- [instantiableConfig](AaveCollateralDepositCondition.md#instantiableconfig) +- [logger](AaveCollateralDepositCondition.md#logger) +- [nevermined](AaveCollateralDepositCondition.md#nevermined) +- [web3](AaveCollateralDepositCondition.md#web3) + +### Methods + +- [abortByTimeOut](AaveCollateralDepositCondition.md#abortbytimeout) +- [call](AaveCollateralDepositCondition.md#call) +- [fulfill](AaveCollateralDepositCondition.md#fulfill) +- [fulfillInstance](AaveCollateralDepositCondition.md#fulfillinstance) +- [fulfillPlain](AaveCollateralDepositCondition.md#fulfillplain) +- [fulfillWithNode](AaveCollateralDepositCondition.md#fulfillwithnode) +- [generateId](AaveCollateralDepositCondition.md#generateid) +- [generateIdHash](AaveCollateralDepositCondition.md#generateidhash) +- [generateIdWithSeed](AaveCollateralDepositCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](AaveCollateralDepositCondition.md#getconditionfulfilledevent) +- [getFromAddress](AaveCollateralDepositCondition.md#getfromaddress) +- [getInputsOfMethod](AaveCollateralDepositCondition.md#getinputsofmethod) +- [getSignatureOfMethod](AaveCollateralDepositCondition.md#getsignatureofmethod) +- [hashValues](AaveCollateralDepositCondition.md#hashvalues) +- [hashValuesPlain](AaveCollateralDepositCondition.md#hashvaluesplain) +- [init](AaveCollateralDepositCondition.md#init) +- [instance](AaveCollateralDepositCondition.md#instance) +- [instanceFromDDO](AaveCollateralDepositCondition.md#instancefromddo) +- [nodeMethod](AaveCollateralDepositCondition.md#nodemethod) +- [params](AaveCollateralDepositCondition.md#params) +- [paramsFromDDO](AaveCollateralDepositCondition.md#paramsfromddo) +- [send](AaveCollateralDepositCondition.md#send) +- [sendFrom](AaveCollateralDepositCondition.md#sendfrom) +- [setInstanceConfig](AaveCollateralDepositCondition.md#setinstanceconfig) +- [getInstance](AaveCollateralDepositCondition.md#getinstance) +- [setInstanceConfig](AaveCollateralDepositCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AaveCollateralDepositCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `vaultAddress` | `string` | +| `collateralAsset` | `string` | +| `collateralAmount` | `string` | +| `delegatedAsset` | `string` | +| `delegatedAmount` | `string` | +| `interestRateMode` | `number` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L67) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `AaveCollateralDepositConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `vaultAddress`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :----------------- | :------- | +| `did` | `string` | +| `vaultAddress` | `string` | +| `collateralAsset` | `string` | +| `collateralAmount` | `string` | +| `delegatedAsset` | `string` | +| `delegatedAmount` | `string` | +| `interestRateMode` | `number` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L28) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :-------------------------------------- | +| `«destructured»` | `AaveCollateralDepositConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L47) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AaveCollateralDepositCondition`](AaveCollateralDepositCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AaveCollateralDepositCondition`](AaveCollateralDepositCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L17) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AaveCollateralWithdrawCondition.md b/docs/api-reference/classes/AaveCollateralWithdrawCondition.md new file mode 100644 index 000000000..a63bb373e --- /dev/null +++ b/docs/api-reference/classes/AaveCollateralWithdrawCondition.md @@ -0,0 +1,964 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveCollateralWithdrawCondition + +# Class: AaveCollateralWithdrawCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`AaveCollateralWithdrawConditionContext`\> + + ↳ **`AaveCollateralWithdrawCondition`** + +## Table of contents + +### Constructors + +- [constructor](AaveCollateralWithdrawCondition.md#constructor) + +### Properties + +- [address](AaveCollateralWithdrawCondition.md#address) +- [contract](AaveCollateralWithdrawCondition.md#contract) +- [contractName](AaveCollateralWithdrawCondition.md#contractname) +- [events](AaveCollateralWithdrawCondition.md#events) +- [version](AaveCollateralWithdrawCondition.md#version) + +### Accessors + +- [artifactsFolder](AaveCollateralWithdrawCondition.md#artifactsfolder) +- [circuitsFolder](AaveCollateralWithdrawCondition.md#circuitsfolder) +- [config](AaveCollateralWithdrawCondition.md#config) +- [instanceConfig](AaveCollateralWithdrawCondition.md#instanceconfig) +- [instantiableConfig](AaveCollateralWithdrawCondition.md#instantiableconfig) +- [logger](AaveCollateralWithdrawCondition.md#logger) +- [nevermined](AaveCollateralWithdrawCondition.md#nevermined) +- [web3](AaveCollateralWithdrawCondition.md#web3) + +### Methods + +- [abortByTimeOut](AaveCollateralWithdrawCondition.md#abortbytimeout) +- [call](AaveCollateralWithdrawCondition.md#call) +- [fulfill](AaveCollateralWithdrawCondition.md#fulfill) +- [fulfillInstance](AaveCollateralWithdrawCondition.md#fulfillinstance) +- [fulfillPlain](AaveCollateralWithdrawCondition.md#fulfillplain) +- [fulfillWithNode](AaveCollateralWithdrawCondition.md#fulfillwithnode) +- [generateId](AaveCollateralWithdrawCondition.md#generateid) +- [generateIdHash](AaveCollateralWithdrawCondition.md#generateidhash) +- [generateIdWithSeed](AaveCollateralWithdrawCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](AaveCollateralWithdrawCondition.md#getconditionfulfilledevent) +- [getFromAddress](AaveCollateralWithdrawCondition.md#getfromaddress) +- [getInputsOfMethod](AaveCollateralWithdrawCondition.md#getinputsofmethod) +- [getSignatureOfMethod](AaveCollateralWithdrawCondition.md#getsignatureofmethod) +- [hashValues](AaveCollateralWithdrawCondition.md#hashvalues) +- [hashValuesPlain](AaveCollateralWithdrawCondition.md#hashvaluesplain) +- [init](AaveCollateralWithdrawCondition.md#init) +- [instance](AaveCollateralWithdrawCondition.md#instance) +- [instanceFromDDO](AaveCollateralWithdrawCondition.md#instancefromddo) +- [nodeMethod](AaveCollateralWithdrawCondition.md#nodemethod) +- [params](AaveCollateralWithdrawCondition.md#params) +- [paramsFromDDO](AaveCollateralWithdrawCondition.md#paramsfromddo) +- [send](AaveCollateralWithdrawCondition.md#send) +- [sendFrom](AaveCollateralWithdrawCondition.md#sendfrom) +- [setInstanceConfig](AaveCollateralWithdrawCondition.md#setinstanceconfig) +- [getInstance](AaveCollateralWithdrawCondition.md#getinstance) +- [setInstanceConfig](AaveCollateralWithdrawCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AaveCollateralWithdrawCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `collateralAsset`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `vaultAddress` | `string` | +| `collateralAsset` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L36) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `AaveCollateralWithdrawConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `vaultAddress`, `collateralAsset`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `did` | `string` | +| `vaultAddress` | `string` | +| `collateralAsset` | `string` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L24) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :--------------------------------------- | +| `«destructured»` | `AaveCollateralWithdrawConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L28) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AaveCollateralWithdrawCondition`](AaveCollateralWithdrawCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AaveCollateralWithdrawCondition`](AaveCollateralWithdrawCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L13) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AaveCredit.md b/docs/api-reference/classes/AaveCredit.md new file mode 100644 index 000000000..4c1865de9 --- /dev/null +++ b/docs/api-reference/classes/AaveCredit.md @@ -0,0 +1,682 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveCredit + +# Class: AaveCredit + +AaveCredit allows taking loans from Aave protocol using NFT tokens as collateral + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`AaveCredit`** + +## Table of contents + +### Constructors + +- [constructor](AaveCredit.md#constructor) + +### Properties + +- [aaveConfig](AaveCredit.md#aaveconfig) +- [serviceType](AaveCredit.md#servicetype) +- [template](AaveCredit.md#template) + +### Accessors + +- [artifactsFolder](AaveCredit.md#artifactsfolder) +- [circuitsFolder](AaveCredit.md#circuitsfolder) +- [config](AaveCredit.md#config) +- [instanceConfig](AaveCredit.md#instanceconfig) +- [instantiableConfig](AaveCredit.md#instantiableconfig) +- [logger](AaveCredit.md#logger) +- [nevermined](AaveCredit.md#nevermined) +- [web3](AaveCredit.md#web3) + +### Methods + +- [borrow](AaveCredit.md#borrow) +- [create](AaveCredit.md#create) +- [delegatedAmount](AaveCredit.md#delegatedamount) +- [depositCollateral](AaveCredit.md#depositcollateral) +- [getActualCreditDebt](AaveCredit.md#getactualcreditdebt) +- [getAssetPrice](AaveCredit.md#getassetprice) +- [getBorrowedAmount](AaveCredit.md#getborrowedamount) +- [getCreditAssetDebt](AaveCredit.md#getcreditassetdebt) +- [getTotalActualDebt](AaveCredit.md#gettotalactualdebt) +- [getVaultContract](AaveCredit.md#getvaultcontract) +- [lockNft](AaveCredit.md#locknft) +- [repayDebt](AaveCredit.md#repaydebt) +- [setInstanceConfig](AaveCredit.md#setinstanceconfig) +- [unlockNft](AaveCredit.md#unlocknft) +- [withdrawCollateral](AaveCredit.md#withdrawcollateral) +- [getInstance](AaveCredit.md#getinstance) +- [setInstanceConfig](AaveCredit.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AaveCredit**() + +#### Inherited from + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +## Properties + +### aaveConfig + +• **aaveConfig**: [`AaveConfig`](../interfaces/AaveConfig.md) + +#### Defined in + +[src/services/aave/AaveCredit.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L22) + +--- + +### serviceType + +• **serviceType**: `"aave-credit"` + +#### Defined in + +[src/services/aave/AaveCredit.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L23) + +--- + +### template + +• **template**: [`AaveCreditTemplate`](AaveCreditTemplate.md) + +#### Defined in + +[src/services/aave/AaveCredit.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L21) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### borrow + +▸ **borrow**(`agreementId`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`, `from`, `did?`, `vaultAddress?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------- | +| `agreementId` | `string` | +| `delegatedAsset` | `string` | +| `delegatedAmount` | `number` | +| `interestRateMode` | `number` | +| `from` | [`Account`](Account.md) | +| `did?` | `string` | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:219](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L219) + +--- + +### create + +▸ **create**(`did`, `nftTokenContract`, `nftAmount`, `collateralToken`, `collateralAmount`, `delegatedToken`, `delegatedAmount`, `interestRateMode`, `borrower`, `lender`, `from`, `timeLocks?`, `timeOuts?`, `txParams?`): `Promise`<{ `agreementId`: `string` ; `data`: [`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\> }\> + +Create new Aave agreement where a borrower puts an NFT asset as collateral +and the lender uses their own Token as collateral to allow the borrower to +use Aave protocol to borrow some other token (the `delegatedToken`). All of +this is facilitated via the credit vault contract and the agreement conditions. +All interactions with the Aave protocol have to go through the credit vault. + +#### Parameters + +| Name | Type | Description | +| :----------------- | :---------------------------------------------- | :---------------------------------------------------------------------------------------------- | +| `did` | `string` | id of DDO/asset that represent the `nftToken`. This is the NFT token id | +| `nftTokenContract` | `string` | nft (ERC721) contract address of token to use as collateral by the borrower | +| `nftAmount` | `number` | the number of nft tokens | +| `collateralToken` | `string` | erc20 token address to use as loan-collateral by the lender to enable the borrower to take loan | +| `collateralAmount` | `number` | amount of `collateralToken` to lock in the vault | +| `delegatedToken` | `string` | address of erc20 token to be borrowed under this agreement | +| `delegatedAmount` | `number` | amount of `delegatedToken` that well be borrowed | +| `interestRateMode` | `number` | the type of interest rate to use when borrowing from Aave | +| `borrower` | `string` | wallet address of borrower | +| `lender` | `string` | wallet address of lender | +| `from` | [`Account`](Account.md) | account/wallet of borrower or lender creating this agreement | +| `timeLocks?` | `number`[] | list of time lock values for each agreement condition | +| `timeOuts?` | `number`[] | list of time out values for each agreement condition | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | extra transaction parameters can be included here | + +#### Returns + +`Promise`<{ `agreementId`: `string` ; `data`: [`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\> }\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:59](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L59) + +--- + +### delegatedAmount + +▸ **delegatedAmount**(`agreementId`, `borrower`, `delegatedToken`, `interestRateMode`, `from`, `vaultAddress?`): `Promise`<`number`\> + +Returned value is already converted from Wei + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------- | +| `agreementId` | `string` | +| `borrower` | `string` | +| `delegatedToken` | `string` | +| `interestRateMode` | `number` | +| `from` | [`Account`](Account.md) | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:498](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L498) + +--- + +### depositCollateral + +▸ **depositCollateral**(`agreementId`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`, `from`, `useWethGateway?`, `did?`, `vaultAddress?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :---------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `collateralAsset` | `string` | `undefined` | +| `collateralAmount` | `number` | `undefined` | +| `delegatedAsset` | `string` | `undefined` | +| `delegatedAmount` | `number` | `undefined` | +| `interestRateMode` | `number` | `undefined` | +| `from` | [`Account`](Account.md) | `undefined` | +| `useWethGateway` | `boolean` | `false` | +| `did?` | `string` | `undefined` | +| `vaultAddress?` | `string` | `undefined` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:157](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L157) + +--- + +### getActualCreditDebt + +▸ **getActualCreditDebt**(`agreementId`, `from`, `vaultAddress?`): `Promise`<`number`\> + +Returned value is already converted from Wei + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------- | +| `agreementId` | `string` | +| `from` | [`Account`](Account.md) | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:427](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L427) + +--- + +### getAssetPrice + +▸ **getAssetPrice**(`agreementId`, `tokenAddress`, `from`, `vaultAddress?`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------- | +| `agreementId` | `string` | +| `tokenAddress` | `string` | +| `from` | [`Account`](Account.md) | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L459) + +--- + +### getBorrowedAmount + +▸ **getBorrowedAmount**(`agreementId`, `from`, `vaultAddress?`): `Promise`<`number`\> + +Returned value is already converted from Wei + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------- | +| `agreementId` | `string` | +| `from` | [`Account`](Account.md) | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:479](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L479) + +--- + +### getCreditAssetDebt + +▸ **getCreditAssetDebt**(`agreementId`, `from`, `vaultAddress?`): `Promise`<`number`\> + +Returned value is already converted from Wei + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------- | +| `agreementId` | `string` | +| `from` | [`Account`](Account.md) | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:446](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L446) + +--- + +### getTotalActualDebt + +▸ **getTotalActualDebt**(`agreementId`, `from`, `vaultAddress?`): `Promise`<`number`\> + +Returned value is already converted from Wei + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------- | +| `agreementId` | `string` | +| `from` | [`Account`](Account.md) | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:407](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L407) + +--- + +### getVaultContract + +▸ **getVaultContract**(`agreementId`, `from`, `vaultAddress?`): `Promise`<[`GenericContract`](GenericContract.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :------- | +| `agreementId` | `string` | +| `from` | `string` | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<[`GenericContract`](GenericContract.md)\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:390](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L390) + +--- + +### lockNft + +▸ **lockNft**(`agreementId`, `nftContractAddress`, `nftAmount`, `from?`, `did?`, `vaultAddress?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------- | +| `agreementId` | `string` | +| `nftContractAddress` | `string` | +| `nftAmount` | `number` | +| `from?` | [`Account`](Account.md) | +| `did?` | `string` | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L115) + +--- + +### repayDebt + +▸ **repayDebt**(`agreementId`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`, `from?`, `did?`, `vaultAddress?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------- | +| `agreementId` | `string` | +| `delegatedAsset` | `string` | +| `delegatedAmount` | `number` | +| `interestRateMode` | `number` | +| `from?` | [`Account`](Account.md) | +| `did?` | `string` | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:257](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L257) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### unlockNft + +▸ **unlockNft**(`agreementId`, `nftContractAddress`, `from?`, `did?`, `vaultAddress?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------- | +| `agreementId` | `string` | +| `nftContractAddress` | `string` | +| `from?` | [`Account`](Account.md) | +| `did?` | `string` | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:354](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L354) + +--- + +### withdrawCollateral + +▸ **withdrawCollateral**(`agreementId`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`, `from?`, `did?`, `vaultAddress?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------- | +| `agreementId` | `string` | +| `collateralAsset` | `string` | +| `collateralAmount` | `number` | +| `delegatedAsset` | `string` | +| `delegatedAmount` | `number` | +| `interestRateMode` | `number` | +| `from?` | [`Account`](Account.md) | +| `did?` | `string` | +| `vaultAddress?` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/services/aave/AaveCredit.ts:319](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L319) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AaveCredit`](AaveCredit.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AaveCredit`](AaveCredit.md)\> + +#### Overrides + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/services/aave/AaveCredit.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/aave/AaveCredit.ts#L25) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AaveCreditTemplate.md b/docs/api-reference/classes/AaveCreditTemplate.md new file mode 100644 index 000000000..ba8a3e0fe --- /dev/null +++ b/docs/api-reference/classes/AaveCreditTemplate.md @@ -0,0 +1,1600 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveCreditTemplate + +# Class: AaveCreditTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md), [`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> + + ↳ **`AaveCreditTemplate`** + +## Table of contents + +### Constructors + +- [constructor](AaveCreditTemplate.md#constructor) + +### Properties + +- [aaveConfig](AaveCreditTemplate.md#aaveconfig) +- [address](AaveCreditTemplate.md#address) +- [contract](AaveCreditTemplate.md#contract) +- [contractName](AaveCreditTemplate.md#contractname) +- [events](AaveCreditTemplate.md#events) +- [version](AaveCreditTemplate.md#version) + +### Accessors + +- [artifactsFolder](AaveCreditTemplate.md#artifactsfolder) +- [circuitsFolder](AaveCreditTemplate.md#circuitsfolder) +- [config](AaveCreditTemplate.md#config) +- [instanceConfig](AaveCreditTemplate.md#instanceconfig) +- [instantiableConfig](AaveCreditTemplate.md#instantiableconfig) +- [logger](AaveCreditTemplate.md#logger) +- [nevermined](AaveCreditTemplate.md#nevermined) +- [web3](AaveCreditTemplate.md#web3) + +### Methods + +- [\_createAgreement](AaveCreditTemplate.md#_createagreement) +- [accept](AaveCreditTemplate.md#accept) +- [agreementId](AaveCreditTemplate.md#agreementid) +- [call](AaveCreditTemplate.md#call) +- [conditions](AaveCreditTemplate.md#conditions) +- [createAgreement](AaveCreditTemplate.md#createagreement) +- [createAgreementAndDeployVault](AaveCreditTemplate.md#createagreementanddeployvault) +- [createAgreementAndPay](AaveCreditTemplate.md#createagreementandpay) +- [createAgreementFromDDO](AaveCreditTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](AaveCreditTemplate.md#createagreementwithpaymentfromddo) +- [createService](AaveCreditTemplate.md#createservice) +- [deployVault](AaveCreditTemplate.md#deployvault) +- [description](AaveCreditTemplate.md#description) +- [extraGen](AaveCreditTemplate.md#extragen) +- [getAgreementCreatedEvent](AaveCreditTemplate.md#getagreementcreatedevent) +- [getAgreementData](AaveCreditTemplate.md#getagreementdata) +- [getAgreementDid](AaveCreditTemplate.md#getagreementdid) +- [getAgreementIdsFromDDO](AaveCreditTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](AaveCreditTemplate.md#getagreementstatus) +- [getAgreementVaultAddress](AaveCreditTemplate.md#getagreementvaultaddress) +- [getAgreementsForDID](AaveCreditTemplate.md#getagreementsfordid) +- [getConditionTypes](AaveCreditTemplate.md#getconditiontypes) +- [getConditions](AaveCreditTemplate.md#getconditions) +- [getFromAddress](AaveCreditTemplate.md#getfromaddress) +- [getInputsOfMethod](AaveCreditTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](AaveCreditTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](AaveCreditTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](AaveCreditTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](AaveCreditTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](AaveCreditTemplate.md#getsignatureofmethod) +- [init](AaveCreditTemplate.md#init) +- [instanceFromDDO](AaveCreditTemplate.md#instancefromddo) +- [lockConditionIndex](AaveCreditTemplate.md#lockconditionindex) +- [lockTokens](AaveCreditTemplate.md#locktokens) +- [name](AaveCreditTemplate.md#name) +- [params](AaveCreditTemplate.md#params) +- [paramsGen](AaveCreditTemplate.md#paramsgen) +- [paymentData](AaveCreditTemplate.md#paymentdata) +- [printAgreementStatus](AaveCreditTemplate.md#printagreementstatus) +- [process](AaveCreditTemplate.md#process) +- [send](AaveCreditTemplate.md#send) +- [sendFrom](AaveCreditTemplate.md#sendfrom) +- [service](AaveCreditTemplate.md#service) +- [serviceEndpoint](AaveCreditTemplate.md#serviceendpoint) +- [setInstanceConfig](AaveCreditTemplate.md#setinstanceconfig) +- [standardContext](AaveCreditTemplate.md#standardcontext) +- [track](AaveCreditTemplate.md#track) +- [validateAgreement](AaveCreditTemplate.md#validateagreement) +- [getInstance](AaveCreditTemplate.md#getinstance) +- [setInstanceConfig](AaveCreditTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new AaveCreditTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### aaveConfig + +• **aaveConfig**: [`AaveConfig`](../interfaces/AaveConfig.md) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:48](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L48) + +--- + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_createAgreement + +▸ `Private` **\_createAgreement**(`agreementIdSeed`, `ddo`, `vaultAddress`, `nftTokenContract`, `nftAmount`, `collateralToken`, `collateralAmount`, `delegatedToken`, `delegatedAmount`, `interestRateMode`, `timeLocks`, `timeOuts`, `txParams?`, `from?`): `Promise`<[`ContractTransactionReceipt`, [`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\>]\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------------------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `vaultAddress` | `string` | +| `nftTokenContract` | `string` | +| `nftAmount` | `number` | +| `collateralToken` | `string` | +| `collateralAmount` | `number` | +| `delegatedToken` | `string` | +| `delegatedAmount` | `number` | +| `interestRateMode` | `number` | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `from?` | [`Account`](Account.md) | + +#### Returns + +`Promise`<[`ContractTransactionReceipt`, [`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\>]\> + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:96](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L96) + +--- + +### accept + +▸ **accept**(`_params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L98) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`NFT721LockCondition`](NFT721LockCondition.md), [`AaveCollateralDepositCondition`](AaveCollateralDepositCondition.md), [`AaveBorrowCondition`](AaveBorrowCondition.md), [`AaveRepayCondition`](AaveRepayCondition.md), [`AaveCollateralWithdrawCondition`](AaveCollateralWithdrawCondition.md), [`DistributeNFTCollateralCondition`](DistributeNFTCollateralCondition.md)] + +#### Returns + +[[`NFT721LockCondition`](NFT721LockCondition.md), [`AaveCollateralDepositCondition`](AaveCollateralDepositCondition.md), [`AaveBorrowCondition`](AaveBorrowCondition.md), [`AaveRepayCondition`](AaveRepayCondition.md), [`AaveCollateralWithdrawCondition`](AaveCollateralWithdrawCondition.md), [`DistributeNFTCollateralCondition`](DistributeNFTCollateralCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:275](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L275) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndDeployVault + +▸ **createAgreementAndDeployVault**(`agreementIdSeed`, `ddo`, `nftTokenContract`, `nftAmount`, `collateralToken`, `collateralAmount`, `delegatedToken`, `delegatedAmount`, `interestRateMode`, `borrower`, `lender`, `timeLocks`, `timeOuts`, `txParams?`, `from?`): `Promise`<[`ContractTransactionReceipt`, `string`, [`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\>]\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------------------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `nftTokenContract` | `string` | +| `nftAmount` | `number` | +| `collateralToken` | `string` | +| `collateralAmount` | `number` | +| `delegatedToken` | `string` | +| `delegatedAmount` | `number` | +| `interestRateMode` | `number` | +| `borrower` | `string` | +| `lender` | `string` | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `from?` | [`Account`](Account.md) | + +#### Returns + +`Promise`<[`ContractTransactionReceipt`, `string`, [`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\>]\> + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:149](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L149) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | [`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md) | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | [`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md) | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): [`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### deployVault + +▸ **deployVault**(`lendingPool`, `dataProvider`, `weth`, `agreementFee`, `treasuryAddress`, `borrower`, `lender`, `from`): `Promise`<`string`\> + +Deploy a new credit vault that is required to facilitate an Aave credit agreement + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `lendingPool` | `string` | +| `dataProvider` | `string` | +| `weth` | `string` | +| `agreementFee` | `number` | +| `treasuryAddress` | `string` | +| `borrower` | `string` | +| `lender` | `string` | +| `from` | `string` | + +#### Returns + +`Promise`<`string`\> + +Agreement ID. + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:201](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L201) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L45) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementDid + +▸ **getAgreementDid**(`agreementId`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:305](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L305) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :---------------------------------------------------------------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | [`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md) | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementVaultAddress + +▸ **getAgreementVaultAddress**(`agreementId`, `from`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `from` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:301](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L301) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L92) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------------------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | [`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md) | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:227](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L227) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L42) + +--- + +### params + +▸ **params**(`vaultAddress`, `nftContractAddress`, `nftAmount`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`): [`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md) + +#### Parameters + +| Name | Type | +| :------------------- | :------- | +| `vaultAddress` | `string` | +| `nftContractAddress` | `string` | +| `nftAmount` | `number` | +| `collateralAsset` | `string` | +| `collateralAmount` | `string` | +| `delegatedAsset` | `string` | +| `delegatedAmount` | `string` | +| `interestRateMode` | `number` | + +#### Returns + +[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:65](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L65) + +--- + +### paramsGen + +▸ **paramsGen**(`_params`): `Promise`<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------------ | :----------------- | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<[`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L39) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L61) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | [`AaveCreditTemplateParams`](../interfaces/AaveCreditTemplateParams.md) | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AaveCreditTemplate`](AaveCreditTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AaveCreditTemplate`](AaveCreditTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L50) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AaveRepayCondition.md b/docs/api-reference/classes/AaveRepayCondition.md new file mode 100644 index 000000000..ca2972a08 --- /dev/null +++ b/docs/api-reference/classes/AaveRepayCondition.md @@ -0,0 +1,968 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveRepayCondition + +# Class: AaveRepayCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`AaveRepayConditionContext`\> + + ↳ **`AaveRepayCondition`** + +## Table of contents + +### Constructors + +- [constructor](AaveRepayCondition.md#constructor) + +### Properties + +- [address](AaveRepayCondition.md#address) +- [contract](AaveRepayCondition.md#contract) +- [contractName](AaveRepayCondition.md#contractname) +- [events](AaveRepayCondition.md#events) +- [version](AaveRepayCondition.md#version) + +### Accessors + +- [artifactsFolder](AaveRepayCondition.md#artifactsfolder) +- [circuitsFolder](AaveRepayCondition.md#circuitsfolder) +- [config](AaveRepayCondition.md#config) +- [instanceConfig](AaveRepayCondition.md#instanceconfig) +- [instantiableConfig](AaveRepayCondition.md#instantiableconfig) +- [logger](AaveRepayCondition.md#logger) +- [nevermined](AaveRepayCondition.md#nevermined) +- [web3](AaveRepayCondition.md#web3) + +### Methods + +- [abortByTimeOut](AaveRepayCondition.md#abortbytimeout) +- [call](AaveRepayCondition.md#call) +- [fulfill](AaveRepayCondition.md#fulfill) +- [fulfillInstance](AaveRepayCondition.md#fulfillinstance) +- [fulfillPlain](AaveRepayCondition.md#fulfillplain) +- [fulfillWithNode](AaveRepayCondition.md#fulfillwithnode) +- [generateId](AaveRepayCondition.md#generateid) +- [generateIdHash](AaveRepayCondition.md#generateidhash) +- [generateIdWithSeed](AaveRepayCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](AaveRepayCondition.md#getconditionfulfilledevent) +- [getFromAddress](AaveRepayCondition.md#getfromaddress) +- [getInputsOfMethod](AaveRepayCondition.md#getinputsofmethod) +- [getSignatureOfMethod](AaveRepayCondition.md#getsignatureofmethod) +- [hashValues](AaveRepayCondition.md#hashvalues) +- [hashValuesPlain](AaveRepayCondition.md#hashvaluesplain) +- [init](AaveRepayCondition.md#init) +- [instance](AaveRepayCondition.md#instance) +- [instanceFromDDO](AaveRepayCondition.md#instancefromddo) +- [nodeMethod](AaveRepayCondition.md#nodemethod) +- [params](AaveRepayCondition.md#params) +- [paramsFromDDO](AaveRepayCondition.md#paramsfromddo) +- [send](AaveRepayCondition.md#send) +- [sendFrom](AaveRepayCondition.md#sendfrom) +- [setInstanceConfig](AaveRepayCondition.md#setinstanceconfig) +- [getInstance](AaveRepayCondition.md#getinstance) +- [setInstanceConfig](AaveRepayCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AaveRepayCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `assetToRepay`, `amountToRepay`, `interestRateMode`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `vaultAddress` | `string` | +| `assetToRepay` | `string` | +| `amountToRepay` | `string` | +| `interestRateMode` | `number` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/defi/AaveRepayCondition.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveRepayCondition.ts#L44) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `AaveRepayConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `vaultAddress`, `assetToRepay`, `amountToRepay`, `interestRateMode`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :----------------- | :------- | +| `did` | `string` | +| `vaultAddress` | `string` | +| `assetToRepay` | `string` | +| `amountToRepay` | `string` | +| `interestRateMode` | `number` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/defi/AaveRepayCondition.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveRepayCondition.ts#L19) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :-------------------------- | +| `«destructured»` | `AaveRepayConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/defi/AaveRepayCondition.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveRepayCondition.ts#L34) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AaveRepayCondition`](AaveRepayCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AaveRepayCondition`](AaveRepayCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/defi/AaveRepayCondition.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveRepayCondition.ts#L15) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AccessCondition.md b/docs/api-reference/classes/AccessCondition.md new file mode 100644 index 000000000..dfed1d69b --- /dev/null +++ b/docs/api-reference/classes/AccessCondition.md @@ -0,0 +1,1006 @@ +[@nevermined-io/sdk](../code-reference.md) / AccessCondition + +# Class: AccessCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`AccessConditionContext`\> + + ↳ **`AccessCondition`** + +## Table of contents + +### Constructors + +- [constructor](AccessCondition.md#constructor) + +### Properties + +- [address](AccessCondition.md#address) +- [contract](AccessCondition.md#contract) +- [contractName](AccessCondition.md#contractname) +- [events](AccessCondition.md#events) +- [version](AccessCondition.md#version) + +### Accessors + +- [artifactsFolder](AccessCondition.md#artifactsfolder) +- [circuitsFolder](AccessCondition.md#circuitsfolder) +- [config](AccessCondition.md#config) +- [instanceConfig](AccessCondition.md#instanceconfig) +- [instantiableConfig](AccessCondition.md#instantiableconfig) +- [logger](AccessCondition.md#logger) +- [nevermined](AccessCondition.md#nevermined) +- [web3](AccessCondition.md#web3) + +### Methods + +- [abortByTimeOut](AccessCondition.md#abortbytimeout) +- [call](AccessCondition.md#call) +- [checkPermissions](AccessCondition.md#checkpermissions) +- [fulfill](AccessCondition.md#fulfill) +- [fulfillInstance](AccessCondition.md#fulfillinstance) +- [fulfillPlain](AccessCondition.md#fulfillplain) +- [fulfillWithNode](AccessCondition.md#fulfillwithnode) +- [generateId](AccessCondition.md#generateid) +- [generateIdHash](AccessCondition.md#generateidhash) +- [generateIdWithSeed](AccessCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](AccessCondition.md#getconditionfulfilledevent) +- [getFromAddress](AccessCondition.md#getfromaddress) +- [getGrantedDidByConsumer](AccessCondition.md#getgranteddidbyconsumer) +- [getInputsOfMethod](AccessCondition.md#getinputsofmethod) +- [getSignatureOfMethod](AccessCondition.md#getsignatureofmethod) +- [hashValues](AccessCondition.md#hashvalues) +- [hashValuesPlain](AccessCondition.md#hashvaluesplain) +- [init](AccessCondition.md#init) +- [instance](AccessCondition.md#instance) +- [instanceFromDDO](AccessCondition.md#instancefromddo) +- [nodeMethod](AccessCondition.md#nodemethod) +- [params](AccessCondition.md#params) +- [paramsFromDDO](AccessCondition.md#paramsfromddo) +- [send](AccessCondition.md#send) +- [sendFrom](AccessCondition.md#sendfrom) +- [setInstanceConfig](AccessCondition.md#setinstanceconfig) +- [getInstance](AccessCondition.md#getinstance) +- [setInstanceConfig](AccessCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AccessCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### checkPermissions + +▸ **checkPermissions**(`grantee`, `did`, `from?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------- | +| `grantee` | `string` | +| `did` | `string` | +| `from?` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/keeper/contracts/conditions/AccessCondition.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/AccessCondition.ts#L35) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `grantee`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `grantee` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/AccessCondition.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/AccessCondition.ts#L25) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getGrantedDidByConsumer + +▸ **getGrantedDidByConsumer**(`consumer`): `Promise`<{ `agreementId`: `string` ; `did`: `string` }[]\> + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `consumer` | `string` | + +#### Returns + +`Promise`<{ `agreementId`: `string` ; `did`: `string` }[]\> + +#### Defined in + +[src/keeper/contracts/conditions/AccessCondition.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/AccessCondition.ts#L43) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `AccessConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `grantee`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `did` | `string` | +| `grantee` | `string` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/AccessCondition.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/AccessCondition.ts#L17) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :----------------------- | +| `«destructured»` | `AccessConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/AccessCondition.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/AccessCondition.ts#L21) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AccessCondition`](AccessCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AccessCondition`](AccessCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/AccessCondition.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/AccessCondition.ts#L13) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AccessService.md b/docs/api-reference/classes/AccessService.md new file mode 100644 index 000000000..d500f57e8 --- /dev/null +++ b/docs/api-reference/classes/AccessService.md @@ -0,0 +1,402 @@ +[@nevermined-io/sdk](../code-reference.md) / AccessService + +# Class: AccessService + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`AccessService`** + +## Implements + +- [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAccess`](../interfaces/ServiceAccess.md)\> + +## Table of contents + +### Constructors + +- [constructor](AccessService.md#constructor) + +### Properties + +- [normal](AccessService.md#normal) + +### Accessors + +- [artifactsFolder](AccessService.md#artifactsfolder) +- [circuitsFolder](AccessService.md#circuitsfolder) +- [config](AccessService.md#config) +- [instanceConfig](AccessService.md#instanceconfig) +- [instantiableConfig](AccessService.md#instantiableconfig) +- [logger](AccessService.md#logger) +- [nevermined](AccessService.md#nevermined) +- [web3](AccessService.md#web3) + +### Methods + +- [accept](AccessService.md#accept) +- [createService](AccessService.md#createservice) +- [process](AccessService.md#process) +- [setInstanceConfig](AccessService.md#setinstanceconfig) +- [track](AccessService.md#track) +- [getInstance](AccessService.md#getinstance) +- [setInstanceConfig](AccessService.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AccessService**(`config`, `normal`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | +| `normal` | [`AccessTemplate`](AccessTemplate.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/AccessService.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L33) + +## Properties + +### normal + +• **normal**: [`AccessTemplate`](AccessTemplate.md) + +#### Defined in + +[src/nevermined/AccessService.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[accept](../interfaces/ServicePlugin.md#accept) + +#### Defined in + +[src/nevermined/AccessService.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L62) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `pricedData?`): [`ServiceAccess`](../interfaces/ServiceAccess.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `pricedData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceAccess`](../interfaces/ServiceAccess.md) + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[createService](../interfaces/ServicePlugin.md#createservice) + +#### Defined in + +[src/nevermined/AccessService.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L39) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[process](../interfaces/ServicePlugin.md#process) + +#### Defined in + +[src/nevermined/AccessService.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L55) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### track + +▸ **track**(`params`, `from`, `txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[track](../interfaces/ServicePlugin.md#track) + +#### Defined in + +[src/nevermined/AccessService.ts:65](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L65) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AccessTemplate.md b/docs/api-reference/classes/AccessTemplate.md new file mode 100644 index 000000000..493813601 --- /dev/null +++ b/docs/api-reference/classes/AccessTemplate.md @@ -0,0 +1,1439 @@ +[@nevermined-io/sdk](../code-reference.md) / AccessTemplate + +# Class: AccessTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<`AccessTemplateParams`, [`ServiceAccess`](../interfaces/ServiceAccess.md)\> + + ↳ **`AccessTemplate`** + +## Table of contents + +### Constructors + +- [constructor](AccessTemplate.md#constructor) + +### Properties + +- [address](AccessTemplate.md#address) +- [contract](AccessTemplate.md#contract) +- [contractName](AccessTemplate.md#contractname) +- [events](AccessTemplate.md#events) +- [version](AccessTemplate.md#version) + +### Accessors + +- [artifactsFolder](AccessTemplate.md#artifactsfolder) +- [circuitsFolder](AccessTemplate.md#circuitsfolder) +- [config](AccessTemplate.md#config) +- [instanceConfig](AccessTemplate.md#instanceconfig) +- [instantiableConfig](AccessTemplate.md#instantiableconfig) +- [logger](AccessTemplate.md#logger) +- [nevermined](AccessTemplate.md#nevermined) +- [web3](AccessTemplate.md#web3) + +### Methods + +- [accept](AccessTemplate.md#accept) +- [agreementId](AccessTemplate.md#agreementid) +- [call](AccessTemplate.md#call) +- [conditions](AccessTemplate.md#conditions) +- [createAgreement](AccessTemplate.md#createagreement) +- [createAgreementAndPay](AccessTemplate.md#createagreementandpay) +- [createAgreementFromDDO](AccessTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](AccessTemplate.md#createagreementwithpaymentfromddo) +- [createService](AccessTemplate.md#createservice) +- [description](AccessTemplate.md#description) +- [extraGen](AccessTemplate.md#extragen) +- [getAgreementCreatedEvent](AccessTemplate.md#getagreementcreatedevent) +- [getAgreementData](AccessTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](AccessTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](AccessTemplate.md#getagreementstatus) +- [getAgreementsForDID](AccessTemplate.md#getagreementsfordid) +- [getConditionTypes](AccessTemplate.md#getconditiontypes) +- [getConditions](AccessTemplate.md#getconditions) +- [getFromAddress](AccessTemplate.md#getfromaddress) +- [getInputsOfMethod](AccessTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](AccessTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](AccessTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](AccessTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](AccessTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](AccessTemplate.md#getsignatureofmethod) +- [init](AccessTemplate.md#init) +- [instanceFromDDO](AccessTemplate.md#instancefromddo) +- [lockConditionIndex](AccessTemplate.md#lockconditionindex) +- [lockTokens](AccessTemplate.md#locktokens) +- [name](AccessTemplate.md#name) +- [params](AccessTemplate.md#params) +- [paramsGen](AccessTemplate.md#paramsgen) +- [paymentData](AccessTemplate.md#paymentdata) +- [printAgreementStatus](AccessTemplate.md#printagreementstatus) +- [process](AccessTemplate.md#process) +- [send](AccessTemplate.md#send) +- [sendFrom](AccessTemplate.md#sendfrom) +- [service](AccessTemplate.md#service) +- [serviceEndpoint](AccessTemplate.md#serviceendpoint) +- [setInstanceConfig](AccessTemplate.md#setinstanceconfig) +- [standardContext](AccessTemplate.md#standardcontext) +- [track](AccessTemplate.md#track) +- [validateAgreement](AccessTemplate.md#validateagreement) +- [getInstance](AccessTemplate.md#getinstance) +- [setInstanceConfig](AccessTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new AccessTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L98) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`AccessCondition`](AccessCondition.md), [`LockPaymentCondition`](LockPaymentCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Returns + +[[`AccessCondition`](AccessCondition.md), [`LockPaymentCondition`](LockPaymentCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L52) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `AccessTemplateParams` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `AccessTemplateParams` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): [`ServiceAccess`](../interfaces/ServiceAccess.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceAccess`](../interfaces/ServiceAccess.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L28) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :--------------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `AccessTemplateParams` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L39) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`AccessTemplateParams`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :--------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `AccessTemplateParams` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`AccessTemplateParams`\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L58) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L25) + +--- + +### params + +▸ **params**(`consumer`, `serviceType?`): `AccessTemplateParams` + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------------------------------------------------ | :------------ | +| `consumer` | [`Account`](Account.md) | `undefined` | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | `'access'` | + +#### Returns + +`AccessTemplateParams` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L43) + +--- + +### paramsGen + +▸ **paramsGen**(`«destructured»`): `Promise`<`AccessTemplateParams`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :--------------- | :------------------------------------------------------ | :----------------- | +| `«destructured»` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`AccessTemplateParams`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L17) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L35) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `AccessTemplateParams` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AccessTemplate`](AccessTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AccessTemplate`](AccessTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/AccessTemplate.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AccessTemplate.ts#L31) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Account.md b/docs/api-reference/classes/Account.md index 3b5bf9634..6d8bc94cd 100644 --- a/docs/api-reference/classes/Account.md +++ b/docs/api-reference/classes/Account.md @@ -6,7 +6,7 @@ Account information. ## Hierarchy -- `Instantiable` +- [`Instantiable`](Instantiable.md) ↳ **`Account`** @@ -23,11 +23,12 @@ Account information. - [babyY](Account.md#babyy) - [id](Account.md#id) - [password](Account.md#password) -- [token](Account.md#token) +- [zeroDevSigner](Account.md#zerodevsigner) ### Accessors - [artifactsFolder](Account.md#artifactsfolder) +- [circuitsFolder](Account.md#circuitsfolder) - [config](Account.md#config) - [instanceConfig](Account.md#instanceconfig) - [instantiableConfig](Account.md#instantiableconfig) @@ -37,25 +38,18 @@ Account information. ### Methods -- [addresses](Account.md#addresses) -- [authenticate](Account.md#authenticate) -- [checkExists](Account.md#checkexists) -- [findSigner](Account.md#findsigner) - [getBalance](Account.md#getbalance) - [getEtherBalance](Account.md#getetherbalance) - [getId](Account.md#getid) - [getNeverminedBalance](Account.md#getneverminedbalance) - [getPassword](Account.md#getpassword) - [getPublic](Account.md#getpublic) -- [getToken](Account.md#gettoken) -- [isTokenStored](Account.md#istokenstored) +- [isZeroDev](Account.md#iszerodev) - [requestTokens](Account.md#requesttokens) - [setId](Account.md#setid) - [setInstanceConfig](Account.md#setinstanceconfig) - [setPassword](Account.md#setpassword) -- [setToken](Account.md#settoken) -- [addressesStatic](Account.md#addressesstatic) -- [findSignerStatic](Account.md#findsignerstatic) +- [fromZeroDevSigner](Account.md#fromzerodevsigner) - [getInstance](Account.md#getinstance) - [setInstanceConfig](Account.md#setinstanceconfig-1) @@ -67,18 +61,18 @@ Account information. #### Parameters -| Name | Type | Default value | -| :-------- | :------------------- | :------------ | -| `id` | `string` | `'0x0'` | -| `config?` | `InstantiableConfig` | `undefined` | +| Name | Type | Default value | +| :-------- | :---------------------------------------------------------- | :------------ | +| `id` | `string` | `'0x0'` | +| `config?` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | #### Overrides -Instantiable.constructor +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) #### Defined in -[src/nevermined.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L20) +[src/nevermined/Account.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L19) ## Properties @@ -88,7 +82,7 @@ Instantiable.constructor #### Defined in -[src/nevermined.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L18) +[src/nevermined/Account.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L16) --- @@ -98,7 +92,7 @@ Instantiable.constructor #### Defined in -[src/nevermined.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L16) +[src/nevermined/Account.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L14) --- @@ -108,7 +102,7 @@ Instantiable.constructor #### Defined in -[src/nevermined.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L17) +[src/nevermined/Account.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L15) --- @@ -118,7 +112,7 @@ Instantiable.constructor #### Defined in -[src/nevermined.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L20) +[src/nevermined/Account.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L19) --- @@ -128,17 +122,17 @@ Instantiable.constructor #### Defined in -[src/nevermined.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L12) +[src/nevermined/Account.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L13) --- -### token +### zeroDevSigner -• `Private` `Optional` **token**: `string` +• **zeroDevSigner**: `ZeroDevAccountSigner`<`"ECDSA"`\> #### Defined in -[src/nevermined.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L14) +[src/nevermined/Account.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L17) ## Accessors @@ -156,17 +150,35 @@ Instantiable.artifactsFolder #### Defined in -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) --- ### config -• `Protected` `get` **config**(): [`Config`](Config.md) +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) #### Returns -[`Config`](Config.md) +[`NeverminedOptions`](NeverminedOptions.md) #### Inherited from @@ -174,17 +186,17 @@ Instantiable.config #### Defined in -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) --- ### instanceConfig -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -192,17 +204,17 @@ Instantiable.instanceConfig #### Defined in -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) --- ### instantiableConfig -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -210,17 +222,17 @@ Instantiable.instantiableConfig #### Defined in -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) --- ### logger -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) +• `Protected` `get` **logger**(): `Logger` #### Returns -[`Logger`](utils.Logger.md) +`Logger` #### Inherited from @@ -228,7 +240,7 @@ Instantiable.logger #### Defined in -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) --- @@ -246,17 +258,17 @@ Instantiable.nevermined #### Defined in -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) --- ### web3 -• `Protected` `get` **web3**(): `JsonRpcProvider` +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` #### Returns -`JsonRpcProvider` +`JsonRpcProvider` \| `BrowserProvider` #### Inherited from @@ -264,125 +276,39 @@ Instantiable.web3 #### Defined in -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) ## Methods -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### authenticate - -▸ **authenticate**(): `Promise`<`void`\> - -Authenticate the account. - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[src/nevermined.ts:82](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L82) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -Instantiable.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - ### getBalance -▸ **getBalance**(): `Promise`<`default`\> +▸ **getBalance**(): `Promise`<[`Balance`](../interfaces/Balance.md)\> Balances of Ether and Nevermined Token. #### Returns -`Promise`<`default`\> +`Promise`<[`Balance`](../interfaces/Balance.md)\> #### Defined in -[src/nevermined.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L108) +[src/nevermined/Account.ts:93](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L93) --- ### getEtherBalance -▸ **getEtherBalance**(): `Promise`<`default`\> +▸ **getEtherBalance**(): `Promise`<`bigint`\> Balance of Ether. #### Returns -`Promise`<`default`\> +`Promise`<`bigint`\> #### Defined in -[src/nevermined.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L100) +[src/nevermined/Account.ts:85](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L85) --- @@ -396,23 +322,23 @@ Balance of Ether. #### Defined in -[src/nevermined.ts:27](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L27) +[src/nevermined/Account.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L43) --- ### getNeverminedBalance -▸ **getNeverminedBalance**(): `Promise`<`default`\> +▸ **getNeverminedBalance**(): `Promise`<`bigint`\> Balance of Nevermined Token. #### Returns -`Promise`<`default`\> +`Promise`<`bigint`\> #### Defined in -[src/nevermined.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L90) +[src/nevermined/Account.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L75) --- @@ -430,7 +356,7 @@ The account password. #### Defined in -[src/nevermined.ts:51](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L51) +[src/nevermined/Account.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L67) --- @@ -444,58 +370,36 @@ The account password. #### Defined in -[src/nevermined.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L35) - ---- - -### getToken - -▸ **getToken**(): `Promise`<`string`\> - -Returns account token. - -#### Returns - -`Promise`<`string`\> - -Account token. - -#### Defined in - -[src/nevermined.ts:67](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L67) +[src/nevermined/Account.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L51) --- -### isTokenStored +### isZeroDev -▸ **isTokenStored**(): `Promise`<`boolean`\> - -Returns if account token is stored. +▸ **isZeroDev**(): `boolean` #### Returns -`Promise`<`boolean`\> - -true if the token is stored. +`boolean` #### Defined in -[src/nevermined.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L75) +[src/nevermined/Account.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L39) --- ### requestTokens -▸ **requestTokens**(`amount`, `params?`): `Promise`<`string`\> +▸ **requestTokens**(`amount`, `txParams?`): `Promise`<`string`\> Request Nevermined Tokens. #### Parameters -| Name | Type | Description | -| :-------- | :-------------------------------- | :---------------------- | -| `amount` | `string` \| `number` \| `default` | Tokens to be requested. | -| `params?` | `TxParameters` | - | +| Name | Type | Description | +| :---------- | :-------------------------------------------------- | :---------------------- | +| `amount` | [`BigNumberish`](../code-reference.md#bignumberish) | Tokens to be requested. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | #### Returns @@ -503,7 +407,7 @@ Request Nevermined Tokens. #### Defined in -[src/nevermined.ts:120](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L120) +[src/nevermined/Account.ts:106](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L106) --- @@ -523,7 +427,7 @@ Request Nevermined Tokens. #### Defined in -[src/nevermined.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L31) +[src/nevermined/Account.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L47) --- @@ -533,9 +437,9 @@ Request Nevermined Tokens. #### Parameters -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -543,11 +447,11 @@ Request Nevermined Tokens. #### Inherited from -Instantiable.setInstanceConfig +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) #### Defined in -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) --- @@ -569,86 +473,37 @@ Set account password. #### Defined in -[src/nevermined.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L43) +[src/nevermined/Account.ts:59](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L59) --- -### setToken +### fromZeroDevSigner -▸ **setToken**(`token`): `void` +▸ `Static` **fromZeroDevSigner**(`signer`): `Promise`<[`Account`](Account.md)\> -Set account token. +Returns a nevermined Account from a zerodev signer #### Parameters -| Name | Type | Description | -| :------ | :------- | :----------------- | -| `token` | `string` | Token for account. | +| Name | Type | Description | +| :------- | :--------------------------------- | :----------------------- | +| `signer` | `ZeroDevAccountSigner`<`"ECDSA"`\> | A zerodev account signer | #### Returns -`void` - -#### Defined in - -[src/nevermined.ts:59](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L59) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from +`Promise`<[`Account`](Account.md)\> -Instantiable.findSignerStatic +The nevermined account #### Defined in -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) +[src/nevermined/Account.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Account.ts#L32) --- ### getInstance -▸ `Static` **getInstance**(...`_args`): `any` +▸ `Static` **getInstance**(`..._args`): `any` #### Parameters @@ -662,11 +517,11 @@ Instantiable.findSignerStatic #### Inherited from -Instantiable.getInstance +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) #### Defined in -[src/Instantiable.abstract.ts:158](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L158) +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) --- @@ -676,16 +531,16 @@ Instantiable.getInstance #### Type parameters -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | #### Parameters -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -693,8 +548,8 @@ Instantiable.getInstance #### Inherited from -Instantiable.setInstanceConfig +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) #### Defined in -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Accounts.md b/docs/api-reference/classes/Accounts.md deleted file mode 100644 index e4ff6d7bb..000000000 --- a/docs/api-reference/classes/Accounts.md +++ /dev/null @@ -1,489 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / Accounts - -# Class: Accounts - -Account submodule of Nevermined. - -## Hierarchy - -- `Instantiable` - - ↳ **`Accounts`** - -## Table of contents - -### Constructors - -- [constructor](Accounts.md#constructor) - -### Accessors - -- [artifactsFolder](Accounts.md#artifactsfolder) -- [config](Accounts.md#config) -- [instanceConfig](Accounts.md#instanceconfig) -- [instantiableConfig](Accounts.md#instantiableconfig) -- [logger](Accounts.md#logger) -- [nevermined](Accounts.md#nevermined) -- [web3](Accounts.md#web3) - -### Methods - -- [addresses](Accounts.md#addresses) -- [balance](Accounts.md#balance) -- [checkExists](Accounts.md#checkexists) -- [findSigner](Accounts.md#findsigner) -- [list](Accounts.md#list) -- [requestEthFromFaucet](Accounts.md#requestethfromfaucet) -- [requestList](Accounts.md#requestlist) -- [requestTokens](Accounts.md#requesttokens) -- [setInstanceConfig](Accounts.md#setinstanceconfig) -- [addressesStatic](Accounts.md#addressesstatic) -- [findSignerStatic](Accounts.md#findsignerstatic) -- [getInstance](Accounts.md#getinstance) -- [setInstanceConfig](Accounts.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new Accounts**() - -#### Inherited from - -Instantiable.constructor - -## Accessors - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Instantiable.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -Instantiable.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -Instantiable.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -Instantiable.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -Instantiable.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### balance - -▸ **balance**(`account`): `Promise`<`default`\> - -Return account balance. - -#### Parameters - -| Name | Type | Description | -| :-------- | :---------------------- | :---------------- | -| `account` | [`Account`](Account.md) | Account instance. | - -#### Returns - -`Promise`<`default`\> - -Ether and Nevermined Token balance. - -#### Defined in - -[src/nevermineds.ts:47](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermineds.ts#L47) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -Instantiable.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### list - -▸ **list**(): `Promise`<[`Account`](Account.md)[]\> - -Returns the list of accounts. - -#### Returns - -`Promise`<[`Account`](Account.md)[]\> - -The list of accounts. - -#### Defined in - -[src/nevermineds.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermineds.ts#L26) - ---- - -### requestEthFromFaucet - -▸ **requestEthFromFaucet**(`address`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -#### Defined in - -[src/nevermineds.ts:70](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermineds.ts#L70) - ---- - -### requestList - -▸ **requestList**(): `Promise`<[`Account`](Account.md)[]\> - -Returns the list of accounts including the addresses not controlled by the node, -only can be used by providers like metamask, Status or Trustwallet but not by default -provider - -#### Returns - -`Promise`<[`Account`](Account.md)[]\> - -#### Defined in - -[src/nevermineds.ts:38](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermineds.ts#L38) - ---- - -### requestTokens - -▸ **requestTokens**(`account`, `amount`, `params?`): `Promise`<`boolean`\> - -Request tokens for an account. - -#### Parameters - -| Name | Type | Description | -| :-------- | :---------------------- | :---------------- | -| `account` | [`Account`](Account.md) | Account instance. | -| `amount` | `number` | Token amount. | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`boolean`\> - -true if the call was successful. false otherwise. - -#### Defined in - -[src/nevermineds.ts:57](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermineds.ts#L57) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSignerStatic - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`Accounts`](Accounts.md)\> - -Returns the instance of Accounts. - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`Accounts`](Accounts.md)\> - -[Accounts](Accounts.md) - -#### Overrides - -Instantiable.getInstance - -#### Defined in - -[src/nevermineds.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermineds.ts#L14) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/AccountsApi.md b/docs/api-reference/classes/AccountsApi.md new file mode 100644 index 000000000..baeb7cfd0 --- /dev/null +++ b/docs/api-reference/classes/AccountsApi.md @@ -0,0 +1,434 @@ +[@nevermined-io/sdk](../code-reference.md) / AccountsApi + +# Class: AccountsApi + +Nevermined Accounts API. It allows execute operations related with Ethereum accounts. + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`AccountsApi`** + +## Table of contents + +### Constructors + +- [constructor](AccountsApi.md#constructor) + +### Accessors + +- [artifactsFolder](AccountsApi.md#artifactsfolder) +- [circuitsFolder](AccountsApi.md#circuitsfolder) +- [config](AccountsApi.md#config) +- [instanceConfig](AccountsApi.md#instanceconfig) +- [instantiableConfig](AccountsApi.md#instantiableconfig) +- [logger](AccountsApi.md#logger) +- [nevermined](AccountsApi.md#nevermined) +- [web3](AccountsApi.md#web3) + +### Methods + +- [addresses](AccountsApi.md#addresses) +- [balance](AccountsApi.md#balance) +- [findSigner](AccountsApi.md#findsigner) +- [findSignerStatic](AccountsApi.md#findsignerstatic) +- [getAccount](AccountsApi.md#getaccount) +- [list](AccountsApi.md#list) +- [requestTokens](AccountsApi.md#requesttokens) +- [setInstanceConfig](AccountsApi.md#setinstanceconfig) +- [getInstance](AccountsApi.md#getinstance) +- [setInstanceConfig](AccountsApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AccountsApi**(`config`) + +Creates a new AccountsApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L16) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addresses + +▸ **addresses**(): `Promise`<`string`[]\> + +#### Returns + +`Promise`<`string`[]\> + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L90) + +--- + +### balance + +▸ **balance**(`account`): `Promise`<[`Balance`](../interfaces/Balance.md)\> + +Return account balance. + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------- | :---------------- | +| `account` | [`Account`](Account.md) | Account instance. | + +#### Returns + +`Promise`<[`Balance`](../interfaces/Balance.md)\> + +Ether and Nevermined Token balance. + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L46) + +--- + +### findSigner + +▸ **findSigner**(`from`): `Promise`<`Signer`\> + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `from` | `string` | + +#### Returns + +`Promise`<`Signer`\> + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:70](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L70) + +--- + +### findSignerStatic + +▸ **findSignerStatic**(`from`): `Promise`<`Signer`\> + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `from` | `string` | + +#### Returns + +`Promise`<`Signer`\> + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L80) + +--- + +### getAccount + +▸ **getAccount**(`address`): [`Account`](Account.md) + +Returns an account initialized with existing web3 provider + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :------------------ | +| `address` | `string` | The account address | + +#### Returns + +[`Account`](Account.md) + +The account + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L37) + +--- + +### list + +▸ **list**(): `Promise`<[`Account`](Account.md)[]\> + +Returns the list of accounts including the addresses not controlled by the node, +only can be used by providers like metamask, Status or Trustwallet but not by default +provider + +#### Returns + +`Promise`<[`Account`](Account.md)[]\> + +The list of accounts. + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L27) + +--- + +### requestTokens + +▸ **requestTokens**(`account`, `amount`, `params?`): `Promise`<`boolean`\> + +Request tokens for an account. + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------------------------------- | :---------------- | +| `account` | [`Account`](Account.md) | Account instance. | +| `amount` | `number` | Token amount. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`boolean`\> + +true if the call was successful. false otherwise. + +#### Defined in + +[src/nevermined/api/AccountsApi.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AccountsApi.ts#L57) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AgreementStoreManager.md b/docs/api-reference/classes/AgreementStoreManager.md new file mode 100644 index 000000000..572644364 --- /dev/null +++ b/docs/api-reference/classes/AgreementStoreManager.md @@ -0,0 +1,705 @@ +[@nevermined-io/sdk](../code-reference.md) / AgreementStoreManager + +# Class: AgreementStoreManager + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`AgreementStoreManager`** + +## Table of contents + +### Constructors + +- [constructor](AgreementStoreManager.md#constructor) + +### Properties + +- [address](AgreementStoreManager.md#address) +- [contract](AgreementStoreManager.md#contract) +- [contractName](AgreementStoreManager.md#contractname) +- [events](AgreementStoreManager.md#events) +- [templates](AgreementStoreManager.md#templates) +- [version](AgreementStoreManager.md#version) + +### Accessors + +- [artifactsFolder](AgreementStoreManager.md#artifactsfolder) +- [circuitsFolder](AgreementStoreManager.md#circuitsfolder) +- [config](AgreementStoreManager.md#config) +- [instanceConfig](AgreementStoreManager.md#instanceconfig) +- [instantiableConfig](AgreementStoreManager.md#instantiableconfig) +- [logger](AgreementStoreManager.md#logger) +- [nevermined](AgreementStoreManager.md#nevermined) +- [web3](AgreementStoreManager.md#web3) + +### Methods + +- [addTemplate](AgreementStoreManager.md#addtemplate) +- [agreementId](AgreementStoreManager.md#agreementid) +- [call](AgreementStoreManager.md#call) +- [createAgreement](AgreementStoreManager.md#createagreement) +- [getAgreement](AgreementStoreManager.md#getagreement) +- [getAgreements](AgreementStoreManager.md#getagreements) +- [getFromAddress](AgreementStoreManager.md#getfromaddress) +- [getInputsOfMethod](AgreementStoreManager.md#getinputsofmethod) +- [getOwner](AgreementStoreManager.md#getowner) +- [getSignatureOfMethod](AgreementStoreManager.md#getsignatureofmethod) +- [init](AgreementStoreManager.md#init) +- [send](AgreementStoreManager.md#send) +- [sendFrom](AgreementStoreManager.md#sendfrom) +- [setInstanceConfig](AgreementStoreManager.md#setinstanceconfig) +- [setTemplates](AgreementStoreManager.md#settemplates) +- [getInstance](AgreementStoreManager.md#getinstance) +- [setInstanceConfig](AgreementStoreManager.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AgreementStoreManager**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### templates + +• **templates**: `any` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L19) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addTemplate + +▸ **addTemplate**(`name`, `obj`): `void` + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `name` | `string` | +| `obj` | `any` | + +#### Returns + +`void` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L33) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:76](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L76) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionTypes`, `conditionIds`, `timeLocks`, `timeOuts`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionTypes` | `string`[] | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L80) + +--- + +### getAgreement + +▸ **getAgreement**(`agreementId`): `Promise`<[`AgreementData`](../interfaces/AgreementData.md)\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<[`AgreementData`](../interfaces/AgreementData.md)\> + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L41) + +--- + +### getAgreements + +▸ **getAgreements**(`did`): `Promise`<[`AgreementData`](../interfaces/AgreementData.md)[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<[`AgreementData`](../interfaces/AgreementData.md)[]\> + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L68) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getOwner + +▸ **getOwner**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L37) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### setTemplates + +▸ **setTemplates**(`temp`): `void` + +#### Parameters + +| Name | Type | +| :----- | :---- | +| `temp` | `any` | + +#### Returns + +`void` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L29) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`AgreementStoreManager`](AgreementStoreManager.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`AgreementStoreManager`](AgreementStoreManager.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L21) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AgreementTemplate.md b/docs/api-reference/classes/AgreementTemplate.md index d0763ac37..9686c168e 100644 --- a/docs/api-reference/classes/AgreementTemplate.md +++ b/docs/api-reference/classes/AgreementTemplate.md @@ -10,11 +10,11 @@ ## Hierarchy -- `ContractBase` +- [`ContractBase`](ContractBase.md) ↳ **`AgreementTemplate`** - ↳↳ [`BaseTemplate`](templates.BaseTemplate.md) + ↳↳ [`BaseTemplate`](BaseTemplate.md) ## Table of contents @@ -24,6 +24,9 @@ ### Properties +- [\_conditionTypes](AgreementTemplate.md#_conditiontypes) +- [\_conditions](AgreementTemplate.md#_conditions) +- [address](AgreementTemplate.md#address) - [contract](AgreementTemplate.md#contract) - [contractName](AgreementTemplate.md#contractname) - [events](AgreementTemplate.md#events) @@ -31,8 +34,8 @@ ### Accessors -- [address](AgreementTemplate.md#address) - [artifactsFolder](AgreementTemplate.md#artifactsfolder) +- [circuitsFolder](AgreementTemplate.md#circuitsfolder) - [config](AgreementTemplate.md#config) - [instanceConfig](AgreementTemplate.md#instanceconfig) - [instantiableConfig](AgreementTemplate.md#instantiableconfig) @@ -42,23 +45,18 @@ ### Methods -- [addresses](AgreementTemplate.md#addresses) - [agreementId](AgreementTemplate.md#agreementid) - [call](AgreementTemplate.md#call) -- [checkExists](AgreementTemplate.md#checkexists) - [createAgreement](AgreementTemplate.md#createagreement) - [createAgreementAndPay](AgreementTemplate.md#createagreementandpay) - [createAgreementFromDDO](AgreementTemplate.md#createagreementfromddo) - [createAgreementWithPaymentFromDDO](AgreementTemplate.md#createagreementwithpaymentfromddo) -- [findSigner](AgreementTemplate.md#findsigner) -- [getAddress](AgreementTemplate.md#getaddress) - [getAgreementCreatedEvent](AgreementTemplate.md#getagreementcreatedevent) - [getAgreementIdsFromDDO](AgreementTemplate.md#getagreementidsfromddo) - [getAgreementStatus](AgreementTemplate.md#getagreementstatus) - [getAgreementsForDID](AgreementTemplate.md#getagreementsfordid) - [getConditionTypes](AgreementTemplate.md#getconditiontypes) - [getConditions](AgreementTemplate.md#getconditions) -- [getContract](AgreementTemplate.md#getcontract) - [getFromAddress](AgreementTemplate.md#getfromaddress) - [getInputsOfMethod](AgreementTemplate.md#getinputsofmethod) - [getServiceAgreementTemplate](AgreementTemplate.md#getserviceagreementtemplate) @@ -78,8 +76,6 @@ - [service](AgreementTemplate.md#service) - [setInstanceConfig](AgreementTemplate.md#setinstanceconfig) - [standardContext](AgreementTemplate.md#standardcontext) -- [addressesStatic](AgreementTemplate.md#addressesstatic) -- [findSignerStatic](AgreementTemplate.md#findsignerstatic) - [getInstance](AgreementTemplate.md#getinstance) - [setInstanceConfig](AgreementTemplate.md#setinstanceconfig-1) @@ -103,53 +99,87 @@ #### Overrides -ContractBase.constructor +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) ## Properties +### \_conditionTypes + +• `Private` **\_conditionTypes**: `string`[] + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L52) + +--- + +### \_conditions + +• `Private` **\_conditions**: [`ConditionSmall`](ConditionSmall.md)[] + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L53) + +--- + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + ### contract -• **contract**: `Contract` = `null` +• **contract**: `BaseContract` = `null` #### Inherited from -ContractBase.contract +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) #### Defined in -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) --- ### contractName -• **contractName**: `string` +• `Readonly` **contractName**: `string` #### Inherited from -ContractBase.contractName +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) #### Defined in -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) --- ### events -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` #### Inherited from -ContractBase.events +[ContractBase](ContractBase.md).[events](ContractBase.md#events) #### Defined in -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) --- @@ -159,17 +189,17 @@ ContractBase.events #### Inherited from -ContractBase.version +[ContractBase](ContractBase.md).[version](ContractBase.md#version) #### Defined in -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) ## Accessors -### address +### artifactsFolder -• `get` **address**(): `string` +• `Protected` `get` **artifactsFolder**(): `string` #### Returns @@ -177,17 +207,17 @@ ContractBase.version #### Inherited from -ContractBase.address +ContractBase.artifactsFolder #### Defined in -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) --- -### artifactsFolder +### circuitsFolder -• `Protected` `get` **artifactsFolder**(): `string` +• `Protected` `get` **circuitsFolder**(): `string` #### Returns @@ -195,21 +225,21 @@ ContractBase.address #### Inherited from -ContractBase.artifactsFolder +ContractBase.circuitsFolder #### Defined in -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) --- ### config -• `Protected` `get` **config**(): [`Config`](Config.md) +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) #### Returns -[`Config`](Config.md) +[`NeverminedOptions`](NeverminedOptions.md) #### Inherited from @@ -217,17 +247,17 @@ ContractBase.config #### Defined in -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) --- ### instanceConfig -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -235,17 +265,17 @@ ContractBase.instanceConfig #### Defined in -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) --- ### instantiableConfig -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -253,17 +283,17 @@ ContractBase.instantiableConfig #### Defined in -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) --- ### logger -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) +• `Protected` `get` **logger**(): `Logger` #### Returns -[`Logger`](utils.Logger.md) +`Logger` #### Inherited from @@ -271,7 +301,7 @@ ContractBase.logger #### Defined in -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) --- @@ -289,17 +319,17 @@ ContractBase.nevermined #### Defined in -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) --- ### web3 -• `Protected` `get` **web3**(): `JsonRpcProvider` +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` #### Returns -`JsonRpcProvider` +`JsonRpcProvider` \| `BrowserProvider` #### Inherited from @@ -307,28 +337,10 @@ ContractBase.web3 #### Defined in -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) ## Methods -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -ContractBase.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - ### agreementId ▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> @@ -346,7 +358,7 @@ ContractBase.addresses #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) --- @@ -374,118 +386,90 @@ ContractBase.addresses #### Inherited from -ContractBase.call +[ContractBase](ContractBase.md).[call](ContractBase.md#call) #### Defined in -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -ContractBase.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) --- ### createAgreement -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) --- ### createAgreementAndPay -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) --- ### createAgreementFromDDO -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> Create a new agreement using the data of a DDO. #### Parameters -| Name | Type | Description | -| :---------------- | :---------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `Params` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `Params` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | #### Returns @@ -495,26 +479,26 @@ true if the call was successful. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) --- ### createAgreementWithPaymentFromDDO -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> #### Parameters -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `Params` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `Params` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | #### Returns @@ -522,49 +506,7 @@ true if the call was successful. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -ContractBase.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ContractBase.getAddress - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) --- @@ -588,7 +530,7 @@ Agreement created event. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) --- @@ -615,13 +557,13 @@ The condition IDs. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) --- ### getAgreementStatus -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> Returns the status of the conditions. @@ -633,13 +575,13 @@ Returns the status of the conditions. #### Returns -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> The conditions status. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) --- @@ -659,7 +601,7 @@ The conditions status. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) --- @@ -677,43 +619,25 @@ A list of condition addresses. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) --- ### getConditions -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> List of condition contracts. #### Returns -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> A list of condition contracts. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -ContractBase.getContract - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) --- @@ -733,17 +657,17 @@ ContractBase.getContract #### Inherited from -ContractBase.getFromAddress +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) #### Defined in -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) --- ### getInputsOfMethod -▸ **getInputsOfMethod**(`methodName`): `any`[] +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] #### Parameters @@ -753,35 +677,35 @@ ContractBase.getFromAddress #### Returns -`any`[] +readonly `ParamType`[] #### Inherited from -ContractBase.getInputsOfMethod +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) #### Defined in -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) --- ### getServiceAgreementTemplate -▸ `Abstract` **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> +▸ `Abstract` **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) #### Returns -`Promise`<`ServiceAgreementTemplate`\> +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:317](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L317) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:322](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L322) --- ### getServiceAgreementTemplateConditionByRef -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> #### Parameters @@ -791,25 +715,25 @@ ContractBase.getInputsOfMethod #### Returns -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) --- ### getServiceAgreementTemplateConditions -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] #### Returns -`Promise`<`ServiceAgreementTemplateCondition`[]\> +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) --- @@ -823,7 +747,7 @@ ContractBase.getInputsOfMethod #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) --- @@ -844,11 +768,11 @@ ContractBase.getInputsOfMethod #### Inherited from -ContractBase.getSignatureOfMethod +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) #### Defined in -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) --- @@ -858,10 +782,10 @@ ContractBase.getSignatureOfMethod #### Parameters -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | #### Returns @@ -869,17 +793,17 @@ ContractBase.getSignatureOfMethod #### Inherited from -ContractBase.init +[ContractBase](ContractBase.md).[init](ContractBase.md#init) #### Defined in -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) --- ### instanceFromDDO -▸ `Optional` `Abstract` **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`Params`\>\> +▸ `Optional` `Abstract` **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`, `serviceIndex?`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`Params`\>\> #### Parameters @@ -889,14 +813,15 @@ ContractBase.init | `ddo` | [`DDO`](DDO.md) | | `creator` | `string` | | `parameters` | `Params` | +| `serviceIndex?` | `number` | #### Returns -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`Params`\>\> +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`Params`\>\> #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:198](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L198) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:190](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L190) --- @@ -910,7 +835,7 @@ ContractBase.init #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) --- @@ -920,12 +845,12 @@ ContractBase.init #### Parameters -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns @@ -933,13 +858,13 @@ ContractBase.init #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) --- ### params -▸ `Abstract` **params**(...`args`): `Params` +▸ `Abstract` **params**(`...args`): `Params` #### Parameters @@ -953,27 +878,27 @@ ContractBase.init #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L79) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:72](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L72) --- ### paymentData -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> #### Parameters -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | #### Returns -[`PaymentData`](../interfaces/templates.PaymentData.md) +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) --- @@ -995,75 +920,75 @@ Prints the agreement status. #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) --- ### send -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Inherited from -ContractBase.send +[ContractBase](ContractBase.md).[send](ContractBase.md#send) #### Defined in -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) --- ### sendFrom -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Inherited from -ContractBase.sendFrom +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) #### Defined in -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) --- ### service -▸ `Abstract` **service**(): `ServiceType` +▸ `Abstract` **service**(): [`ServiceType`](../code-reference.md#servicetype) #### Returns -`ServiceType` +[`ServiceType`](../code-reference.md#servicetype) #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:205](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L205) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:198](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L198) --- @@ -1073,9 +998,9 @@ ContractBase.sendFrom #### Parameters -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -1083,83 +1008,33 @@ ContractBase.sendFrom #### Inherited from -ContractBase.setInstanceConfig +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) #### Defined in -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) --- ### standardContext -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) #### Parameters -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | #### Returns -`Promise`<`string`[]\> - -#### Inherited from - -ContractBase.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -ContractBase.findSignerStatic +[`ConditionContext`](../interfaces/ConditionContext.md) #### Defined in -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) --- @@ -1175,12 +1050,12 @@ ContractBase.findSignerStatic #### Parameters -| Name | Type | Default value | -| :--------------------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `templateContractName` | `string` | `undefined` | -| `templateClass` | `any` | `undefined` | -| `optional` | `boolean` | `false` | +| Name | Type | Default value | +| :--------------------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `templateContractName` | `string` | `undefined` | +| `templateClass` | `any` | `undefined` | +| `optional` | `boolean` | `false` | #### Returns @@ -1188,11 +1063,11 @@ ContractBase.findSignerStatic #### Overrides -ContractBase.getInstance +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) #### Defined in -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:62](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L62) +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L55) --- @@ -1202,16 +1077,16 @@ ContractBase.getInstance #### Type parameters -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | #### Parameters -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -1219,8 +1094,8 @@ ContractBase.getInstance #### Inherited from -ContractBase.setInstanceConfig +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) #### Defined in -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/AgreementsApi.md b/docs/api-reference/classes/AgreementsApi.md new file mode 100644 index 000000000..7a5cac352 --- /dev/null +++ b/docs/api-reference/classes/AgreementsApi.md @@ -0,0 +1,462 @@ +[@nevermined-io/sdk](../code-reference.md) / AgreementsApi + +# Class: AgreementsApi + +Nevermined Agreements API. It allows the integration with Nevermined Service Execution Agreements + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`AgreementsApi`** + +## Table of contents + +### Constructors + +- [constructor](AgreementsApi.md#constructor) + +### Properties + +- [conditions](AgreementsApi.md#conditions) + +### Accessors + +- [artifactsFolder](AgreementsApi.md#artifactsfolder) +- [circuitsFolder](AgreementsApi.md#circuitsfolder) +- [config](AgreementsApi.md#config) +- [instanceConfig](AgreementsApi.md#instanceconfig) +- [instantiableConfig](AgreementsApi.md#instantiableconfig) +- [logger](AgreementsApi.md#logger) +- [nevermined](AgreementsApi.md#nevermined) +- [web3](AgreementsApi.md#web3) + +### Methods + +- [create](AgreementsApi.md#create) +- [getAgreement](AgreementsApi.md#getagreement) +- [getAgreements](AgreementsApi.md#getagreements) +- [isAccessGranted](AgreementsApi.md#isaccessgranted) +- [prepareSignature](AgreementsApi.md#preparesignature) +- [setInstanceConfig](AgreementsApi.md#setinstanceconfig) +- [status](AgreementsApi.md#status) +- [getInstance](AgreementsApi.md#getinstance) +- [setInstanceConfig](AgreementsApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AgreementsApi**(`config`) + +Creates a new AgreementsApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L28) + +## Properties + +### conditions + +• **conditions**: `ConditionsApi` + +Agreements Conditions submodule. + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L21) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### create + +▸ **create**(`did`, `agreementIdSeed`, `serviceType`, `agreementParams`, `consumer`, `publisher`, `params?`): `Promise`<`string`\> + +Create a service agreement on-chain. This should be called by the publisher of the asset. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------------------------------------------------ | :----------------- | +| `did` | `string` | Decentralized ID. | +| `agreementIdSeed` | `string` | - | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `agreementParams` | `any` | - | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `publisher` | [`Account`](Account.md) | Publisher account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +The service agreement id + +**`Remarks`** + +Consumer signature will be verified on-chain, but it is recommended to verify the signature +in this method before submitting on-chain. + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:87](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L87) + +--- + +### getAgreement + +▸ **getAgreement**(`agreementId`): `Promise`<[`AgreementData`](../interfaces/AgreementData.md)\> + +It returns the details of one agreement + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :---------------------- | +| `agreementId` | `string` | The unique agreement id | + +#### Returns + +`Promise`<[`AgreementData`](../interfaces/AgreementData.md)\> + +the details of the agreement + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:148](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L148) + +--- + +### getAgreements + +▸ **getAgreements**(`did`): `Promise`<[`AgreementData`](../interfaces/AgreementData.md)[]\> + +Gets the list of agreements created about an asset + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :--------------------------------- | +| `did` | `string` | the unique identifier of the asset | + +#### Returns + +`Promise`<[`AgreementData`](../interfaces/AgreementData.md)[]\> + +the list of agreements + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:157](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L157) + +--- + +### isAccessGranted + +▸ **isAccessGranted**(`agreementId`, `did`, `consumerAddress`, `account`): `Promise`<`boolean`\> + +Checks if a consumer has permissions for a certain DID and Agreement Id + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------- | :--------------------------------- | +| `agreementId` | `string` | the agreement id | +| `did` | `string` | the unique identifier of the asset | +| `consumerAddress` | `string` | the address of the consumer | +| `account` | [`Account`](Account.md) | the user account | + +#### Returns + +`Promise`<`boolean`\> + +true if the user has permissions + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:169](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L169) + +--- + +### prepareSignature + +▸ **prepareSignature**(`did`, `serviceType`, `consumer`): `Promise`<[`AgreementPrepareResult`](../interfaces/AgreementPrepareResult.md)\> + +Creates a consumer signature for the specified asset service. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | + +#### Returns + +`Promise`<[`AgreementPrepareResult`](../interfaces/AgreementPrepareResult.md)\> + +The agreement ID and signature. + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L45) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### status + +▸ **status**(`agreementId`, `extended?`): `Promise`<`any`\> + +Get the status of a service agreement. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------ | :-------- | :------------ | :------------------------------------------- | +| `agreementId` | `string` | `undefined` | Service agreement ID. | +| `extended` | `boolean` | `false` | Returns a complete status with dependencies. | + +#### Returns + +`Promise`<`any`\> + +status of the agreement + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:122](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L122) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ApiError.md b/docs/api-reference/classes/ApiError.md new file mode 100644 index 000000000..292680753 --- /dev/null +++ b/docs/api-reference/classes/ApiError.md @@ -0,0 +1,165 @@ +[@nevermined-io/sdk](../code-reference.md) / ApiError + +# Class: ApiError + +## Hierarchy + +- `Error` + + ↳ **`ApiError`** + +## Table of contents + +### Constructors + +- [constructor](ApiError.md#constructor) + +### Properties + +- [message](ApiError.md#message) +- [name](ApiError.md#name) +- [stack](ApiError.md#stack) +- [prepareStackTrace](ApiError.md#preparestacktrace) +- [stackTraceLimit](ApiError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](ApiError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new ApiError**(`message`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/ApiError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/ApiError.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/AssetAttributes.md b/docs/api-reference/classes/AssetAttributes.md new file mode 100644 index 000000000..f178f2c16 --- /dev/null +++ b/docs/api-reference/classes/AssetAttributes.md @@ -0,0 +1,218 @@ +[@nevermined-io/sdk](../code-reference.md) / AssetAttributes + +# Class: AssetAttributes + +## Hierarchy + +- **`AssetAttributes`** + + ↳ [`NFTAttributes`](NFTAttributes.md) + +## Table of contents + +### Constructors + +- [constructor](AssetAttributes.md#constructor) + +### Properties + +- [appId](AssetAttributes.md#appid) +- [encryptionMethod](AssetAttributes.md#encryptionmethod) +- [fulfillAccessTimelock](AssetAttributes.md#fulfillaccesstimelock) +- [fulfillAccessTimeout](AssetAttributes.md#fulfillaccesstimeout) +- [metadata](AssetAttributes.md#metadata) +- [predefinedAssetServices](AssetAttributes.md#predefinedassetservices) +- [providers](AssetAttributes.md#providers) +- [services](AssetAttributes.md#services) +- [DEFAULT_ENCRYPTION_METHOD](AssetAttributes.md#default_encryption_method) +- [defaultValues](AssetAttributes.md#defaultvalues) + +### Methods + +- [getInstance](AssetAttributes.md#getinstance) + +## Constructors + +### constructor + +• **new AssetAttributes**() + +## Properties + +### appId + +• `Optional` **appId**: `string` + +Unique identifier of the application/domain/vertical where the asset belong to. +That asset association typically helps to search and filter between assets part of a domain via Marketplace API + +#### Defined in + +[src/models/AssetAttributes.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L47) + +--- + +### encryptionMethod + +• `Optional` **encryptionMethod**: [`EncryptionMethod`](../code-reference.md#encryptionmethod) + +When an asset is published in a Nevermined network, some internal Metadata attributes are encrypted so they can't be accessed. +This method allows to specify the encryption method to be used. + +**`See`** + +[EncryptionMethod](../code-reference.md#encryptionmethod) + +#### Defined in + +[src/models/AssetAttributes.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L20) + +--- + +### fulfillAccessTimelock + +• `Optional` **fulfillAccessTimelock**: `number` + +An asset can offer different services. Each service can have different conditions that need to be fulfilled +to provide that service. These conditions can expire if they are not fulfilled in a certain period of time. +This attribute allows to specify a period of time the condition can not be fullfilled +Setting up a timelock of 0 means that the condition can be fulfilled at any time. +Setting a timelock greater than 0 means that the condition can not be fulfilled until that number of blocks after the agreement is created are mined. +This would allow to create an agreement that can not fulfilled until certain period of time. + +#### Defined in + +[src/models/AssetAttributes.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L67) + +--- + +### fulfillAccessTimeout + +• `Optional` **fulfillAccessTimeout**: `number` + +An asset can offer different services. Each service can have different conditions that need to be fulfilled +to provide that service. These conditions can expire if they are not fulfilled in a certain period of time. +This attribute allows to specify the timeouts for the access condition associated to the service. +Setting up a timeout of 0 means that the condition will never expire. +Setting a timeout greater than 0 means that the condition will expire after that number of blocks after the agreement is created. +This would allow to create an agreement that is not fulfilled after a certain period of time, the user can claim back funds locked if the condition is any. + +#### Defined in + +[src/models/AssetAttributes.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L57) + +--- + +### metadata + +• **metadata**: [`MetaData`](../interfaces/MetaData.md) + +Metadata describing the asset + +**`See`** + +[MetaData](../interfaces/MetaData.md) + +#### Defined in + +[src/models/AssetAttributes.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L13) + +--- + +### predefinedAssetServices + +• `Optional` **predefinedAssetServices**: [`ServiceCommon`](../interfaces/ServiceCommon.md)[] + +List of additional asset services to be included as part of an asset + +**`See`** + +[Service](../code-reference.md#service) + +#### Defined in + +[src/models/AssetAttributes.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L32) + +--- + +### providers + +• `Optional` **providers**: `string`[] + +A provider of an asset identify the public address of an account with some privileges over that asset. +Typically these permissions are granted to Nevermined Nodes to allow them to give access to some services without +the direct interaction of the final user. +Here a user publishing an asset can define a list of all the addresses with these permissions. +Typically just the address of one Nevermined Node trusted by the user. + +#### Defined in + +[src/models/AssetAttributes.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L41) + +--- + +### services + +• `Optional` **services**: [`ServiceAttributes`](../interfaces/ServiceAttributes.md)[] + +List of services and their attributes offered by an asset. + +**`See`** + +[ServiceAttributes](../interfaces/ServiceAttributes.md) + +#### Defined in + +[src/models/AssetAttributes.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L26) + +--- + +### DEFAULT_ENCRYPTION_METHOD + +▪ `Static` **DEFAULT_ENCRYPTION_METHOD**: [`EncryptionMethod`](../code-reference.md#encryptionmethod) + +#### Defined in + +[src/models/AssetAttributes.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L7) + +--- + +### defaultValues + +▪ `Static` **defaultValues**: `Object` + +#### Type declaration + +| Name | Type | +| :------------------------ | :-------------------------------------------------------------------------------------------------------------- | +| `appId` | `string` | +| `encryptionMethod` | [`EncryptionMethod`](../code-reference.md#encryptionmethod) | +| `fulfillAccessTimelock` | `number` | +| `fulfillAccessTimeout` | `number` | +| `predefinedAssetServices` | [`ServiceCommon`](../interfaces/ServiceCommon.md)[] | +| `providers` | `any`[] | +| `services` | { `price`: [`AssetPrice`](AssetPrice.md) ; `serviceType`: [`ServiceType`](../code-reference.md#servicetype) }[] | + +#### Defined in + +[src/models/AssetAttributes.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L69) + +## Methods + +### getInstance + +▸ `Static` **getInstance**(`assetAttributes`): `Required`<[`AssetAttributes`](AssetAttributes.md)\> + +#### Parameters + +| Name | Type | +| :---------------- | :-------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | + +#### Returns + +`Required`<[`AssetAttributes`](AssetAttributes.md)\> + +#### Defined in + +[src/models/AssetAttributes.ts:84](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L84) diff --git a/docs/api-reference/classes/AssetError.md b/docs/api-reference/classes/AssetError.md new file mode 100644 index 000000000..8e3642d68 --- /dev/null +++ b/docs/api-reference/classes/AssetError.md @@ -0,0 +1,165 @@ +[@nevermined-io/sdk](../code-reference.md) / AssetError + +# Class: AssetError + +## Hierarchy + +- `Error` + + ↳ **`AssetError`** + +## Table of contents + +### Constructors + +- [constructor](AssetError.md#constructor) + +### Properties + +- [message](AssetError.md#message) +- [name](AssetError.md#name) +- [stack](AssetError.md#stack) +- [prepareStackTrace](AssetError.md#preparestacktrace) +- [stackTraceLimit](AssetError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](AssetError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new AssetError**(`message`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/AssetError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/AssetError.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/AssetPrice.md b/docs/api-reference/classes/AssetPrice.md new file mode 100644 index 000000000..57fd7d073 --- /dev/null +++ b/docs/api-reference/classes/AssetPrice.md @@ -0,0 +1,352 @@ +[@nevermined-io/sdk](../code-reference.md) / AssetPrice + +# Class: AssetPrice + +## Table of contents + +### Constructors + +- [constructor](AssetPrice.md#constructor) + +### Properties + +- [rewards](AssetPrice.md#rewards) +- [tokenAddress](AssetPrice.md#tokenaddress) +- [totalPrice](AssetPrice.md#totalprice) +- [NETWORK_FEE_DENOMINATOR](AssetPrice.md#network_fee_denominator) + +### Methods + +- [addNetworkFees](AssetPrice.md#addnetworkfees) +- [adjustToIncludeNetworkFees](AssetPrice.md#adjusttoincludenetworkfees) +- [getAmounts](AssetPrice.md#getamounts) +- [getAmountsString](AssetPrice.md#getamountsstring) +- [getReceivers](AssetPrice.md#getreceivers) +- [getReceiversString](AssetPrice.md#getreceiversstring) +- [getRewards](AssetPrice.md#getrewards) +- [getTokenAddress](AssetPrice.md#gettokenaddress) +- [getTotalPrice](AssetPrice.md#gettotalprice) +- [setReceiver](AssetPrice.md#setreceiver) +- [setTokenAddress](AssetPrice.md#settokenaddress) +- [toString](AssetPrice.md#tostring) +- [sumAmounts](AssetPrice.md#sumamounts) + +## Constructors + +### constructor + +• **new AssetPrice**() + +#### Defined in + +[src/models/AssetPrice.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L10) + +• **new AssetPrice**(`_rewards`) + +#### Parameters + +| Name | Type | +| :--------- | :------------------------- | +| `_rewards` | `Map`<`string`, `bigint`\> | + +#### Defined in + +[src/models/AssetPrice.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L11) + +• **new AssetPrice**(`address`, `amount`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | +| `amount` | `bigint` | + +#### Defined in + +[src/models/AssetPrice.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L12) + +• **new AssetPrice**(`address`, `amount`, `tokenAddress`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `address` | `string` | +| `amount` | `bigint` | +| `tokenAddress` | `string` | + +#### Defined in + +[src/models/AssetPrice.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L13) + +## Properties + +### rewards + +• `Private` **rewards**: `Map`<`string`, `bigint`\> + +#### Defined in + +[src/models/AssetPrice.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L6) + +--- + +### tokenAddress + +• `Private` `Optional` **tokenAddress**: `string` + +#### Defined in + +[src/models/AssetPrice.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L8) + +--- + +### totalPrice + +• `Private` **totalPrice**: `bigint` + +#### Defined in + +[src/models/AssetPrice.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L4) + +--- + +### NETWORK_FEE_DENOMINATOR + +▪ `Static` `Readonly` **NETWORK_FEE_DENOMINATOR**: `10000n` + +#### Defined in + +[src/models/AssetPrice.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L2) + +## Methods + +### addNetworkFees + +▸ **addNetworkFees**(`feeReceiver`, `networkFeePercent`): [`AssetPrice`](AssetPrice.md) + +It adds network fees on top of the already configured asset rewards + +#### Parameters + +| Name | Type | Description | +| :------------------ | :------- | :--------------------------------------------------------------- | +| `feeReceiver` | `string` | the address receiving the fees | +| `networkFeePercent` | `bigint` | the percent of fees to receive, it uses the contract denominator | + +#### Returns + +[`AssetPrice`](AssetPrice.md) + +the asset rewards object + +**`See`** + +AssetPrice.NETWORK_FEE_DENOMINATOR + +#### Defined in + +[src/models/AssetPrice.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L75) + +--- + +### adjustToIncludeNetworkFees + +▸ **adjustToIncludeNetworkFees**(`feeReceiver`, `networkFeePercent`): [`AssetPrice`](AssetPrice.md) + +It includes network fees on the existing asset rewards subtracting the proportion taking into account the receivers percent + +#### Parameters + +| Name | Type | Description | +| :------------------ | :------- | :--------------------------------------------------------------- | +| `feeReceiver` | `string` | the address receiving the fees | +| `networkFeePercent` | `bigint` | the percent of fees to receive, it uses the contract denominator | + +#### Returns + +[`AssetPrice`](AssetPrice.md) + +the asset rewards object + +**`See`** + +AssetPrice.NETWORK_FEE_DENOMINATOR + +#### Defined in + +[src/models/AssetPrice.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L88) + +--- + +### getAmounts + +▸ **getAmounts**(): `bigint`[] + +#### Returns + +`bigint`[] + +#### Defined in + +[src/models/AssetPrice.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L46) + +--- + +### getAmountsString + +▸ **getAmountsString**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/models/AssetPrice.ts:103](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L103) + +--- + +### getReceivers + +▸ **getReceivers**(): `string`[] + +#### Returns + +`string`[] + +#### Defined in + +[src/models/AssetPrice.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L50) + +--- + +### getReceiversString + +▸ **getReceiversString**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/models/AssetPrice.ts:109](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L109) + +--- + +### getRewards + +▸ **getRewards**(): `Map`<`string`, `bigint`\> + +#### Returns + +`Map`<`string`, `bigint`\> + +#### Defined in + +[src/models/AssetPrice.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L42) + +--- + +### getTokenAddress + +▸ **getTokenAddress**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/models/AssetPrice.ts:65](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L65) + +--- + +### getTotalPrice + +▸ **getTotalPrice**(): `bigint` + +#### Returns + +`bigint` + +#### Defined in + +[src/models/AssetPrice.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L38) + +--- + +### setReceiver + +▸ **setReceiver**(`receiver`, `amount`): [`AssetPrice`](AssetPrice.md) + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `receiver` | `string` | +| `amount` | `bigint` | + +#### Returns + +[`AssetPrice`](AssetPrice.md) + +#### Defined in + +[src/models/AssetPrice.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L54) + +--- + +### setTokenAddress + +▸ **setTokenAddress**(`address`): [`AssetPrice`](AssetPrice.md) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +[`AssetPrice`](AssetPrice.md) + +#### Defined in + +[src/models/AssetPrice.ts:60](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L60) + +--- + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/models/AssetPrice.ts:114](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L114) + +--- + +### sumAmounts + +▸ `Static` **sumAmounts**(`amounts`): `bigint` + +#### Parameters + +| Name | Type | +| :-------- | :--------- | +| `amounts` | `bigint`[] | + +#### Returns + +`bigint` + +#### Defined in + +[src/models/AssetPrice.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetPrice.ts#L34) diff --git a/docs/api-reference/classes/AssetPublicationOptions.md b/docs/api-reference/classes/AssetPublicationOptions.md new file mode 100644 index 000000000..7b56ce7d1 --- /dev/null +++ b/docs/api-reference/classes/AssetPublicationOptions.md @@ -0,0 +1,40 @@ +[@nevermined-io/sdk](../code-reference.md) / AssetPublicationOptions + +# Class: AssetPublicationOptions + +## Table of contents + +### Constructors + +- [constructor](AssetPublicationOptions.md#constructor) + +### Properties + +- [did](AssetPublicationOptions.md#did) +- [metadata](AssetPublicationOptions.md#metadata) + +## Constructors + +### constructor + +• **new AssetPublicationOptions**() + +## Properties + +### did + +• `Optional` **did**: [`PublishOnChainOptions`](../enums/PublishOnChainOptions.md) = `PublishOnChainOptions.DIDRegistry` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L38) + +--- + +### metadata + +• `Optional` **metadata**: [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) = `PublishMetadataOptions.OnlyMetadataAPI` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L37) diff --git a/docs/api-reference/classes/AssetsApi.md b/docs/api-reference/classes/AssetsApi.md new file mode 100644 index 000000000..f5399a2c3 --- /dev/null +++ b/docs/api-reference/classes/AssetsApi.md @@ -0,0 +1,1019 @@ +[@nevermined-io/sdk](../code-reference.md) / AssetsApi + +# Class: AssetsApi + +Nevermined Assets API. It allows the registration and management of digital assets in a +Nevermined digital ecosystem. +You can find more information about you can do in a Nevermined information here: +[https://docs.nevermined.io/docs/architecture/what-can-i-do](https://docs.nevermined.io/docs/architecture/what-can-i-do) + +## Hierarchy + +- [`RegistryBaseApi`](RegistryBaseApi.md) + + ↳ **`AssetsApi`** + +## Table of contents + +### Constructors + +- [constructor](AssetsApi.md#constructor) + +### Properties + +- [providers](AssetsApi.md#providers) +- [servicePlugin](AssetsApi.md#serviceplugin) + +### Accessors + +- [artifactsFolder](AssetsApi.md#artifactsfolder) +- [circuitsFolder](AssetsApi.md#circuitsfolder) +- [config](AssetsApi.md#config) +- [instanceConfig](AssetsApi.md#instanceconfig) +- [instantiableConfig](AssetsApi.md#instantiableconfig) +- [logger](AssetsApi.md#logger) +- [nevermined](AssetsApi.md#nevermined) +- [web3](AssetsApi.md#web3) + +### Methods + +- [access](AssetsApi.md#access) +- [addRating](AssetsApi.md#addrating) +- [consumerAssets](AssetsApi.md#consumerassets) +- [create](AssetsApi.md#create) +- [download](AssetsApi.md#download) +- [getNftContractAddress](AssetsApi.md#getnftcontractaddress) +- [getPermissions](AssetsApi.md#getpermissions) +- [grantPermissions](AssetsApi.md#grantpermissions) +- [list](AssetsApi.md#list) +- [order](AssetsApi.md#order) +- [orderAsset](AssetsApi.md#orderasset) +- [owner](AssetsApi.md#owner) +- [ownerAssets](AssetsApi.md#ownerassets) +- [ownerSignature](AssetsApi.md#ownersignature) +- [registerNeverminedAsset](AssetsApi.md#registerneverminedasset) +- [resolve](AssetsApi.md#resolve) +- [resolveAsset](AssetsApi.md#resolveasset) +- [retire](AssetsApi.md#retire) +- [revokePermissions](AssetsApi.md#revokepermissions) +- [setInstanceConfig](AssetsApi.md#setinstanceconfig) +- [transferOwnership](AssetsApi.md#transferownership) +- [update](AssetsApi.md#update) +- [updateAsset](AssetsApi.md#updateasset) +- [getInstance](AssetsApi.md#getinstance) +- [getServicePlugin](AssetsApi.md#getserviceplugin) +- [setInstanceConfig](AssetsApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new AssetsApi**(`config`) + +Creates a new AssetsApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[RegistryBaseApi](RegistryBaseApi.md).[constructor](RegistryBaseApi.md#constructor) + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:121](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L121) + +## Properties + +### providers + +• **providers**: [`Providers`](Providers.md) + +Utilities about the providers associated to an asset + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:114](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L114) + +--- + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[servicePlugin](RegistryBaseApi.md#serviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RegistryBaseApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RegistryBaseApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +RegistryBaseApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RegistryBaseApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RegistryBaseApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +RegistryBaseApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +RegistryBaseApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +RegistryBaseApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### access + +▸ **access**(`agreementId`, `did`, `serviceReference`, `consumerAccount`, `resultPath?`, `fileIndex?`, `buyer?`, `babysig?`): `Promise`<`string` \| `true`\> + +Having previously ordered an "access" service (referenced via an "agreementId"). +This method allows to download the assets associated to that service. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The unique identifier of the order placed for a service | +| `did` | `string` | `undefined` | Unique identifier of the asset ordered | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `undefined` | The service to download. By default is the access service, but it can be specified the service.index to refer a different specific service | +| `consumerAccount` | [`Account`](Account.md) | `undefined` | The account of the user who ordered the asset and is downloading the files | +| `resultPath?` | `string` | `undefined` | Where the files will be downloaded | +| `fileIndex` | `number` | `-1` | The file to download. If not given or is -1 it will download all of them. | +| `buyer?` | `string` | `undefined` | Key which represent the buyer | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | An elliptic curve signature | + +#### Returns + +`Promise`<`string` \| `true`\> + +The result path or true if everything went okay + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L235) + +--- + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[addRating](RegistryBaseApi.md#addrating) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### consumerAssets + +▸ **consumerAssets**(`consumerAccount`): `Promise`<`string`[]\> + +Returns the assets of a consumer. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------- | :---------------- | +| `consumerAccount` | `string` | Consumer address. | + +#### Returns + +`Promise`<`string`[]\> + +List of DIDs. + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:352](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L352) + +--- + +### create + +▸ **create**(`assetAttributes`, `publisherAccount`, `publicationOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +Registers a new asset in Nevermined. +You can find more information about how different data is stored in Nevermined here: +[https://docs.nevermined.io/docs/architecture/nevermined-data](https://docs.nevermined.io/docs/architecture/nevermined-data) + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisherAccount` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +[DDO](DDO.md) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L154) + +--- + +### download + +▸ **download**(`did`, `ownerAccount`, `resultPath?`, `fileIndex?`, `serviceType?`, `buyer?`, `babysig?`): `Promise`<`string`\> + +It allows to download of the files attached to the asset by their owner or provider. +This method only can be called successfully by the owner of the asset or a provider. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------- | :------------------------------------------------ | :------------ | :----------------------------------------- | +| `did` | `string` | `undefined` | The Decentralized Identifier of the asset. | +| `ownerAccount` | [`Account`](Account.md) | `undefined` | The receiver account owner | +| `resultPath?` | `string` | `undefined` | Path to be the files downloader | +| `fileIndex` | `number` | `-1` | The index of the file | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | `'access'` | Service type. 'access' by default | +| `buyer?` | `string` | `undefined` | Key which represent the buyer | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | An elliptic curve signature | + +#### Returns + +`Promise`<`string`\> + +Status, path destination if resultPath is provided + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:377](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L377) + +--- + +### getNftContractAddress + +▸ **getNftContractAddress**(`ddo`, `serviceType?`): `string` + +Get the NFT contract address associated with a Nevermined asset. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------ | :------------------------------------------------ | :------------- | :------------------------------------------------------- | +| `ddo` | [`DDO`](DDO.md) | `undefined` | The DDO of the asset. | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service type to use to get the NFT contract address. | + +#### Returns + +`string` + +The NFT contract address. + +**`Example`** + +```ts +nevermined.assets.getNftContractAddress(ddo) +``` + +**`Throws`** + +DDOError - If the NFT contract address is not found in the DDO. + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:490](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L490) + +--- + +### getPermissions + +▸ **getPermissions**(`did`, `address`): `Promise`<`boolean`\> + +Checks if an account with a specific address has permissions to a specific asset represented by a DID + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :---------------------------------------------------------- | +| `did` | `string` | The unique identifier of the asset to check the permissions | +| `address` | `string` | The address of the account to check the permissions | + +#### Returns + +`Promise`<`boolean`\> + +True if the address has permissions on the asset + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:472](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L472) + +--- + +### grantPermissions + +▸ **grantPermissions**(`did`, `address`, `ownerAccount`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It grants permissions to an account for a specific asset represented by a DID. +Only can be called by the asset owner. + +#### Parameters + +| Name | Type | Description | +| :------------- | :---------------------------------------------- | :------------------------------------------------------------- | +| `did` | `string` | The unique identifier of the assert | +| `address` | `string` | The account to grant the permissions | +| `ownerAccount` | [`Account`](Account.md) | Account sending the request. It must be the owner of the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:430](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L430) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[list](RegistryBaseApi.md#list) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### order + +▸ **order**(`did`, `serviceReference?`, `consumerAccount`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an access service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). +If the access service to purchase is having associated some price, it will make the payment +for that service. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Unique identifier of the asset to order | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'access'` | The service to order. By default is the access service, but it can be specified the service.index to refer a different specific service | +| `consumerAccount` | [`Account`](Account.md) | `undefined` | The account of the user ordering the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID identifying the order + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L213) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[orderAsset](RegistryBaseApi.md#orderasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### owner + +▸ **owner**(`did`): `Promise`<`string`\> + +Returns the owner of an asset. + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :---------------- | +| `did` | `string` | Decentralized ID. | + +#### Returns + +`Promise`<`string`\> + +The address of the owner of the asset + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:290](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L290) + +--- + +### ownerAssets + +▸ **ownerAssets**(`owner`): `Promise`<`string`[]\> + +Returns the assets owned by an address + +#### Parameters + +| Name | Type | Description | +| :------ | :------- | :------------------- | +| `owner` | `string` | The address to check | + +#### Returns + +`Promise`<`string`[]\> + +List of DIDs owned by the address + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:319](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L319) + +--- + +### ownerSignature + +▸ **ownerSignature**(`did`): `Promise`<`string`\> + +Returns the owner of an asset. + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :---------------- | +| `did` | `string` | Decentralized ID. | + +#### Returns + +`Promise`<`string`\> + +The address of the owner of the asset + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:299](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L299) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[registerNeverminedAsset](RegistryBaseApi.md#registerneverminedasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### resolve + +▸ **resolve**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.NoRegistry` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:134](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L134) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[resolveAsset](RegistryBaseApi.md#resolveasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### retire + +▸ **retire**(`did`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:360](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L360) + +--- + +### revokePermissions + +▸ **revokePermissions**(`did`, `address`, `ownerAccount`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It revokes permissions to an account for a specific asset represented by a DID. +Only can be called by the asset owner. + +#### Parameters + +| Name | Type | Description | +| :------------- | :---------------------------------------------- | :------------------------------------------------------------- | +| `did` | `string` | The unique identifier of the assert | +| `address` | `string` | The account to revoke the permissions | +| `ownerAccount` | [`Account`](Account.md) | Account sending the request. It must be the owner of the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:452](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L452) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[setInstanceConfig](RegistryBaseApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transferOwnership + +▸ **transferOwnership**(`did`, `newOwner`, `owner`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Transfer ownership of an asset. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------------------- | +| `did` | `string` | Asset DID. | +| `newOwner` | `string` | Ethereum address of the new owner of the DID. | +| `owner` | `string` \| [`Account`](Account.md) | Account owning the DID and doing the transfer of ownership | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Returns ethers transaction receipt. + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:331](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L331) + +--- + +### update + +▸ **update**(`did`, `metadata`, `publisherAccount`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisherAccount` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +**`Example`** + +```ts +const ddoUpdated = await nevermined.assets.update( + ddo.shortId(), + updatedMetadata, + publisher, + PublishMetadata.IPFS, +) +``` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:192](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L192) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[updateAsset](RegistryBaseApi.md#updateasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[getInstance](RegistryBaseApi.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[getServicePlugin](RegistryBaseApi.md#getserviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[setInstanceConfig](RegistryBaseApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/KeyTransfer.BabyjubPublicKey.md b/docs/api-reference/classes/BabyjubPublicKey.md similarity index 57% rename from docs/api-reference/classes/KeyTransfer.BabyjubPublicKey.md rename to docs/api-reference/classes/BabyjubPublicKey.md index eb6d69c5c..b68bad051 100644 --- a/docs/api-reference/classes/KeyTransfer.BabyjubPublicKey.md +++ b/docs/api-reference/classes/BabyjubPublicKey.md @@ -1,23 +1,21 @@ -[@nevermined-io/sdk](../code-reference.md) / [KeyTransfer](../modules/KeyTransfer.md) / BabyjubPublicKey +[@nevermined-io/sdk](../code-reference.md) / BabyjubPublicKey # Class: BabyjubPublicKey -[KeyTransfer](../modules/KeyTransfer.md).BabyjubPublicKey - ## Table of contents ### Constructors -- [constructor](KeyTransfer.BabyjubPublicKey.md#constructor) +- [constructor](BabyjubPublicKey.md#constructor) ### Properties -- [x](KeyTransfer.BabyjubPublicKey.md#x) -- [y](KeyTransfer.BabyjubPublicKey.md#y) +- [x](BabyjubPublicKey.md#x) +- [y](BabyjubPublicKey.md#y) ### Methods -- [param](KeyTransfer.BabyjubPublicKey.md#param) +- [param](BabyjubPublicKey.md#param) ## Constructors @@ -34,7 +32,7 @@ #### Defined in -[src/models/KeyTransfer.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L8) +[src/models/KeyTransfer.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L8) ## Properties @@ -44,7 +42,7 @@ #### Defined in -[src/models/KeyTransfer.ts:5](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L5) +[src/models/KeyTransfer.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L5) --- @@ -54,7 +52,7 @@ #### Defined in -[src/models/KeyTransfer.ts:6](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L6) +[src/models/KeyTransfer.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L6) ## Methods @@ -68,4 +66,4 @@ #### Defined in -[src/models/KeyTransfer.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L13) +[src/models/KeyTransfer.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L13) diff --git a/docs/api-reference/classes/BaseTemplate.md b/docs/api-reference/classes/BaseTemplate.md new file mode 100644 index 000000000..6899d74a8 --- /dev/null +++ b/docs/api-reference/classes/BaseTemplate.md @@ -0,0 +1,1450 @@ +[@nevermined-io/sdk](../code-reference.md) / BaseTemplate + +# Class: BaseTemplate + +## Type parameters + +| Name | Type | +| :------- | :------------------------------------------------ | +| `Params` | `Params` | +| `S` | extends [`Service`](../code-reference.md#service) | + +## Hierarchy + +- [`AgreementTemplate`](AgreementTemplate.md)<`Params`\> + + ↳ **`BaseTemplate`** + + ↳↳ [`AaveCreditTemplate`](AaveCreditTemplate.md) + + ↳↳ [`AccessTemplate`](AccessTemplate.md) + + ↳↳ [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) + + ↳↳ [`DIDSalesTemplate`](DIDSalesTemplate.md) + + ↳↳ [`NFTAccessTemplate`](NFTAccessTemplate.md) + + ↳↳ [`NFT721AccessTemplate`](NFT721AccessTemplate.md) + + ↳↳ [`NFTSalesTemplate`](NFTSalesTemplate.md) + + ↳↳ [`NFT721SalesTemplate`](NFT721SalesTemplate.md) + +## Implements + +- [`ServicePlugin`](../interfaces/ServicePlugin.md)<`S`\> + +## Table of contents + +### Constructors + +- [constructor](BaseTemplate.md#constructor) + +### Properties + +- [address](BaseTemplate.md#address) +- [contract](BaseTemplate.md#contract) +- [contractName](BaseTemplate.md#contractname) +- [events](BaseTemplate.md#events) +- [version](BaseTemplate.md#version) + +### Accessors + +- [artifactsFolder](BaseTemplate.md#artifactsfolder) +- [circuitsFolder](BaseTemplate.md#circuitsfolder) +- [config](BaseTemplate.md#config) +- [instanceConfig](BaseTemplate.md#instanceconfig) +- [instantiableConfig](BaseTemplate.md#instantiableconfig) +- [logger](BaseTemplate.md#logger) +- [nevermined](BaseTemplate.md#nevermined) +- [web3](BaseTemplate.md#web3) + +### Methods + +- [accept](BaseTemplate.md#accept) +- [agreementId](BaseTemplate.md#agreementid) +- [call](BaseTemplate.md#call) +- [conditions](BaseTemplate.md#conditions) +- [createAgreement](BaseTemplate.md#createagreement) +- [createAgreementAndPay](BaseTemplate.md#createagreementandpay) +- [createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) +- [createService](BaseTemplate.md#createservice) +- [description](BaseTemplate.md#description) +- [extraGen](BaseTemplate.md#extragen) +- [getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) +- [getAgreementData](BaseTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](BaseTemplate.md#getagreementstatus) +- [getAgreementsForDID](BaseTemplate.md#getagreementsfordid) +- [getConditionTypes](BaseTemplate.md#getconditiontypes) +- [getConditions](BaseTemplate.md#getconditions) +- [getFromAddress](BaseTemplate.md#getfromaddress) +- [getInputsOfMethod](BaseTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) +- [init](BaseTemplate.md#init) +- [instanceFromDDO](BaseTemplate.md#instancefromddo) +- [lockConditionIndex](BaseTemplate.md#lockconditionindex) +- [lockTokens](BaseTemplate.md#locktokens) +- [name](BaseTemplate.md#name) +- [params](BaseTemplate.md#params) +- [paramsGen](BaseTemplate.md#paramsgen) +- [paymentData](BaseTemplate.md#paymentdata) +- [printAgreementStatus](BaseTemplate.md#printagreementstatus) +- [process](BaseTemplate.md#process) +- [send](BaseTemplate.md#send) +- [sendFrom](BaseTemplate.md#sendfrom) +- [service](BaseTemplate.md#service) +- [serviceEndpoint](BaseTemplate.md#serviceendpoint) +- [setInstanceConfig](BaseTemplate.md#setinstanceconfig) +- [standardContext](BaseTemplate.md#standardcontext) +- [track](BaseTemplate.md#track) +- [validateAgreement](BaseTemplate.md#validateagreement) +- [getInstance](BaseTemplate.md#getinstance) +- [setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new BaseTemplate**<`Params`, `S`\>(`contractName`) + +#### Type parameters + +| Name | Type | +| :------- | :-------------------------------------------------------- | +| `Params` | `Params` | +| `S` | extends [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[constructor](AgreementTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[address](AgreementTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[contract](AgreementTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[contractName](AgreementTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[events](AgreementTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[version](AgreementTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +AgreementTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +AgreementTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +AgreementTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +AgreementTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +AgreementTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +AgreementTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +AgreementTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +AgreementTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`_params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[accept](../interfaces/ServicePlugin.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L98) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[agreementId](AgreementTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[call](AgreementTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ `Abstract` **conditions**(): [`Condition`](Condition.md)<`any`, `any`\>[] + +#### Returns + +[`Condition`](Condition.md)<`any`, `any`\>[] + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L29) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[createAgreement](AgreementTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[createAgreementAndPay](AgreementTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `Params` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[createAgreementFromDDO](AgreementTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `Params` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[createAgreementWithPaymentFromDDO](AgreementTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): `S` + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +`S` + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[createService](../interfaces/ServicePlugin.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ `Abstract` **description**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L28) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getAgreementCreatedEvent](AgreementTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :-------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `Params` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getAgreementIdsFromDDO](AgreementTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getAgreementStatus](AgreementTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getAgreementsForDID](AgreementTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getConditionTypes](AgreementTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getConditions](AgreementTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getFromAddress](AgreementTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getInputsOfMethod](AgreementTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ `Abstract` **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplate](AgreementTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:322](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L322) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplateConditionByRef](AgreementTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplateConditions](AgreementTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplateDependencies](AgreementTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getSignatureOfMethod](AgreementTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[init](AgreementTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ `Optional` `Abstract` **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`, `serviceIndex?`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`Params`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :-------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `Params` | +| `serviceIndex?` | `number` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`Params`\>\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[instanceFromDDO](AgreementTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:190](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L190) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[lockConditionIndex](AgreementTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[lockTokens](AgreementTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ `Abstract` **name**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L27) + +--- + +### params + +▸ `Abstract` **params**(`...args`): `Params` + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Params` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[params](AgreementTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:72](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L72) + +--- + +### paramsGen + +▸ `Abstract` **paramsGen**(`params`): `Promise`<`Params`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------------------------ | :----------------- | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`Params`\> + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L92) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[paymentData](AgreementTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[printAgreementStatus](AgreementTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[process](../interfaces/ServicePlugin.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[send](AgreementTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[sendFrom](AgreementTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ `Abstract` **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[service](AgreementTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:198](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L198) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[setInstanceConfig](AgreementTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[standardContext](AgreementTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[track](../interfaces/ServicePlugin.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `Params` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**<`Params`\>(`config`, `templateContractName`, `templateClass`, `optional?`): `Promise`<`any`\> + +#### Type parameters + +| Name | +| :------- | +| `Params` | + +#### Parameters + +| Name | Type | Default value | +| :--------------------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `templateContractName` | `string` | `undefined` | +| `templateClass` | `any` | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[getInstance](AgreementTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L55) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[AgreementTemplate](AgreementTemplate.md).[setInstanceConfig](AgreementTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Bookmarks.md b/docs/api-reference/classes/Bookmarks.md new file mode 100644 index 000000000..a950ff443 --- /dev/null +++ b/docs/api-reference/classes/Bookmarks.md @@ -0,0 +1,461 @@ +[@nevermined-io/sdk](../code-reference.md) / Bookmarks + +# Class: Bookmarks + +## Hierarchy + +- [`MarketplaceApi`](MarketplaceApi.md) + + ↳ **`Bookmarks`** + +## Table of contents + +### Constructors + +- [constructor](Bookmarks.md#constructor) + +### Accessors + +- [artifactsFolder](Bookmarks.md#artifactsfolder) +- [circuitsFolder](Bookmarks.md#circuitsfolder) +- [config](Bookmarks.md#config) +- [instanceConfig](Bookmarks.md#instanceconfig) +- [instantiableConfig](Bookmarks.md#instantiableconfig) +- [logger](Bookmarks.md#logger) +- [nevermined](Bookmarks.md#nevermined) +- [url](Bookmarks.md#url) +- [web3](Bookmarks.md#web3) + +### Methods + +- [addNewAddress](Bookmarks.md#addnewaddress) +- [create](Bookmarks.md#create) +- [deleteOneById](Bookmarks.md#deleteonebyid) +- [findManyByUserId](Bookmarks.md#findmanybyuserid) +- [findOneById](Bookmarks.md#findonebyid) +- [login](Bookmarks.md#login) +- [setInstanceConfig](Bookmarks.md#setinstanceconfig) +- [updateOneById](Bookmarks.md#updateonebyid) +- [getInstance](Bookmarks.md#getinstance) +- [setInstanceConfig](Bookmarks.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Bookmarks**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[constructor](MarketplaceApi.md#constructor) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L7) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +MarketplaceApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +MarketplaceApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +MarketplaceApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### url + +• `Protected` `get` **url**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.url + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L12) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +MarketplaceApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addNewAddress + +▸ **addNewAddress**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[addNewAddress](MarketplaceApi.md#addnewaddress) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L36) + +--- + +### create + +▸ **create**(`newBookmark`): `Promise`<[`Bookmark`](../interfaces/Bookmark.md)\> + +Create bookmark + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------- | +| `newBookmark` | [`NewBookmark`](../interfaces/NewBookmark.md) | + +#### Returns + +`Promise`<[`Bookmark`](../interfaces/Bookmark.md)\> + +#### Defined in + +[src/services/metadata/Bookmarks.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Bookmarks.ts#L14) + +--- + +### deleteOneById + +▸ **deleteOneById**(`id`): `Promise`<`void`\> + +Delele a bookmark by id + +#### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/services/metadata/Bookmarks.ts:112](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Bookmarks.ts#L112) + +--- + +### findManyByUserId + +▸ **findManyByUserId**(`userId`, `query?`): `Promise`<[`MarketplaceResults`](../interfaces/MarketplaceResults.md)<[`Bookmark`](../interfaces/Bookmark.md)\>\> + +Get bookmarks by userId + +#### Parameters + +| Name | Type | +| :------- | :-------------------------------------------- | +| `userId` | `string` | +| `query?` | [`SearchQuery`](../interfaces/SearchQuery.md) | + +#### Returns + +`Promise`<[`MarketplaceResults`](../interfaces/MarketplaceResults.md)<[`Bookmark`](../interfaces/Bookmark.md)\>\> + +#### Defined in + +[src/services/metadata/Bookmarks.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Bookmarks.ts#L63) + +--- + +### findOneById + +▸ **findOneById**(`id`): `Promise`<[`Bookmark`](../interfaces/Bookmark.md)\> + +Get a bookmark by Id + +#### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +#### Returns + +`Promise`<[`Bookmark`](../interfaces/Bookmark.md)\> + +#### Defined in + +[src/services/metadata/Bookmarks.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Bookmarks.ts#L41) + +--- + +### login + +▸ **login**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[login](MarketplaceApi.md#login) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L16) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### updateOneById + +▸ **updateOneById**(`id`, `bookmark`): `Promise`<[`Bookmark`](../interfaces/Bookmark.md)\> + +Update a bookmark by id + +#### Parameters + +| Name | Type | +| :--------- | :-------------------------------------------------- | +| `id` | `string` | +| `bookmark` | `Partial`<[`Bookmark`](../interfaces/Bookmark.md)\> | + +#### Returns + +`Promise`<[`Bookmark`](../interfaces/Bookmark.md)\> + +#### Defined in + +[src/services/metadata/Bookmarks.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Bookmarks.ts#L88) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[getInstance](MarketplaceApi.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ClientError.md b/docs/api-reference/classes/ClientError.md index 8e4fe9dc2..0dc717783 100644 --- a/docs/api-reference/classes/ClientError.md +++ b/docs/api-reference/classes/ClientError.md @@ -45,7 +45,7 @@ Error.constructor #### Defined in -[src/errors/ClientError.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/errors/ClientError.ts#L2) +[src/errors/ClientError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/ClientError.ts#L2) ## Properties @@ -59,7 +59,7 @@ Error.message #### Defined in -node_modules/typescript/lib/lib.es5.d.ts:1041 +node_modules/typescript/lib/lib.es5.d.ts:1068 --- @@ -73,7 +73,7 @@ Error.name #### Defined in -node_modules/typescript/lib/lib.es5.d.ts:1040 +node_modules/typescript/lib/lib.es5.d.ts:1067 --- @@ -87,9 +87,7 @@ Error.stack #### Defined in -node_modules/typescript/lib/lib.es5.d.ts:1042 - -node_modules/@types/node/globals.d.ts:127 +node_modules/typescript/lib/lib.es5.d.ts:1069 --- @@ -103,10 +101,6 @@ node_modules/@types/node/globals.d.ts:127 Optional override for formatting stack traces -**`See`** - -https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces - ##### Parameters | Name | Type | @@ -118,13 +112,17 @@ https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces `any` +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + #### Inherited from Error.prepareStackTrace #### Defined in -node_modules/@types/node/globals.d.ts:140 +node_modules/@types/node/globals.d.ts:11 --- @@ -138,7 +136,7 @@ Error.stackTraceLimit #### Defined in -node_modules/@types/node/globals.d.ts:142 +node_modules/@types/node/globals.d.ts:13 ## Methods @@ -152,7 +150,7 @@ Create .stack property on a target object | Name | Type | | :---------------- | :--------- | -| `targetObject` | `Object` | +| `targetObject` | `object` | | `constructorOpt?` | `Function` | #### Returns @@ -165,4 +163,4 @@ Error.captureStackTrace #### Defined in -node_modules/@types/node/globals.d.ts:133 +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/ComputeApi.md b/docs/api-reference/classes/ComputeApi.md new file mode 100644 index 000000000..1d30a572c --- /dev/null +++ b/docs/api-reference/classes/ComputeApi.md @@ -0,0 +1,729 @@ +[@nevermined-io/sdk](../code-reference.md) / ComputeApi + +# Class: ComputeApi + +Nevermined Compute API. It allows the registration execution of compute jobs on top +of data registered in a Nevermined digital ecosystem. + +You can find more information about the Nevermined compute solution here: +[https://docs.nevermined.io/docs/getting-started/remote-computation](https://docs.nevermined.io/docs/getting-started/remote-computation) + +## Hierarchy + +- [`RegistryBaseApi`](RegistryBaseApi.md) + + ↳ **`ComputeApi`** + +## Table of contents + +### Constructors + +- [constructor](ComputeApi.md#constructor) + +### Properties + +- [servicePlugin](ComputeApi.md#serviceplugin) + +### Accessors + +- [artifactsFolder](ComputeApi.md#artifactsfolder) +- [circuitsFolder](ComputeApi.md#circuitsfolder) +- [config](ComputeApi.md#config) +- [instanceConfig](ComputeApi.md#instanceconfig) +- [instantiableConfig](ComputeApi.md#instantiableconfig) +- [logger](ComputeApi.md#logger) +- [nevermined](ComputeApi.md#nevermined) +- [web3](ComputeApi.md#web3) + +### Methods + +- [addRating](ComputeApi.md#addrating) +- [create](ComputeApi.md#create) +- [execute](ComputeApi.md#execute) +- [list](ComputeApi.md#list) +- [logs](ComputeApi.md#logs) +- [order](ComputeApi.md#order) +- [orderAsset](ComputeApi.md#orderasset) +- [registerNeverminedAsset](ComputeApi.md#registerneverminedasset) +- [resolveAsset](ComputeApi.md#resolveasset) +- [setInstanceConfig](ComputeApi.md#setinstanceconfig) +- [status](ComputeApi.md#status) +- [update](ComputeApi.md#update) +- [updateAsset](ComputeApi.md#updateasset) +- [getInstance](ComputeApi.md#getinstance) +- [getServicePlugin](ComputeApi.md#getserviceplugin) +- [setInstanceConfig](ComputeApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ComputeApi**(`config`) + +Creates a new ComputeApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[RegistryBaseApi](RegistryBaseApi.md).[constructor](RegistryBaseApi.md#constructor) + +#### Defined in + +[src/nevermined/api/ComputeApi.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ComputeApi.ts#L24) + +## Properties + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[servicePlugin](RegistryBaseApi.md#serviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RegistryBaseApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RegistryBaseApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +RegistryBaseApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RegistryBaseApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RegistryBaseApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +RegistryBaseApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +RegistryBaseApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +RegistryBaseApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[addRating](RegistryBaseApi.md#addrating) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### create + +▸ **create**(`assetAttributes`, `publisherAccount`, `publicationOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +Registers a new asset in Nevermined. +You can find more information about how different data is stored in Nevermined here: +[https://docs.nevermined.io/docs/architecture/nevermined-data](https://docs.nevermined.io/docs/architecture/nevermined-data) + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisherAccount` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +[DDO](DDO.md) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Defined in + +[src/nevermined/api/ComputeApi.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ComputeApi.ts#L43) + +--- + +### execute + +▸ **execute**(`agreementId`, `workflowDid`, `consumerAccount`): `Promise`<`string`\> + +It triggers the execution of a compute job + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------- | :----------------------------------------------------------- | +| `agreementId` | `string` | The unique identifier of the order placed for a service | +| `workflowDid` | `string` | The unique identifier of the Asset representing the workflow | +| `consumerAccount` | [`Account`](Account.md) | The account of the user triggering the computation | + +#### Returns + +`Promise`<`string`\> + +If the execution is correct it returns the response given by the Nevermined Node + +#### Defined in + +[src/nevermined/api/ComputeApi.ts:120](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ComputeApi.ts#L120) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[list](RegistryBaseApi.md#list) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### logs + +▸ **logs**(`agreementId`, `executionId`, `consumerAccount`): `Promise`<`any`\> + +It returns the logs resulted by the execution of a Job + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------- | :------------------------------------------------------ | +| `agreementId` | `string` | The unique identifier of the order placed for a service | +| `executionId` | `string` | The unique identifier of the job executed | +| `consumerAccount` | [`Account`](Account.md) | The account of the user triggering the computation | + +#### Returns + +`Promise`<`any`\> + +The logs resulted of the execution of the job + +#### Defined in + +[src/nevermined/api/ComputeApi.ts:137](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ComputeApi.ts#L137) + +--- + +### order + +▸ **order**(`did`, `consumerAccount`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of a compute service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------------------------- | +| `did` | `string` | Unique identifier of the asset to order | +| `consumerAccount` | [`Account`](Account.md) | The account of the user ordering the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID identifying the order + +#### Defined in + +[src/nevermined/api/ComputeApi.ts:105](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ComputeApi.ts#L105) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[orderAsset](RegistryBaseApi.md#orderasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[registerNeverminedAsset](RegistryBaseApi.md#registerneverminedasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[resolveAsset](RegistryBaseApi.md#resolveasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[setInstanceConfig](RegistryBaseApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### status + +▸ **status**(`agreementId`, `executionId`, `consumerAccount`): `Promise`<`any`\> + +It returns the status of a compute job + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------- | :------------------------------------------------------ | +| `agreementId` | `string` | The unique identifier of the order placed for a service | +| `executionId` | `string` | The unique identifier of the job executed | +| `consumerAccount` | [`Account`](Account.md) | The account of the user triggering the computation | + +#### Returns + +`Promise`<`any`\> + +The status of the job + +#### Defined in + +[src/nevermined/api/ComputeApi.ts:152](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ComputeApi.ts#L152) + +--- + +### update + +▸ **update**(`did`, `metadata`, `publisherAccount`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisherAccount` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +**`Example`** + +```ts +const ddoUpdated = await nevermined.compute.update( + ddo.shortId(), + updatedMetadata, + publisher, + PublishMetadata.IPFS, +) +``` + +#### Defined in + +[src/nevermined/api/ComputeApi.ts:87](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ComputeApi.ts#L87) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[updateAsset](RegistryBaseApi.md#updateasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[getInstance](RegistryBaseApi.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[getServicePlugin](RegistryBaseApi.md#getserviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[setInstanceConfig](RegistryBaseApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ComputeExecutionCondition.md b/docs/api-reference/classes/ComputeExecutionCondition.md new file mode 100644 index 000000000..48b3c4de1 --- /dev/null +++ b/docs/api-reference/classes/ComputeExecutionCondition.md @@ -0,0 +1,985 @@ +[@nevermined-io/sdk](../code-reference.md) / ComputeExecutionCondition + +# Class: ComputeExecutionCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`ComputeExecutionConditionContext`\> + + ↳ **`ComputeExecutionCondition`** + +## Table of contents + +### Constructors + +- [constructor](ComputeExecutionCondition.md#constructor) + +### Properties + +- [address](ComputeExecutionCondition.md#address) +- [contract](ComputeExecutionCondition.md#contract) +- [contractName](ComputeExecutionCondition.md#contractname) +- [events](ComputeExecutionCondition.md#events) +- [version](ComputeExecutionCondition.md#version) + +### Accessors + +- [artifactsFolder](ComputeExecutionCondition.md#artifactsfolder) +- [circuitsFolder](ComputeExecutionCondition.md#circuitsfolder) +- [config](ComputeExecutionCondition.md#config) +- [instanceConfig](ComputeExecutionCondition.md#instanceconfig) +- [instantiableConfig](ComputeExecutionCondition.md#instantiableconfig) +- [logger](ComputeExecutionCondition.md#logger) +- [nevermined](ComputeExecutionCondition.md#nevermined) +- [web3](ComputeExecutionCondition.md#web3) + +### Methods + +- [abortByTimeOut](ComputeExecutionCondition.md#abortbytimeout) +- [call](ComputeExecutionCondition.md#call) +- [fulfill](ComputeExecutionCondition.md#fulfill) +- [fulfillInstance](ComputeExecutionCondition.md#fulfillinstance) +- [fulfillPlain](ComputeExecutionCondition.md#fulfillplain) +- [fulfillWithNode](ComputeExecutionCondition.md#fulfillwithnode) +- [generateId](ComputeExecutionCondition.md#generateid) +- [generateIdHash](ComputeExecutionCondition.md#generateidhash) +- [generateIdWithSeed](ComputeExecutionCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](ComputeExecutionCondition.md#getconditionfulfilledevent) +- [getFromAddress](ComputeExecutionCondition.md#getfromaddress) +- [getInputsOfMethod](ComputeExecutionCondition.md#getinputsofmethod) +- [getSignatureOfMethod](ComputeExecutionCondition.md#getsignatureofmethod) +- [hashValues](ComputeExecutionCondition.md#hashvalues) +- [hashValuesPlain](ComputeExecutionCondition.md#hashvaluesplain) +- [init](ComputeExecutionCondition.md#init) +- [instance](ComputeExecutionCondition.md#instance) +- [instanceFromDDO](ComputeExecutionCondition.md#instancefromddo) +- [nodeMethod](ComputeExecutionCondition.md#nodemethod) +- [params](ComputeExecutionCondition.md#params) +- [paramsFromDDO](ComputeExecutionCondition.md#paramsfromddo) +- [send](ComputeExecutionCondition.md#send) +- [sendFrom](ComputeExecutionCondition.md#sendfrom) +- [setInstanceConfig](ComputeExecutionCondition.md#setinstanceconfig) +- [wasComputeTriggered](ComputeExecutionCondition.md#wascomputetriggered) +- [getInstance](ComputeExecutionCondition.md#getinstance) +- [setInstanceConfig](ComputeExecutionCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ComputeExecutionCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `computeConsumer`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `computeConsumer` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L24) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `ComputeExecutionConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `computeConsumer`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `did` | `string` | +| `computeConsumer` | `string` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L20) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :--------------------------------- | +| `«destructured»` | `ComputeExecutionConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L12) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### wasComputeTriggered + +▸ **wasComputeTriggered**(`did`, `computeConsumer`, `from?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------- | +| `did` | `string` | +| `computeConsumer` | `string` | +| `from?` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L39) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`ComputeExecutionCondition`](ComputeExecutionCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`ComputeExecutionCondition`](ComputeExecutionCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L16) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Condition.md b/docs/api-reference/classes/Condition.md index 1f05eeef2..8acc4f9b3 100644 --- a/docs/api-reference/classes/Condition.md +++ b/docs/api-reference/classes/Condition.md @@ -4,20 +4,20 @@ ## Type parameters -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Record`<`string`, `unknown`\> | +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Record`<`string`, `unknown`\> | ## Hierarchy -- [`ConditionSmall`](conditions.ConditionSmall.md) +- [`ConditionSmall`](ConditionSmall.md) ↳ **`Condition`** - ↳↳ [`ProviderCondition`](conditions.ProviderCondition.md) + ↳↳ [`ProviderCondition`](ProviderCondition.md) - ↳↳ [`ConsumerCondition`](conditions.ConsumerCondition.md) + ↳↳ [`ConsumerCondition`](ConsumerCondition.md) ## Table of contents @@ -27,6 +27,7 @@ ### Properties +- [address](Condition.md#address) - [contract](Condition.md#contract) - [contractName](Condition.md#contractname) - [events](Condition.md#events) @@ -34,8 +35,8 @@ ### Accessors -- [address](Condition.md#address) - [artifactsFolder](Condition.md#artifactsfolder) +- [circuitsFolder](Condition.md#circuitsfolder) - [config](Condition.md#config) - [instanceConfig](Condition.md#instanceconfig) - [instantiableConfig](Condition.md#instantiableconfig) @@ -46,20 +47,15 @@ ### Methods - [abortByTimeOut](Condition.md#abortbytimeout) -- [addresses](Condition.md#addresses) - [call](Condition.md#call) -- [checkExists](Condition.md#checkexists) -- [findSigner](Condition.md#findsigner) - [fulfill](Condition.md#fulfill) -- [fulfillGateway](Condition.md#fulfillgateway) - [fulfillInstance](Condition.md#fulfillinstance) - [fulfillPlain](Condition.md#fulfillplain) +- [fulfillWithNode](Condition.md#fulfillwithnode) - [generateId](Condition.md#generateid) - [generateIdHash](Condition.md#generateidhash) - [generateIdWithSeed](Condition.md#generateidwithseed) -- [getAddress](Condition.md#getaddress) - [getConditionFulfilledEvent](Condition.md#getconditionfulfilledevent) -- [getContract](Condition.md#getcontract) - [getFromAddress](Condition.md#getfromaddress) - [getInputsOfMethod](Condition.md#getinputsofmethod) - [getSignatureOfMethod](Condition.md#getsignatureofmethod) @@ -73,8 +69,6 @@ - [send](Condition.md#send) - [sendFrom](Condition.md#sendfrom) - [setInstanceConfig](Condition.md#setinstanceconfig) -- [addressesStatic](Condition.md#addressesstatic) -- [findSignerStatic](Condition.md#findsignerstatic) - [getInstance](Condition.md#getinstance) - [setInstanceConfig](Condition.md#setinstanceconfig-1) @@ -86,10 +80,10 @@ #### Type parameters -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Record`<`string`, `unknown`\> | +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Record`<`string`, `unknown`\> | #### Parameters @@ -99,53 +93,67 @@ #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[constructor](conditions.ConditionSmall.md#constructor) +[ConditionSmall](ConditionSmall.md).[constructor](ConditionSmall.md#constructor) #### Defined in -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) ## Properties +### address + +• **address**: `string` + +#### Inherited from + +[ConditionSmall](ConditionSmall.md).[address](ConditionSmall.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + ### contract -• **contract**: `Contract` = `null` +• **contract**: `BaseContract` = `null` #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[contract](conditions.ConditionSmall.md#contract) +[ConditionSmall](ConditionSmall.md).[contract](ConditionSmall.md#contract) #### Defined in -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) --- ### contractName -• **contractName**: `string` +• `Readonly` **contractName**: `string` #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[contractName](conditions.ConditionSmall.md#contractname) +[ConditionSmall](ConditionSmall.md).[contractName](ConditionSmall.md#contractname) #### Defined in -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) --- ### events -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[events](conditions.ConditionSmall.md#events) +[ConditionSmall](ConditionSmall.md).[events](ConditionSmall.md#events) #### Defined in -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) --- @@ -155,17 +163,17 @@ #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[version](conditions.ConditionSmall.md#version) +[ConditionSmall](ConditionSmall.md).[version](ConditionSmall.md#version) #### Defined in -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) ## Accessors -### address +### artifactsFolder -• `get` **address**(): `string` +• `Protected` `get` **artifactsFolder**(): `string` #### Returns @@ -173,17 +181,17 @@ #### Inherited from -ConditionSmall.address +ConditionSmall.artifactsFolder #### Defined in -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) --- -### artifactsFolder +### circuitsFolder -• `Protected` `get` **artifactsFolder**(): `string` +• `Protected` `get` **circuitsFolder**(): `string` #### Returns @@ -191,21 +199,21 @@ ConditionSmall.address #### Inherited from -ConditionSmall.artifactsFolder +ConditionSmall.circuitsFolder #### Defined in -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) --- ### config -• `Protected` `get` **config**(): [`Config`](Config.md) +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) #### Returns -[`Config`](Config.md) +[`NeverminedOptions`](NeverminedOptions.md) #### Inherited from @@ -213,17 +221,17 @@ ConditionSmall.config #### Defined in -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) --- ### instanceConfig -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -231,17 +239,17 @@ ConditionSmall.instanceConfig #### Defined in -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) --- ### instantiableConfig -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -249,17 +257,17 @@ ConditionSmall.instantiableConfig #### Defined in -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) --- ### logger -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) +• `Protected` `get` **logger**(): `Logger` #### Returns -[`Logger`](utils.Logger.md) +`Logger` #### Inherited from @@ -267,7 +275,7 @@ ConditionSmall.logger #### Defined in -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) --- @@ -285,17 +293,17 @@ ConditionSmall.nevermined #### Defined in -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) --- ### web3 -• `Protected` `get` **web3**(): `JsonRpcProvider` +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` #### Returns -`JsonRpcProvider` +`JsonRpcProvider` \| `BrowserProvider` #### Inherited from @@ -303,51 +311,33 @@ ConditionSmall.web3 #### Defined in -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) ## Methods ### abortByTimeOut -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[abortByTimeOut](conditions.ConditionSmall.md#abortbytimeout) +[ConditionSmall](ConditionSmall.md).[abortByTimeOut](ConditionSmall.md#abortbytimeout) #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[addresses](conditions.ConditionSmall.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) --- @@ -375,69 +365,17 @@ ConditionSmall.web3 #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[call](conditions.ConditionSmall.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[checkExists](conditions.ConditionSmall.md#checkexists) +[ConditionSmall](ConditionSmall.md).[call](ConditionSmall.md#call) #### Defined in -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[findSigner](conditions.ConditionSmall.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) --- ### fulfill -▸ `Abstract` **fulfill**(`agreementId`, ...`args`): `any` +▸ `Abstract` **fulfill**(`agreementId`, `...args`): `any` #### Parameters @@ -452,86 +390,86 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[fulfill](conditions.ConditionSmall.md#fulfill) +[ConditionSmall](ConditionSmall.md).[fulfill](ConditionSmall.md#fulfill) #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:67](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L67) +[src/keeper/contracts/conditions/Condition.abstract.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L61) --- -### fulfillGateway +### fulfillInstance -▸ `Abstract` **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`void` \| `ContractReceipt`\> +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :----------------- | :----------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\> | -| `additionalParams` | `Extra` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | +| Name | Type | Default value | +| :----------------- | :------------------------------------------------------------------ | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\> | `undefined` | +| `additionalParams` | `Extra` | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | #### Returns -`Promise`<`void` \| `ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:177](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L177) +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) --- -### fulfillInstance +### fulfillPlain -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | Default value | -| :----------------- | :----------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\> | `undefined` | -| `additionalParams` | `Extra` | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConditionSmall](ConditionSmall.md).[fulfillPlain](ConditionSmall.md#fulfillplain) #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) --- -### fulfillPlain +### fulfillWithNode -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> +▸ `Abstract` **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`void` \| `ContractTransactionReceipt`\> #### Parameters -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | +| Name | Type | +| :----------------- | :------------------------------------------------------------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\> | +| `additionalParams` | `Extra` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[fulfillPlain](conditions.ConditionSmall.md#fulfillplain) +`Promise`<`void` \| `ContractTransactionReceipt`\> #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) +[src/keeper/contracts/conditions/Condition.abstract.ts:167](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L167) --- @@ -552,17 +490,17 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[generateId](conditions.ConditionSmall.md#generateid) +[ConditionSmall](ConditionSmall.md).[generateId](ConditionSmall.md#generateid) #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) --- ### generateIdHash -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> #### Parameters @@ -577,11 +515,11 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[generateIdHash](conditions.ConditionSmall.md#generateidhash) +[ConditionSmall](ConditionSmall.md).[generateIdHash](ConditionSmall.md#generateidhash) #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) --- @@ -602,35 +540,17 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[generateIdWithSeed](conditions.ConditionSmall.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[getAddress](conditions.ConditionSmall.md#getaddress) +[ConditionSmall](ConditionSmall.md).[generateIdWithSeed](ConditionSmall.md#generateidwithseed) #### Defined in -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) --- ### getConditionFulfilledEvent -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) #### Parameters @@ -640,33 +560,15 @@ true if the contract exists. #### Returns -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[getConditionFulfilledEvent](conditions.ConditionSmall.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` +[`EventResult`](../code-reference.md#eventresult) #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[getContract](conditions.ConditionSmall.md#getcontract) +[ConditionSmall](ConditionSmall.md).[getConditionFulfilledEvent](ConditionSmall.md#getconditionfulfilledevent) #### Defined in -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) --- @@ -686,17 +588,17 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[getFromAddress](conditions.ConditionSmall.md#getfromaddress) +[ConditionSmall](ConditionSmall.md).[getFromAddress](ConditionSmall.md#getfromaddress) #### Defined in -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) --- ### getInputsOfMethod -▸ **getInputsOfMethod**(`methodName`): `any`[] +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] #### Parameters @@ -706,15 +608,15 @@ true if the contract exists. #### Returns -`any`[] +readonly `ParamType`[] #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[getInputsOfMethod](conditions.ConditionSmall.md#getinputsofmethod) +[ConditionSmall](ConditionSmall.md).[getInputsOfMethod](ConditionSmall.md#getinputsofmethod) #### Defined in -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) --- @@ -735,17 +637,17 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[getSignatureOfMethod](conditions.ConditionSmall.md#getsignatureofmethod) +[ConditionSmall](ConditionSmall.md).[getSignatureOfMethod](ConditionSmall.md#getsignatureofmethod) #### Defined in -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) --- ### hashValues -▸ **hashValues**(...`args`): `Promise`<`string`\> +▸ **hashValues**(`...args`): `Promise`<`string`\> #### Parameters @@ -759,17 +661,17 @@ true if the contract exists. #### Overrides -[ConditionSmall](conditions.ConditionSmall.md).[hashValues](conditions.ConditionSmall.md#hashvalues) +[ConditionSmall](ConditionSmall.md).[hashValues](ConditionSmall.md#hashvalues) #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) --- ### hashValuesPlain -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> #### Parameters @@ -783,7 +685,7 @@ true if the contract exists. #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) --- @@ -793,10 +695,10 @@ true if the contract exists. #### Parameters -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | #### Returns @@ -804,60 +706,60 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[init](conditions.ConditionSmall.md#init) +[ConditionSmall](ConditionSmall.md).[init](ConditionSmall.md#init) #### Defined in -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) --- ### instance -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> #### Parameters -| Name | Type | -| :------------ | :--------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> | +| Name | Type | +| :------------ | :---------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> | #### Returns -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) --- ### instanceFromDDO -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> #### Parameters -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `Ctx` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `Ctx` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | #### Returns -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) --- ### params -▸ **params**(...`args`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> +▸ **params**(`...args`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> #### Parameters @@ -867,86 +769,86 @@ true if the contract exists. #### Returns -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:134](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L134) +[src/keeper/contracts/conditions/Condition.abstract.ts:122](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L122) --- ### paramsFromDDO -▸ `Abstract` **paramsFromDDO**(`ctx`, ...`args`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\>\> +▸ `Abstract` **paramsFromDDO**(`ctx`, `...args`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\>\> #### Parameters -| Name | Type | -| :-------- | :------------------------------------------------------------------------------- | -| `ctx` | `Ctx` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | +| Name | Type | +| :-------- | :-------------------------------------------------------------------- | +| `ctx` | `Ctx` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | #### Returns -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\>\> +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\>\> #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:149](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L149) +[src/keeper/contracts/conditions/Condition.abstract.ts:137](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L137) --- ### send -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[send](conditions.ConditionSmall.md#send) +[ConditionSmall](ConditionSmall.md).[send](ConditionSmall.md#send) #### Defined in -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) --- ### sendFrom -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> #### Parameters -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | #### Returns -`Promise`<`ContractReceipt`\> +`Promise`<`ContractTransactionReceipt`\> #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[sendFrom](conditions.ConditionSmall.md#sendfrom) +[ConditionSmall](ConditionSmall.md).[sendFrom](ConditionSmall.md#sendfrom) #### Defined in -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) --- @@ -956,9 +858,9 @@ true if the contract exists. #### Parameters -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -966,62 +868,11 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[setInstanceConfig](conditions.ConditionSmall.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[addressesStatic](conditions.ConditionSmall.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConditionSmall](conditions.ConditionSmall.md).[findSignerStatic](conditions.ConditionSmall.md#findsignerstatic) +[ConditionSmall](ConditionSmall.md).[setInstanceConfig](ConditionSmall.md#setinstanceconfig) #### Defined in -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) --- @@ -1031,19 +882,19 @@ true if the contract exists. #### Type parameters -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Extra` | +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Extra` | #### Parameters -| Name | Type | Default value | -| :---------------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `conditionName` | `string` | `undefined` | -| `conditionsClass` | `any` | `undefined` | -| `optional` | `boolean` | `false` | +| Name | Type | Default value | +| :---------------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `conditionName` | `string` | `undefined` | +| `conditionsClass` | `any` | `undefined` | +| `optional` | `boolean` | `false` | #### Returns @@ -1051,11 +902,11 @@ true if the contract exists. #### Overrides -[ConditionSmall](conditions.ConditionSmall.md).[getInstance](conditions.ConditionSmall.md#getinstance) +[ConditionSmall](ConditionSmall.md).[getInstance](ConditionSmall.md#getinstance) #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:121](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L121) +[src/keeper/contracts/conditions/Condition.abstract.ts:111](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L111) --- @@ -1065,16 +916,16 @@ true if the contract exists. #### Type parameters -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | #### Parameters -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -1082,8 +933,8 @@ true if the contract exists. #### Inherited from -[ConditionSmall](conditions.ConditionSmall.md).[setInstanceConfig](conditions.ConditionSmall.md#setinstanceconfig-1) +[ConditionSmall](ConditionSmall.md).[setInstanceConfig](ConditionSmall.md#setinstanceconfig-1) #### Defined in -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ConditionSmall.md b/docs/api-reference/classes/ConditionSmall.md new file mode 100644 index 000000000..23eebf87b --- /dev/null +++ b/docs/api-reference/classes/ConditionSmall.md @@ -0,0 +1,734 @@ +[@nevermined-io/sdk](../code-reference.md) / ConditionSmall + +# Class: ConditionSmall + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`ConditionSmall`** + + ↳↳ [`Condition`](Condition.md) + +## Table of contents + +### Constructors + +- [constructor](ConditionSmall.md#constructor) + +### Properties + +- [address](ConditionSmall.md#address) +- [contract](ConditionSmall.md#contract) +- [contractName](ConditionSmall.md#contractname) +- [events](ConditionSmall.md#events) +- [version](ConditionSmall.md#version) + +### Accessors + +- [artifactsFolder](ConditionSmall.md#artifactsfolder) +- [circuitsFolder](ConditionSmall.md#circuitsfolder) +- [config](ConditionSmall.md#config) +- [instanceConfig](ConditionSmall.md#instanceconfig) +- [instantiableConfig](ConditionSmall.md#instantiableconfig) +- [logger](ConditionSmall.md#logger) +- [nevermined](ConditionSmall.md#nevermined) +- [web3](ConditionSmall.md#web3) + +### Methods + +- [abortByTimeOut](ConditionSmall.md#abortbytimeout) +- [call](ConditionSmall.md#call) +- [fulfill](ConditionSmall.md#fulfill) +- [fulfillPlain](ConditionSmall.md#fulfillplain) +- [generateId](ConditionSmall.md#generateid) +- [generateIdHash](ConditionSmall.md#generateidhash) +- [generateIdWithSeed](ConditionSmall.md#generateidwithseed) +- [getConditionFulfilledEvent](ConditionSmall.md#getconditionfulfilledevent) +- [getFromAddress](ConditionSmall.md#getfromaddress) +- [getInputsOfMethod](ConditionSmall.md#getinputsofmethod) +- [getSignatureOfMethod](ConditionSmall.md#getsignatureofmethod) +- [hashValues](ConditionSmall.md#hashvalues) +- [init](ConditionSmall.md#init) +- [send](ConditionSmall.md#send) +- [sendFrom](ConditionSmall.md#sendfrom) +- [setInstanceConfig](ConditionSmall.md#setinstanceconfig) +- [getInstance](ConditionSmall.md#getinstance) +- [setInstanceConfig](ConditionSmall.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ConditionSmall**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ `Abstract` **fulfill**(`agreementId`, `...args`): `any` + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...args` | `any`[] | + +#### Returns + +`any` + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L61) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L57) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**<`Ctx`, `Extra`\>(`config`, `conditionName`, `conditionsClass`, `optional?`): `Promise`<`any`\> + +#### Type parameters + +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Extra` | + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `conditionName` | `string` | `undefined` | +| `conditionsClass` | `any` | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`any`\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L46) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ConditionStoreManager.md b/docs/api-reference/classes/ConditionStoreManager.md new file mode 100644 index 000000000..8c9197861 --- /dev/null +++ b/docs/api-reference/classes/ConditionStoreManager.md @@ -0,0 +1,684 @@ +[@nevermined-io/sdk](../code-reference.md) / ConditionStoreManager + +# Class: ConditionStoreManager + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`ConditionStoreManager`** + +## Table of contents + +### Constructors + +- [constructor](ConditionStoreManager.md#constructor) + +### Properties + +- [address](ConditionStoreManager.md#address) +- [contract](ConditionStoreManager.md#contract) +- [contractName](ConditionStoreManager.md#contractname) +- [events](ConditionStoreManager.md#events) +- [version](ConditionStoreManager.md#version) + +### Accessors + +- [artifactsFolder](ConditionStoreManager.md#artifactsfolder) +- [circuitsFolder](ConditionStoreManager.md#circuitsfolder) +- [config](ConditionStoreManager.md#config) +- [instanceConfig](ConditionStoreManager.md#instanceconfig) +- [instantiableConfig](ConditionStoreManager.md#instantiableconfig) +- [logger](ConditionStoreManager.md#logger) +- [nevermined](ConditionStoreManager.md#nevermined) +- [web3](ConditionStoreManager.md#web3) + +### Methods + +- [call](ConditionStoreManager.md#call) +- [createCondition](ConditionStoreManager.md#createcondition) +- [delegateCreateRole](ConditionStoreManager.md#delegatecreaterole) +- [getCondition](ConditionStoreManager.md#getcondition) +- [getCreateRole](ConditionStoreManager.md#getcreaterole) +- [getFromAddress](ConditionStoreManager.md#getfromaddress) +- [getInputsOfMethod](ConditionStoreManager.md#getinputsofmethod) +- [getOwner](ConditionStoreManager.md#getowner) +- [getSignatureOfMethod](ConditionStoreManager.md#getsignatureofmethod) +- [init](ConditionStoreManager.md#init) +- [isConditionTimeLocked](ConditionStoreManager.md#isconditiontimelocked) +- [isConditionTimedOut](ConditionStoreManager.md#isconditiontimedout) +- [send](ConditionStoreManager.md#send) +- [sendFrom](ConditionStoreManager.md#sendfrom) +- [setInstanceConfig](ConditionStoreManager.md#setinstanceconfig) +- [getInstance](ConditionStoreManager.md#getinstance) +- [setInstanceConfig](ConditionStoreManager.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ConditionStoreManager**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### createCondition + +▸ **createCondition**(`id`, `typeRef`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `id` | `string` | +| `typeRef` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L26) + +--- + +### delegateCreateRole + +▸ **delegateCreateRole**(`delegatee`, `owner`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `delegatee` | `string` | +| `owner` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L35) + +--- + +### getCondition + +▸ **getCondition**(`conditionId`): `Promise`<[`ConditionData`](../interfaces/ConditionData.md)\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `conditionId` | `string` | + +#### Returns + +`Promise`<[`ConditionData`](../interfaces/ConditionData.md)\> + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L55) + +--- + +### getCreateRole + +▸ **getCreateRole**(): `Promise`<`unknown`\> + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L39) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getOwner + +▸ **getOwner**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L51) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### isConditionTimeLocked + +▸ **isConditionTimeLocked**(`id`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L43) + +--- + +### isConditionTimedOut + +▸ **isConditionTimedOut**(`id`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L47) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`ConditionStoreManager`](ConditionStoreManager.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`ConditionStoreManager`](ConditionStoreManager.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L18) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Config.md b/docs/api-reference/classes/Config.md deleted file mode 100644 index 19105c44f..000000000 --- a/docs/api-reference/classes/Config.md +++ /dev/null @@ -1,247 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / Config - -# Class: Config - -## Table of contents - -### Constructors - -- [constructor](Config.md#constructor) - -### Properties - -- [aaveConfig](Config.md#aaveconfig) -- [accounts](Config.md#accounts) -- [artifactsFolder](Config.md#artifactsfolder) -- [authMessage](Config.md#authmessage) -- [authTokenExpiration](Config.md#authtokenexpiration) -- [faucetUri](Config.md#fauceturi) -- [feeReceiver](Config.md#feereceiver) -- [gasMultiplier](Config.md#gasmultiplier) -- [neverminedNodeAddress](Config.md#neverminednodeaddress) -- [neverminedNodeUri](Config.md#neverminedNodeUri) -- [graphHttpUri](Config.md#graphhttpuri) -- [marketplaceAuthToken](Config.md#marketplaceauthtoken) -- [marketplaceUri](Config.md#marketplaceuri) -- [networkFee](Config.md#networkfee) -- [web3ProviderUri](Config.md#web3ProviderUri) -- [threshold](Config.md#threshold) -- [verbose](Config.md#verbose) -- [web3Provider](Config.md#web3provider) - -## Constructors - -### constructor - -• **new Config**() - -## Properties - -### aaveConfig - -• `Optional` **aaveConfig**: `AaveConfig` - -#### Defined in - -[src/models/Config.ts:71](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L71) - ---- - -### accounts - -• `Optional` **accounts**: `Signer`[] - -#### Defined in - -[src/models/Config.ts:78](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L78) - ---- - -### artifactsFolder - -• `Optional` **artifactsFolder**: `string` - -The folder where the nevermined contract artifacts are located. - -#### Defined in - -[src/models/Config.ts:76](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L76) - ---- - -### authMessage - -• `Optional` **authMessage**: `string` - -Message shown when the user creates its own token. - -#### Defined in - -[src/models/Config.ts:51](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L51) - ---- - -### authTokenExpiration - -• `Optional` **authTokenExpiration**: `number` - -Token expiration time in ms. - -#### Defined in - -[src/models/Config.ts:56](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L56) - ---- - -### faucetUri - -• `Optional` **faucetUri**: `string` - -Faucet URL. - -#### Defined in - -[src/models/Config.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L26) - ---- - -### feeReceiver - -• `Optional` **feeReceiver**: `string` = `ZeroAddress` - -The address receiving the fee if this is higher than 0 - -#### Defined in - -[src/models/Config.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L90) - ---- - -### gasMultiplier - -• `Optional` **gasMultiplier**: `number` - -Gas multiplier for the fees. -Can be used to speed up the transactions. - -#### Defined in - -[src/models/Config.ts:64](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L64) - ---- - -### neverminedNodeAddress - -• `Optional` **neverminedNodeAddress**: `string` - -Address of Nevermined Node. - -#### Defined in - -[src/models/Config.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L31) - ---- - -### neverminedNodeUri - -• **neverminedNodeUri**: `string` - -Nevermined Node URL. - -#### Defined in - -[src/models/Config.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L21) - ---- - -### graphHttpUri - -• `Optional` **graphHttpUri**: `string` - -Enpoint for the graph-node http query - -#### Defined in - -[src/models/Config.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L69) - ---- - -### marketplaceAuthToken - -• `Optional` **marketplaceAuthToken**: `string` - -Marketplace auth token. - -#### Defined in - -[src/models/Config.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L16) - ---- - -### marketplaceUri - -• **marketplaceUri**: `string` - -MarketPlace URL. - -#### Defined in - -[src/models/Config.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L11) - ---- - -### networkFee - -• `Optional` **networkFee**: `number` = `0` - -The fee charged by Nevermined for using the Service Agreements - -#### Defined in - -[src/models/Config.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L85) - ---- - -### web3ProviderUri - -• `Optional` **web3ProviderUri**: `string` - -Ethereum node URL. - -#### Defined in - -[src/models/Config.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L36) - ---- - -### threshold - -• `Optional` **threshold**: `number` - -#### Defined in - -[src/models/Config.ts:58](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L58) - ---- - -### verbose - -• `Optional` **verbose**: `boolean` \| [`LogLevel`](../enums/utils.LogLevel.md) - -Log level. - -#### Defined in - -[src/models/Config.ts:46](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L46) - ---- - -### web3Provider - -• `Optional` **web3Provider**: `any` - -Web3 Provider. - -#### Defined in - -[src/models/Config.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/Config.ts#L41) diff --git a/docs/api-reference/classes/ConsumerCondition.md b/docs/api-reference/classes/ConsumerCondition.md new file mode 100644 index 000000000..2ab52eb36 --- /dev/null +++ b/docs/api-reference/classes/ConsumerCondition.md @@ -0,0 +1,972 @@ +[@nevermined-io/sdk](../code-reference.md) / ConsumerCondition + +# Class: ConsumerCondition + +## Type parameters + +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Record`<`string`, `unknown`\> | + +## Hierarchy + +- [`Condition`](Condition.md)<`Ctx`, `Extra`\> + + ↳ **`ConsumerCondition`** + + ↳↳ [`LockPaymentCondition`](LockPaymentCondition.md) + + ↳↳ [`NFTHolderCondition`](NFTHolderCondition.md) + + ↳↳ [`NFT721HolderCondition`](NFT721HolderCondition.md) + + ↳↳ [`NFTLockCondition`](NFTLockCondition.md) + +## Table of contents + +### Constructors + +- [constructor](ConsumerCondition.md#constructor) + +### Properties + +- [address](ConsumerCondition.md#address) +- [contract](ConsumerCondition.md#contract) +- [contractName](ConsumerCondition.md#contractname) +- [events](ConsumerCondition.md#events) +- [version](ConsumerCondition.md#version) + +### Accessors + +- [artifactsFolder](ConsumerCondition.md#artifactsfolder) +- [circuitsFolder](ConsumerCondition.md#circuitsfolder) +- [config](ConsumerCondition.md#config) +- [instanceConfig](ConsumerCondition.md#instanceconfig) +- [instantiableConfig](ConsumerCondition.md#instantiableconfig) +- [logger](ConsumerCondition.md#logger) +- [nevermined](ConsumerCondition.md#nevermined) +- [web3](ConsumerCondition.md#web3) + +### Methods + +- [abortByTimeOut](ConsumerCondition.md#abortbytimeout) +- [call](ConsumerCondition.md#call) +- [fulfill](ConsumerCondition.md#fulfill) +- [fulfillInstance](ConsumerCondition.md#fulfillinstance) +- [fulfillPlain](ConsumerCondition.md#fulfillplain) +- [fulfillWithNode](ConsumerCondition.md#fulfillwithnode) +- [generateId](ConsumerCondition.md#generateid) +- [generateIdHash](ConsumerCondition.md#generateidhash) +- [generateIdWithSeed](ConsumerCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](ConsumerCondition.md#getconditionfulfilledevent) +- [getFromAddress](ConsumerCondition.md#getfromaddress) +- [getInputsOfMethod](ConsumerCondition.md#getinputsofmethod) +- [getSignatureOfMethod](ConsumerCondition.md#getsignatureofmethod) +- [hashValues](ConsumerCondition.md#hashvalues) +- [hashValuesPlain](ConsumerCondition.md#hashvaluesplain) +- [init](ConsumerCondition.md#init) +- [instance](ConsumerCondition.md#instance) +- [instanceFromDDO](ConsumerCondition.md#instancefromddo) +- [params](ConsumerCondition.md#params) +- [paramsFromDDO](ConsumerCondition.md#paramsfromddo) +- [send](ConsumerCondition.md#send) +- [sendFrom](ConsumerCondition.md#sendfrom) +- [setInstanceConfig](ConsumerCondition.md#setinstanceconfig) +- [getInstance](ConsumerCondition.md#getinstance) +- [setInstanceConfig](ConsumerCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ConsumerCondition**<`Ctx`, `Extra`\>(`contractName`) + +#### Type parameters + +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Record`<`string`, `unknown`\> | + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[Condition](Condition.md).[constructor](Condition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[Condition](Condition.md).[address](Condition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[Condition](Condition.md).[contract](Condition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[Condition](Condition.md).[contractName](Condition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[Condition](Condition.md).[events](Condition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[Condition](Condition.md).[version](Condition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Condition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Condition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Condition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Condition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Condition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Condition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Condition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Condition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[abortByTimeOut](Condition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[Condition](Condition.md).[call](Condition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ `Abstract` **fulfill**(`agreementId`, `...args`): `any` + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...args` | `any`[] | + +#### Returns + +`any` + +#### Inherited from + +[Condition](Condition.md).[fulfill](Condition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L61) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :------------------------------------------------------------------ | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\> | `undefined` | +| `additionalParams` | `Extra` | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[fulfillInstance](Condition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[fulfillPlain](Condition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`_cond`, `_additionalParams`, `_from?`, `_txParams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------------ | :------------------------------------------------------------------ | +| `_cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\> | +| `_additionalParams` | `Extra` | +| `_from?` | [`Account`](Account.md) | +| `_txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Overrides + +[Condition](Condition.md).[fulfillWithNode](Condition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:217](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L217) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[generateId](Condition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[generateIdHash](Condition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[Condition](Condition.md).[generateIdWithSeed](Condition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[Condition](Condition.md).[getConditionFulfilledEvent](Condition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[getFromAddress](Condition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[Condition](Condition.md).[getInputsOfMethod](Condition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[Condition](Condition.md).[getSignatureOfMethod](Condition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[hashValues](Condition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[hashValuesPlain](Condition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[Condition](Condition.md).[init](Condition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Inherited from + +[Condition](Condition.md).[instance](Condition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `Ctx` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Inherited from + +[Condition](Condition.md).[instanceFromDDO](Condition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### params + +▸ **params**(`...args`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> + +#### Inherited from + +[Condition](Condition.md).[params](Condition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:122](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L122) + +--- + +### paramsFromDDO + +▸ `Abstract` **paramsFromDDO**(`ctx`, `...args`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\>\> + +#### Parameters + +| Name | Type | +| :-------- | :-------------------------------------------------------------------- | +| `ctx` | `Ctx` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\>\> + +#### Inherited from + +[Condition](Condition.md).[paramsFromDDO](Condition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:137](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L137) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[send](Condition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[sendFrom](Condition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**<`Ctx`, `Extra`\>(`config`, `conditionName`, `conditionsClass`, `optional?`): `Promise`<`any`\> + +#### Type parameters + +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Extra` | + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `conditionName` | `string` | `undefined` | +| `conditionsClass` | `any` | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[Condition](Condition.md).[getInstance](Condition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:111](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L111) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ContractBase.md b/docs/api-reference/classes/ContractBase.md new file mode 100644 index 000000000..5d720adc6 --- /dev/null +++ b/docs/api-reference/classes/ContractBase.md @@ -0,0 +1,642 @@ +[@nevermined-io/sdk](../code-reference.md) / ContractBase + +# Class: ContractBase + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`ContractBase`** + + ↳↳ [`ConditionSmall`](ConditionSmall.md) + + ↳↳ [`AgreementStoreManager`](AgreementStoreManager.md) + + ↳↳ [`ConditionStoreManager`](ConditionStoreManager.md) + + ↳↳ [`TemplateStoreManager`](TemplateStoreManager.md) + + ↳↳ [`RewardsDistributor`](RewardsDistributor.md) + + ↳↳ [`RoyaltyScheme`](RoyaltyScheme.md) + + ↳↳ [`AgreementTemplate`](AgreementTemplate.md) + + ↳↳ [`DIDRegistry`](DIDRegistry.md) + + ↳↳ [`Dispenser`](Dispenser.md) + + ↳↳ [`GenericContract`](GenericContract.md) + + ↳↳ [`NFTContractsBase`](NFTContractsBase.md) + + ↳↳ [`Token`](Token.md) + +## Table of contents + +### Constructors + +- [constructor](ContractBase.md#constructor) + +### Properties + +- [address](ContractBase.md#address) +- [contract](ContractBase.md#contract) +- [contractName](ContractBase.md#contractname) +- [events](ContractBase.md#events) +- [version](ContractBase.md#version) + +### Accessors + +- [artifactsFolder](ContractBase.md#artifactsfolder) +- [circuitsFolder](ContractBase.md#circuitsfolder) +- [config](ContractBase.md#config) +- [instanceConfig](ContractBase.md#instanceconfig) +- [instantiableConfig](ContractBase.md#instantiableconfig) +- [logger](ContractBase.md#logger) +- [nevermined](ContractBase.md#nevermined) +- [web3](ContractBase.md#web3) + +### Methods + +- [call](ContractBase.md#call) +- [estimateGas](ContractBase.md#estimategas) +- [getFromAddress](ContractBase.md#getfromaddress) +- [getInputsOfMethod](ContractBase.md#getinputsofmethod) +- [getSignatureOfMethod](ContractBase.md#getsignatureofmethod) +- [init](ContractBase.md#init) +- [internalSend](ContractBase.md#internalsend) +- [internalSendZeroDev](ContractBase.md#internalsendzerodev) +- [searchMethod](ContractBase.md#searchmethod) +- [searchMethodInputs](ContractBase.md#searchmethodinputs) +- [send](ContractBase.md#send) +- [sendFrom](ContractBase.md#sendfrom) +- [setInstanceConfig](ContractBase.md#setinstanceconfig) +- [getInstance](ContractBase.md#getinstance) +- [setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ContractBase**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### estimateGas + +▸ `Private` **estimateGas**(`contract`, `methodSignature`, `args`, `from`, `value`, `gasMultiplier?`): `Promise`<`bigint`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------------- | +| `contract` | `BaseContract` | +| `methodSignature` | `string` | +| `args` | `any`[] | +| `from` | `string` | +| `value` | `string` | +| `gasMultiplier?` | `number` | + +#### Returns + +`Promise`<`bigint`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:359](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L359) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### internalSend + +▸ `Private` **internalSend**(`name`, `from`, `args`, `txparams`, `contract`, `progress`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------- | :------------------------ | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `txparams` | `any` | +| `contract` | `BaseContract` | +| `progress` | (`data`: `any`) => `void` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L102) + +--- + +### internalSendZeroDev + +▸ `Private` **internalSendZeroDev**(`name`, `from`, `args`, `txparams`, `contract`, `progress`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------- | :------------------------ | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `txparams` | `any` | +| `contract` | `BaseContract` | +| `progress` | (`data`: `any`) => `void` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:168](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L168) + +--- + +### searchMethod + +▸ `Private` **searchMethod**(`methodName`, `args?`): `Fragment` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`Fragment` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:339](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L339) + +--- + +### searchMethodInputs + +▸ `Private` **searchMethodInputs**(`methodName`, `args?`): { `name`: `string` = input.name; `value`: `any` }[] + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +{ `name`: `string` = input.name; `value`: `any` }[] + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:350](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L350) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ContractEvent.md b/docs/api-reference/classes/ContractEvent.md new file mode 100644 index 000000000..50e98e638 --- /dev/null +++ b/docs/api-reference/classes/ContractEvent.md @@ -0,0 +1,476 @@ +[@nevermined-io/sdk](../code-reference.md) / ContractEvent + +# Class: ContractEvent + +## Hierarchy + +- [`NeverminedEvent`](NeverminedEvent.md) + + ↳ **`ContractEvent`** + +## Table of contents + +### Constructors + +- [constructor](ContractEvent.md#constructor) + +### Properties + +- [contract](ContractEvent.md#contract) +- [eventEmitter](ContractEvent.md#eventemitter) + +### Accessors + +- [artifactsFolder](ContractEvent.md#artifactsfolder) +- [circuitsFolder](ContractEvent.md#circuitsfolder) +- [config](ContractEvent.md#config) +- [instanceConfig](ContractEvent.md#instanceconfig) +- [instantiableConfig](ContractEvent.md#instantiableconfig) +- [logger](ContractEvent.md#logger) +- [nevermined](ContractEvent.md#nevermined) +- [web3](ContractEvent.md#web3) + +### Methods + +- [eventExists](ContractEvent.md#eventexists) +- [filterToArgs](ContractEvent.md#filtertoargs) +- [getBlockNumber](ContractEvent.md#getblocknumber) +- [getEventData](ContractEvent.md#geteventdata) +- [getPastEvents](ContractEvent.md#getpastevents) +- [once](ContractEvent.md#once) +- [setInstanceConfig](ContractEvent.md#setinstanceconfig) +- [subscribe](ContractEvent.md#subscribe) +- [getInstance](ContractEvent.md#getinstance) +- [setInstanceConfig](ContractEvent.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new ContractEvent**(`contract`, `eventEmitter`) + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `contract` | [`ContractBase`](ContractBase.md) | +| `eventEmitter` | [`EventEmitter`](../interfaces/EventEmitter.md) | + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[constructor](NeverminedEvent.md#constructor) + +#### Defined in + +[src/events/NeverminedEvent.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L34) + +## Properties + +### contract + +• `Protected` **contract**: [`ContractBase`](ContractBase.md) = `null` + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[contract](NeverminedEvent.md#contract) + +#### Defined in + +[src/events/NeverminedEvent.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L29) + +--- + +### eventEmitter + +• `Protected` **eventEmitter**: [`EventEmitter`](../interfaces/EventEmitter.md) + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[eventEmitter](NeverminedEvent.md#eventemitter) + +#### Defined in + +[src/events/NeverminedEvent.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L28) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NeverminedEvent.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NeverminedEvent.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NeverminedEvent.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NeverminedEvent.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NeverminedEvent.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NeverminedEvent.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NeverminedEvent.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NeverminedEvent.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### eventExists + +▸ `Private` **eventExists**(`eventName`): `boolean` + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `eventName` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[src/events/ContractEvent.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/ContractEvent.ts#L57) + +--- + +### filterToArgs + +▸ `Private` **filterToArgs**(`eventName`, `filter`): `any`[] + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------- | +| `eventName` | `string` | +| `filter` | [`Filter`](../interfaces/Filter.md) | + +#### Returns + +`any`[] + +#### Defined in + +[src/events/ContractEvent.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/ContractEvent.ts#L61) + +--- + +### getBlockNumber + +▸ **getBlockNumber**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getBlockNumber](NeverminedEvent.md#getblocknumber) + +#### Defined in + +[src/events/ContractEvent.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/ContractEvent.ts#L53) + +--- + +### getEventData + +▸ **getEventData**(`options`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getEventData](NeverminedEvent.md#geteventdata) + +#### Defined in + +[src/events/ContractEvent.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/ContractEvent.ts#L23) + +--- + +### getPastEvents + +▸ **getPastEvents**(`options`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getPastEvents](NeverminedEvent.md#getpastevents) + +#### Defined in + +[src/events/ContractEvent.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/ContractEvent.ts#L35) + +--- + +### once + +▸ **once**(`callback?`, `options?`): `Promise`<[`EventResult`](../code-reference.md#eventresult)\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------------------------ | +| `callback?` | (`events`: [`EventResult`](../code-reference.md#eventresult)[]) => `void` | +| `options?` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +`Promise`<[`EventResult`](../code-reference.md#eventresult)\> + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[once](NeverminedEvent.md#once) + +#### Defined in + +[src/events/NeverminedEvent.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L54) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[setInstanceConfig](NeverminedEvent.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### subscribe + +▸ **subscribe**(`callback`, `options`): [`ContractEventSubscription`](../interfaces/ContractEventSubscription.md) + +#### Parameters + +| Name | Type | +| :--------- | :------------------------------------------------------------------------ | +| `callback` | (`events`: [`EventResult`](../code-reference.md#eventresult)[]) => `void` | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`ContractEventSubscription`](../interfaces/ContractEventSubscription.md) + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[subscribe](NeverminedEvent.md#subscribe) + +#### Defined in + +[src/events/NeverminedEvent.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L40) + +--- + +### getInstance + +▸ `Static` **getInstance**(`contract`, `eventEmitter`, `nevermined`, `web3`): [`ContractEvent`](ContractEvent.md) + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `contract` | [`ContractBase`](ContractBase.md) | +| `eventEmitter` | [`EventEmitter`](../interfaces/EventEmitter.md) | +| `nevermined` | [`Nevermined`](Nevermined.md) | +| `web3` | `JsonRpcProvider` \| `BrowserProvider` | + +#### Returns + +[`ContractEvent`](ContractEvent.md) + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getInstance](NeverminedEvent.md#getinstance) + +#### Defined in + +[src/events/ContractEvent.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/ContractEvent.ts#L8) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[setInstanceConfig](NeverminedEvent.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ContractHandler.md b/docs/api-reference/classes/ContractHandler.md new file mode 100644 index 000000000..7dfd7cded --- /dev/null +++ b/docs/api-reference/classes/ContractHandler.md @@ -0,0 +1,630 @@ +[@nevermined-io/sdk](../code-reference.md) / ContractHandler + +# Class: ContractHandler + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`ContractHandler`** + +## Table of contents + +### Constructors + +- [constructor](ContractHandler.md#constructor) + +### Properties + +- [contracts](ContractHandler.md#contracts) + +### Accessors + +- [artifactsFolder](ContractHandler.md#artifactsfolder) +- [circuitsFolder](ContractHandler.md#circuitsfolder) +- [config](ContractHandler.md#config) +- [instanceConfig](ContractHandler.md#instanceconfig) +- [instantiableConfig](ContractHandler.md#instantiableconfig) +- [logger](ContractHandler.md#logger) +- [nevermined](ContractHandler.md#nevermined) +- [web3](ContractHandler.md#web3) + +### Methods + +- [checkExists](ContractHandler.md#checkexists) +- [deployAbi](ContractHandler.md#deployabi) +- [get](ContractHandler.md#get) +- [getFeeData](ContractHandler.md#getfeedata) +- [getFeeDataArbitrum](ContractHandler.md#getfeedataarbitrum) +- [getFeeDataPolygon](ContractHandler.md#getfeedatapolygon) +- [getVersion](ContractHandler.md#getversion) +- [load](ContractHandler.md#load) +- [setInstanceConfig](ContractHandler.md#setinstanceconfig) +- [fetchJson](ContractHandler.md#fetchjson) +- [getABI](ContractHandler.md#getabi) +- [getContract](ContractHandler.md#getcontract) +- [getHash](ContractHandler.md#gethash) +- [getInstance](ContractHandler.md#getinstance) +- [getSignatureOfMethod](ContractHandler.md#getsignatureofmethod) +- [hasContract](ContractHandler.md#hascontract) +- [setContract](ContractHandler.md#setcontract) +- [setInstanceConfig](ContractHandler.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ContractHandler**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/keeper/ContractHandler.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L47) + +## Properties + +### contracts + +▪ `Static` `Private` **contracts**: `Map`<`string`, `BaseContract`\> + +#### Defined in + +[src/keeper/ContractHandler.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L38) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### checkExists + +▸ **checkExists**(`address`): `Promise`<`boolean`\> + +Returns true of contract exists else it throws. + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +true if the contract exists. + +#### Defined in + +[src/keeper/ContractHandler.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L208) + +--- + +### deployAbi + +▸ **deployAbi**(`artifact`, `from`, `args?`): `Promise`<`BaseContract`\> + +#### Parameters + +| Name | Type | Default value | +| :------------------ | :---------------------- | :------------ | +| `artifact` | `Object` | `undefined` | +| `artifact.abi` | `InterfaceAbi` | `undefined` | +| `artifact.bytecode` | `string` | `undefined` | +| `artifact.name?` | `string` | `undefined` | +| `from` | [`Account`](Account.md) | `undefined` | +| `args` | `string`[] | `[]` | + +#### Returns + +`Promise`<`BaseContract`\> + +#### Defined in + +[src/keeper/ContractHandler.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L116) + +--- + +### get + +▸ **get**(`what`, `optional?`, `artifactsFolder`, `address?`): `Promise`<`BaseContract`\> + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :-------- | :------------ | +| `what` | `string` | `undefined` | +| `optional` | `boolean` | `false` | +| `artifactsFolder` | `string` | `undefined` | +| `address?` | `string` | `undefined` | + +#### Returns + +`Promise`<`BaseContract`\> + +#### Defined in + +[src/keeper/ContractHandler.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L52) + +--- + +### getFeeData + +▸ **getFeeData**(`gasPrice?`, `maxFeePerGas?`, `maxPriorityFeePerGas?`): `Promise`<{ `maxFeePerGas`: `bigint` = maxFeePerGas; `maxPriorityFeePerGas`: `bigint` = maxPriorityFeePerGas; `type`: `number` = 2 } \| { `gasPrice`: `bigint` = feeData.gasPrice }\> + +#### Parameters + +| Name | Type | +| :---------------------- | :------- | +| `gasPrice?` | `bigint` | +| `maxFeePerGas?` | `bigint` | +| `maxPriorityFeePerGas?` | `bigint` | + +#### Returns + +`Promise`<{ `maxFeePerGas`: `bigint` = maxFeePerGas; `maxPriorityFeePerGas`: `bigint` = maxPriorityFeePerGas; `type`: `number` = 2 } \| { `gasPrice`: `bigint` = feeData.gasPrice }\> + +#### Defined in + +[src/keeper/ContractHandler.ts:258](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L258) + +--- + +### getFeeDataArbitrum + +▸ `Private` **getFeeDataArbitrum**(): `Promise`<{ `gasPrice`: `bigint` = feeData.gasPrice }\> + +#### Returns + +`Promise`<{ `gasPrice`: `bigint` = feeData.gasPrice }\> + +#### Defined in + +[src/keeper/ContractHandler.ts:322](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L322) + +--- + +### getFeeDataPolygon + +▸ `Private` **getFeeDataPolygon**(`networkId`): `Promise`<{ `maxFeePerGas`: `bigint` = maxFeePerGas; `maxPriorityFeePerGas`: `bigint` = maxPriorityFeePerGas; `type`: `number` = 2 }\> + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `networkId` | `number` | + +#### Returns + +`Promise`<{ `maxFeePerGas`: `bigint` = maxFeePerGas; `maxPriorityFeePerGas`: `bigint` = maxPriorityFeePerGas; `type`: `number` = 2 }\> + +#### Defined in + +[src/keeper/ContractHandler.ts:287](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L287) + +--- + +### getVersion + +▸ **getVersion**(`contractName`, `artifactsFolder`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `contractName` | `string` | +| `artifactsFolder` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/ContractHandler.ts:100](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L100) + +--- + +### load + +▸ `Private` **load**(`what`, `where`, `networkId`, `artifactsFolder`, `address?`): `Promise`<`BaseContract`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `what` | `string` | +| `where` | `string` | +| `networkId` | `number` | +| `artifactsFolder` | `string` | +| `address?` | `string` | + +#### Returns + +`Promise`<`BaseContract`\> + +#### Defined in + +[src/keeper/ContractHandler.ts:172](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L172) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### fetchJson + +▸ `Static` **fetchJson**(`path`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :----- | :---- | +| `path` | `any` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/keeper/ContractHandler.ts:239](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L239) + +--- + +### getABI + +▸ `Static` **getABI**(`contractName`, `artifactsFolder?`, `networkName?`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :------- | :-------------- | +| `contractName` | `string` | `undefined` | +| `artifactsFolder` | `string` | `'./artifacts'` | +| `networkName?` | `string` | `undefined` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/keeper/ContractHandler.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L73) + +--- + +### getContract + +▸ `Static` `Protected` **getContract**(`what`, `networkId`, `address?`): `BaseContract` + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `what` | `string` | +| `networkId` | `number` | +| `address?` | `string` | + +#### Returns + +`BaseContract` + +#### Defined in + +[src/keeper/ContractHandler.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L21) + +--- + +### getHash + +▸ `Static` `Private` **getHash**(`what`, `networkId`, `address?`): `string` + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `what` | `string` | +| `networkId` | `number` | +| `address?` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/keeper/ContractHandler.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L43) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### getSignatureOfMethod + +▸ `Static` **getSignatureOfMethod**(`baseContract`, `methodName`, `args`): `string` + +#### Parameters + +| Name | Type | +| :------------- | :------------- | +| `baseContract` | `BaseContract` | +| `methodName` | `string` | +| `args` | `any`[] | + +#### Returns + +`string` + +#### Defined in + +[src/keeper/ContractHandler.ts:224](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L224) + +--- + +### hasContract + +▸ `Static` `Protected` **hasContract**(`what`, `networkId`, `address?`): `boolean` + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `what` | `string` | +| `networkId` | `number` | +| `address?` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[src/keeper/ContractHandler.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L34) + +--- + +### setContract + +▸ `Static` `Protected` **setContract**(`what`, `networkId`, `contractInstance`, `address?`): `void` + +#### Parameters + +| Name | Type | +| :----------------- | :------------- | +| `what` | `string` | +| `networkId` | `number` | +| `contractInstance` | `BaseContract` | +| `address?` | `string` | + +#### Returns + +`void` + +#### Defined in + +[src/keeper/ContractHandler.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/ContractHandler.ts#L25) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/CurveRoyalties.md b/docs/api-reference/classes/CurveRoyalties.md new file mode 100644 index 000000000..bfe3cf699 --- /dev/null +++ b/docs/api-reference/classes/CurveRoyalties.md @@ -0,0 +1,597 @@ +[@nevermined-io/sdk](../code-reference.md) / CurveRoyalties + +# Class: CurveRoyalties + +## Hierarchy + +- [`RoyaltyScheme`](RoyaltyScheme.md) + + ↳ **`CurveRoyalties`** + +## Table of contents + +### Constructors + +- [constructor](CurveRoyalties.md#constructor) + +### Properties + +- [address](CurveRoyalties.md#address) +- [contract](CurveRoyalties.md#contract) +- [contractName](CurveRoyalties.md#contractname) +- [events](CurveRoyalties.md#events) +- [version](CurveRoyalties.md#version) + +### Accessors + +- [artifactsFolder](CurveRoyalties.md#artifactsfolder) +- [circuitsFolder](CurveRoyalties.md#circuitsfolder) +- [config](CurveRoyalties.md#config) +- [instanceConfig](CurveRoyalties.md#instanceconfig) +- [instantiableConfig](CurveRoyalties.md#instantiableconfig) +- [logger](CurveRoyalties.md#logger) +- [nevermined](CurveRoyalties.md#nevermined) +- [web3](CurveRoyalties.md#web3) + +### Methods + +- [call](CurveRoyalties.md#call) +- [getFromAddress](CurveRoyalties.md#getfromaddress) +- [getInputsOfMethod](CurveRoyalties.md#getinputsofmethod) +- [getRoyalty](CurveRoyalties.md#getroyalty) +- [getSignatureOfMethod](CurveRoyalties.md#getsignatureofmethod) +- [init](CurveRoyalties.md#init) +- [send](CurveRoyalties.md#send) +- [sendFrom](CurveRoyalties.md#sendfrom) +- [setInstanceConfig](CurveRoyalties.md#setinstanceconfig) +- [setRoyalty](CurveRoyalties.md#setroyalty) +- [getInstance](CurveRoyalties.md#getinstance) +- [setInstanceConfig](CurveRoyalties.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new CurveRoyalties**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[constructor](RoyaltyScheme.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[address](RoyaltyScheme.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[contract](RoyaltyScheme.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[contractName](RoyaltyScheme.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[events](RoyaltyScheme.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[version](RoyaltyScheme.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RoyaltyScheme.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RoyaltyScheme.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +RoyaltyScheme.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RoyaltyScheme.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RoyaltyScheme.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +RoyaltyScheme.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +RoyaltyScheme.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +RoyaltyScheme.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[call](RoyaltyScheme.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getFromAddress](RoyaltyScheme.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getInputsOfMethod](RoyaltyScheme.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getRoyalty + +▸ **getRoyalty**(`did`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getRoyalty](RoyaltyScheme.md#getroyalty) + +#### Defined in + +[src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts#L26) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getSignatureOfMethod](RoyaltyScheme.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[init](RoyaltyScheme.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[send](RoyaltyScheme.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[sendFrom](RoyaltyScheme.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[setInstanceConfig](RoyaltyScheme.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### setRoyalty + +▸ **setRoyalty**(`did`, `amount`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `did` | `string` | +| `amount` | `number` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[setRoyalty](RoyaltyScheme.md#setroyalty) + +#### Defined in + +[src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts#L22) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`CurveRoyalties`](CurveRoyalties.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`CurveRoyalties`](CurveRoyalties.md)\> + +#### Overrides + +[RoyaltyScheme](RoyaltyScheme.md).[getInstance](RoyaltyScheme.md#getinstance) + +#### Defined in + +[src/keeper/contracts/royalties/CurveRoyalties.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/CurveRoyalties.ts#L5) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[setInstanceConfig](RoyaltyScheme.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/CustomToken.md b/docs/api-reference/classes/CustomToken.md new file mode 100644 index 000000000..b2c8d3efb --- /dev/null +++ b/docs/api-reference/classes/CustomToken.md @@ -0,0 +1,788 @@ +[@nevermined-io/sdk](../code-reference.md) / CustomToken + +# Class: CustomToken + +## Hierarchy + +- [`Token`](Token.md) + + ↳ **`CustomToken`** + +## Table of contents + +### Constructors + +- [constructor](CustomToken.md#constructor) + +### Properties + +- [address](CustomToken.md#address) +- [contract](CustomToken.md#contract) +- [contractName](CustomToken.md#contractname) +- [events](CustomToken.md#events) +- [version](CustomToken.md#version) +- [ERC20_ABI](CustomToken.md#erc20_abi) + +### Accessors + +- [artifactsFolder](CustomToken.md#artifactsfolder) +- [circuitsFolder](CustomToken.md#circuitsfolder) +- [config](CustomToken.md#config) +- [instanceConfig](CustomToken.md#instanceconfig) +- [instantiableConfig](CustomToken.md#instantiableconfig) +- [logger](CustomToken.md#logger) +- [nevermined](CustomToken.md#nevermined) +- [web3](CustomToken.md#web3) + +### Methods + +- [approve](CustomToken.md#approve) +- [balanceOf](CustomToken.md#balanceof) +- [balanceOfConverted](CustomToken.md#balanceofconverted) +- [call](CustomToken.md#call) +- [decimals](CustomToken.md#decimals) +- [getFromAddress](CustomToken.md#getfromaddress) +- [getInputsOfMethod](CustomToken.md#getinputsofmethod) +- [getSignatureOfMethod](CustomToken.md#getsignatureofmethod) +- [init](CustomToken.md#init) +- [name](CustomToken.md#name) +- [send](CustomToken.md#send) +- [sendFrom](CustomToken.md#sendfrom) +- [setInstanceConfig](CustomToken.md#setinstanceconfig) +- [strBalanceOf](CustomToken.md#strbalanceof) +- [symbol](CustomToken.md#symbol) +- [totalSupply](CustomToken.md#totalsupply) +- [transfer](CustomToken.md#transfer) +- [getInstance](CustomToken.md#getinstance) +- [getInstanceByAddress](CustomToken.md#getinstancebyaddress) +- [setInstanceConfig](CustomToken.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new CustomToken**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[Token](Token.md).[constructor](Token.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[Token](Token.md).[address](Token.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[Token](Token.md).[contract](Token.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[Token](Token.md).[contractName](Token.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[Token](Token.md).[events](Token.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[Token](Token.md).[version](Token.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +--- + +### ERC20_ABI + +▪ `Static` **ERC20_ABI**: `string`[] + +#### Inherited from + +[Token](Token.md).[ERC20_ABI](Token.md#erc20_abi) + +#### Defined in + +[src/keeper/contracts/Token.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L7) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Token.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Token.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Token.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Token.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Token.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Token.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Token.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Token.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### approve + +▸ **approve**(`to`, `price`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `to` | `string` | +| `price` | `bigint` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Token](Token.md).[approve](Token.md#approve) + +#### Defined in + +[src/keeper/contracts/Token.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L27) + +--- + +### balanceOf + +▸ **balanceOf**(`address`): `Promise`<`bigint`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<`bigint`\> + +#### Inherited from + +[Token](Token.md).[balanceOf](Token.md#balanceof) + +#### Defined in + +[src/keeper/contracts/Token.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L43) + +--- + +### balanceOfConverted + +▸ **balanceOfConverted**(`address`): `Promise`<`bigint`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<`bigint`\> + +#### Inherited from + +[Token](Token.md).[balanceOfConverted](Token.md#balanceofconverted) + +#### Defined in + +[src/keeper/contracts/Token.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L35) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[Token](Token.md).[call](Token.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### decimals + +▸ **decimals**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +#### Inherited from + +[Token](Token.md).[decimals](Token.md#decimals) + +#### Defined in + +[src/keeper/contracts/Token.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L31) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Token](Token.md).[getFromAddress](Token.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[Token](Token.md).[getInputsOfMethod](Token.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[Token](Token.md).[getSignatureOfMethod](Token.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[Token](Token.md).[init](Token.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### name + +▸ **name**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Token](Token.md).[name](Token.md#name) + +#### Defined in + +[src/keeper/contracts/Token.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L51) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Token](Token.md).[send](Token.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Token](Token.md).[sendFrom](Token.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Token](Token.md).[setInstanceConfig](Token.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### strBalanceOf + +▸ **strBalanceOf**(`address`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Token](Token.md).[strBalanceOf](Token.md#strbalanceof) + +#### Defined in + +[src/keeper/contracts/Token.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L39) + +--- + +### symbol + +▸ **symbol**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Token](Token.md).[symbol](Token.md#symbol) + +#### Defined in + +[src/keeper/contracts/Token.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L47) + +--- + +### totalSupply + +▸ **totalSupply**(): `Promise`<`bigint`\> + +#### Returns + +`Promise`<`bigint`\> + +#### Inherited from + +[Token](Token.md).[totalSupply](Token.md#totalsupply) + +#### Defined in + +[src/keeper/contracts/Token.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L55) + +--- + +### transfer + +▸ **transfer**(`to`, `amount`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `to` | `string` | +| `amount` | `bigint` | +| `from` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Token](Token.md).[transfer](Token.md#transfer) + +#### Defined in + +[src/keeper/contracts/Token.ts:59](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L59) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`Token`](Token.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`Token`](Token.md)\> + +#### Inherited from + +[Token](Token.md).[getInstance](Token.md#getinstance) + +#### Defined in + +[src/keeper/contracts/Token.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L21) + +--- + +### getInstanceByAddress + +▸ `Static` **getInstanceByAddress**(`config`, `address`): `Promise`<[`CustomToken`](CustomToken.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | +| `address` | `string` | + +#### Returns + +`Promise`<[`CustomToken`](CustomToken.md)\> + +#### Defined in + +[src/keeper/contracts/CustomToken.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/CustomToken.ts#L7) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Token](Token.md).[setInstanceConfig](Token.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/DDO.md b/docs/api-reference/classes/DDO.md index 23ebb43a6..932d314e7 100644 --- a/docs/api-reference/classes/DDO.md +++ b/docs/api-reference/classes/DDO.md @@ -22,6 +22,7 @@ Contains all the data related to an asset. - [proof](DDO.md#proof) - [publicKey](DDO.md#publickey) - [service](DDO.md#service) +- [updated](DDO.md#updated) ### Methods @@ -31,15 +32,38 @@ Contains all the data related to an asset. - [addSignature](DDO.md#addsignature) - [assignDid](DDO.md#assigndid) - [checksum](DDO.md#checksum) -- [findServiceById](DDO.md#findservicebyid) +- [findServiceByIndex](DDO.md#findservicebyindex) +- [findServiceByReference](DDO.md#findservicebyreference) - [findServiceByType](DDO.md#findservicebytype) - [generateDidSeed](DDO.md#generatedidseed) - [generateProof](DDO.md#generateproof) +- [getAssetPriceFromDDOByServiceType](DDO.md#getassetpricefromddobyservicetype) - [getPriceByService](DDO.md#getpricebyservice) +- [getProofChecksum](DDO.md#getproofchecksum) +- [getServicesByType](DDO.md#getservicesbytype) +- [reorderServices](DDO.md#reorderservices) +- [replaceService](DDO.md#replaceservice) +- [serviceExists](DDO.md#serviceexists) +- [serviceIndexExists](DDO.md#serviceindexexists) +- [setAssetPriceFromDDOByService](DDO.md#setassetpricefromddobyservice) +- [setNFTRewardsFromService](DDO.md#setnftrewardsfromservice) - [shortId](DDO.md#shortid) +- [updateMetadataService](DDO.md#updatemetadataservice) - [updateService](DDO.md#updateservice) +- [createAuthorizationService](DDO.md#createauthorizationservice) - [deserialize](DDO.md#deserialize) +- [findAndReplaceDDOAttribute](DDO.md#findandreplaceddoattribute) +- [findServiceConditionByName](DDO.md#findserviceconditionbyname) +- [getAssetPriceFromService](DDO.md#getassetpricefromservice) +- [getDIDFromService](DDO.md#getdidfromservice) +- [getDurationFromService](DDO.md#getdurationfromservice) - [getInstance](DDO.md#getinstance) +- [getNFTTransferFromService](DDO.md#getnfttransferfromservice) +- [getNftAmountFromService](DDO.md#getnftamountfromservice) +- [getNftContractAddressFromService](DDO.md#getnftcontractaddressfromservice) +- [getNftHolderFromService](DDO.md#getnftholderfromservice) +- [getParameterFromCondition](DDO.md#getparameterfromcondition) +- [getTokenIdFromService](DDO.md#gettokenidfromservice) - [serialize](DDO.md#serialize) ## Constructors @@ -56,7 +80,7 @@ Contains all the data related to an asset. #### Defined in -[src/ddo/DDO.ts:62](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L62) +[src/ddo/DDO.ts:100](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L100) ## Properties @@ -66,27 +90,27 @@ Contains all the data related to an asset. #### Defined in -[src/ddo/DDO.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L41) +[src/ddo/DDO.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L77) --- ### \_nvm -• **\_nvm**: `NvmConfig` +• **\_nvm**: [`NvmConfig`](../interfaces/NvmConfig.md) #### Defined in -[src/ddo/DDO.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L50) +[src/ddo/DDO.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L86) --- ### authentication -• **authentication**: `Authentication`[] = `[]` +• **authentication**: [`Authentication`](../interfaces/Authentication.md)[] = `[]` #### Defined in -[src/ddo/DDO.ts:56](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L56) +[src/ddo/DDO.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L94) --- @@ -96,7 +120,7 @@ Contains all the data related to an asset. #### Defined in -[src/ddo/DDO.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L52) +[src/ddo/DDO.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L88) --- @@ -106,7 +130,7 @@ Contains all the data related to an asset. #### Defined in -[src/ddo/DDO.ts:48](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L48) +[src/ddo/DDO.ts:84](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L84) --- @@ -118,58 +142,72 @@ DID, decentralizes ID. #### Defined in -[src/ddo/DDO.ts:46](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L46) +[src/ddo/DDO.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L82) --- ### proof -• **proof**: `Proof` +• **proof**: [`Proof`](../interfaces/Proof.md) #### Defined in -[src/ddo/DDO.ts:60](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L60) +[src/ddo/DDO.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L98) --- ### publicKey -• **publicKey**: `PublicKey`[] = `[]` +• **publicKey**: [`PublicKey`](../interfaces/PublicKey.md)[] = `[]` #### Defined in -[src/ddo/DDO.ts:54](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L54) +[src/ddo/DDO.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L92) --- ### service -• **service**: `ServiceCommon`[] = `[]` +• **service**: [`ServiceCommon`](../interfaces/ServiceCommon.md)[] = `[]` #### Defined in -[src/ddo/DDO.ts:58](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L58) +[src/ddo/DDO.ts:96](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L96) + +--- + +### updated + +• `Optional` **updated**: `string` + +#### Defined in + +[src/ddo/DDO.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L90) ## Methods ### addDefaultMetadataService -▸ **addDefaultMetadataService**(`metadata`, `nftAttributes?`): `Promise`<[`MetaDataMain`](../interfaces/MetaDataMain.md)\> +▸ **addDefaultMetadataService**(`metadata`, `nftAttributes?`): [`MetaDataMain`](../interfaces/MetaDataMain.md) + +Adds a default metadata service to the DDO. #### Parameters -| Name | Type | -| :--------------- | :-------------------------------------- | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | -| `nftAttributes?` | `NFTAttributes` | +| Name | Type | Description | +| :--------------- | :-------------------------------------- | :------------- | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | metadata | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | nft attributes | #### Returns -`Promise`<[`MetaDataMain`](../interfaces/MetaDataMain.md)\> +[`MetaDataMain`](../interfaces/MetaDataMain.md) + +main metadata attributes #### Defined in -[src/ddo/DDO.ts:199](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L199) +[src/ddo/DDO.ts:322](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L322) --- @@ -189,31 +227,33 @@ Generates and adds a proof using personal sign on the DDO. `Promise`<`void`\> -Proof object. +void. #### Defined in -[src/ddo/DDO.ts:188](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L188) +[src/ddo/DDO.ts:272](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L272) --- ### addService -▸ **addService**(`service`): `Promise`<`void`\> +▸ **addService**(`service`): `void` + +Adds a service to the DDO. #### Parameters -| Name | Type | -| :-------- | :---- | -| `service` | `any` | +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | #### Returns -`Promise`<`void`\> +`void` #### Defined in -[src/ddo/DDO.ts:195](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L195) +[src/ddo/DDO.ts:294](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L294) --- @@ -221,12 +261,14 @@ Proof object. ▸ **addSignature**(`nevermined`, `publicKey`): `Promise`<`void`\> +It adds a signature to the the proof object of the DDO + #### Parameters -| Name | Type | -| :----------- | :---------------------------- | -| `nevermined` | [`Nevermined`](Nevermined.md) | -| `publicKey` | `string` | +| Name | Type | Description | +| :----------- | :---------------------------- | :------------------------- | +| `nevermined` | [`Nevermined`](Nevermined.md) | nevermined object | +| `publicKey` | `string` | public key to sign the DDO | #### Returns @@ -234,7 +276,7 @@ Proof object. #### Defined in -[src/ddo/DDO.ts:250](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L250) +[src/ddo/DDO.ts:404](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L404) --- @@ -242,13 +284,15 @@ Proof object. ▸ **assignDid**(`didSeed`, `didRegistry`, `publisher`): `Promise`<`void`\> +Assign a DID to the DDO + #### Parameters -| Name | Type | -| :------------ | :---------------------- | -| `didSeed` | `string` | -| `didRegistry` | `default` | -| `publisher` | [`Account`](Account.md) | +| Name | Type | Description | +| :------------ | :------------------------------ | :-------------------------- | +| `didSeed` | `string` | DID seed | +| `didRegistry` | [`DIDRegistry`](DIDRegistry.md) | DIDRegistry contract | +| `publisher` | [`Account`](Account.md) | account registering the DID | #### Returns @@ -256,7 +300,7 @@ Proof object. #### Defined in -[src/ddo/DDO.ts:234](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L234) +[src/ddo/DDO.ts:382](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L382) --- @@ -276,71 +320,101 @@ Proof object. #### Defined in -[src/ddo/DDO.ts:156](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L156) +[src/ddo/DDO.ts:234](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L234) --- -### findServiceById +### findServiceByIndex -▸ **findServiceById**<`T`\>(`index`): `Service`<`T`\> +▸ **findServiceByIndex**<`T`\>(`index`): [`Service`](../code-reference.md#service)<`T`\> Finds a service of a DDO by index. #### Type parameters -| Name | Type | -| :--- | :-------------------- | -| `T` | extends `ServiceType` | +| Name | Type | +| :--- | :-------------------------------------------------------- | +| `T` | extends [`ServiceType`](../code-reference.md#servicetype) | #### Parameters -| Name | Type | Description | -| :------ | :------- | :---------- | -| `index` | `number` | index. | +| Name | Type | Description | +| :------ | :------- | :------------------------------- | +| `index` | `number` | index of the service in the DDO. | #### Returns -`Service`<`T`\> +[`Service`](../code-reference.md#service)<`T`\> Service. #### Defined in -[src/ddo/DDO.ts:106](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L106) +[src/ddo/DDO.ts:139](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L139) --- -### findServiceByType +### findServiceByReference -▸ **findServiceByType**<`T`\>(`serviceType`): `Service`<`T`\> +▸ **findServiceByReference**<`T`\>(`serviceReference`): [`Service`](../code-reference.md#service)<`T`\> -Finds a service of a DDO by type. +Finds a service of a DDO by index. -**`Throws`** +#### Type parameters + +| Name | Type | +| :--- | :-------------------------------------------------------- | +| `T` | extends [`ServiceType`](../code-reference.md#servicetype) | + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------------------------------- | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | reference to the service (index or type). | + +#### Returns -DDOServiceNotFoundError If the service is not in the DDO. +[`Service`](../code-reference.md#service)<`T`\> + +Service. + +#### Defined in + +[src/ddo/DDO.ts:173](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L173) + +--- + +### findServiceByType + +▸ **findServiceByType**<`T`\>(`serviceType`): [`Service`](../code-reference.md#service)<`T`\> + +Finds the first service of a DDO by type. #### Type parameters -| Name | Type | -| :--- | :-------------------- | -| `T` | extends `ServiceType` | +| Name | Type | +| :--- | :-------------------------------------------------------- | +| `T` | extends [`ServiceType`](../code-reference.md#servicetype) | #### Parameters -| Name | Type | Description | -| :------------ | :--- | :------------ | -| `serviceType` | `T` | Service type. | +| Name | Type | Description | +| :------------ | :--- | :------------------------------------ | +| `serviceType` | `T` | Service type used by find the service | #### Returns -`Service`<`T`\> +[`Service`](../code-reference.md#service)<`T`\> + +[Service](../code-reference.md#service). -[Service](../interfaces/Service.md). +**`Throws`** + +[DDOServiceNotFoundError](DDOServiceNotFoundError.md) If the service is not in the DDO. #### Defined in -[src/ddo/DDO.ts:126](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L126) +[src/ddo/DDO.ts:159](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L159) --- @@ -348,25 +422,29 @@ DDOServiceNotFoundError If the service is not in the DDO. ▸ **generateDidSeed**(`seed`): `Promise`<`string`\> +It generates a DID seed from a seed + #### Parameters -| Name | Type | -| :----- | :---- | -| `seed` | `any` | +| Name | Type | Description | +| :----- | :---- | :---------- | +| `seed` | `any` | the seed | #### Returns `Promise`<`string`\> +the string represeing the DID seed + #### Defined in -[src/ddo/DDO.ts:246](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L246) +[src/ddo/DDO.ts:395](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L395) --- ### generateProof -▸ **generateProof**(`publicKey`): `Promise`<`Proof`\> +▸ **generateProof**(`publicKey`): `Promise`<[`Proof`](../interfaces/Proof.md)\> Generates proof using personal sign. @@ -378,22 +456,58 @@ Generates proof using personal sign. #### Returns -`Promise`<`Proof`\> +`Promise`<[`Proof`](../interfaces/Proof.md)\> Proof object. #### Defined in -[src/ddo/DDO.ts:167](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L167) +[src/ddo/DDO.ts:243](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L243) + +--- + +### getAssetPriceFromDDOByServiceType + +▸ **getAssetPriceFromDDOByServiceType**(`service`): [`AssetPrice`](AssetPrice.md) + +It gets the AssetPrice from a service given the serviceType + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceType`](../code-reference.md#servicetype) | the service to search in | + +#### Returns + +[`AssetPrice`](AssetPrice.md) + +the AssetPrice object + +#### Defined in + +[src/ddo/DDO.ts:552](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L552) --- ### getPriceByService -▸ **getPriceByService**(`serviceType?`): `default` +▸ **getPriceByService**(`serviceType?`): `bigint` Get the total price of a service. +#### Parameters + +| Name | Type | Default value | Description | +| :------------ | :------------------------------------------------ | :------------ | :----------- | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | `'access'` | Service type | + +#### Returns + +`bigint` + +bigint + **`Example`** ```ts @@ -402,23 +516,199 @@ const price = ddo.getPriceByService('nft-access') **`Throws`** -DDOPriceNotFoundError +[DDOPriceNotFoundError](DDOPriceNotFoundError.md) + +#### Defined in + +[src/ddo/DDO.ts:224](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L224) + +--- + +### getProofChecksum + +▸ **getProofChecksum**(): `string` + +Get the checksum of the proof. + +#### Returns + +`string` + +string containing the checksum of the proof. + +#### Defined in + +[src/ddo/DDO.ts:263](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L263) + +--- + +### getServicesByType + +▸ **getServicesByType**<`T`\>(`serviceType`): [`Service`](../code-reference.md#service)<`T`\>[] + +Gets all the services of a DDO with a specific type. + +#### Type parameters + +| Name | Type | +| :--- | :-------------------------------------------------------- | +| `T` | extends [`ServiceType`](../code-reference.md#servicetype) | #### Parameters -| Name | Type | Default value | Description | -| :------------ | :------------ | :------------ | :----------- | -| `serviceType` | `ServiceType` | `'access'` | Service type | +| Name | Type | Description | +| :------------ | :--- | :------------ | +| `serviceType` | `T` | Service type. | #### Returns -`default` +[`Service`](../code-reference.md#service)<`T`\>[] -BigNumber +[Service](../code-reference.md#service). #### Defined in -[src/ddo/DDO.ts:146](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L146) +[src/ddo/DDO.ts:189](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L189) + +--- + +### reorderServices + +▸ **reorderServices**(): `void` + +It reorders the services of the DDO using the service index + +#### Returns + +`void` + +#### Defined in + +[src/ddo/DDO.ts:282](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L282) + +--- + +### replaceService + +▸ **replaceService**(`index`, `service`): `void` + +Replaces a service in the DDO. + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `index` | `number` | +| `service` | `any` | + +#### Returns + +`void` + +#### Defined in + +[src/ddo/DDO.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L310) + +--- + +### serviceExists + +▸ **serviceExists**<`T`\>(`serviceType`): `boolean` + +Checks if a service exists in the DDO. + +#### Type parameters + +| Name | Type | +| :--- | :-------------------------------------------------------- | +| `T` | extends [`ServiceType`](../code-reference.md#servicetype) | + +#### Parameters + +| Name | Type | Description | +| :------------ | :--- | :------------ | +| `serviceType` | `T` | Service type. | + +#### Returns + +`boolean` + +true if service exists. + +#### Defined in + +[src/ddo/DDO.ts:199](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L199) + +--- + +### serviceIndexExists + +▸ **serviceIndexExists**(`serviceIndex`): `boolean` + +Checks if a service index in the DDO. + +#### Parameters + +| Name | Type | Description | +| :------------- | :------- | :------------- | +| `serviceIndex` | `number` | Service index. | + +#### Returns + +`boolean` + +true if service exists. + +#### Defined in + +[src/ddo/DDO.ts:209](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L209) + +--- + +### setAssetPriceFromDDOByService + +▸ **setAssetPriceFromDDOByService**(`serviceType`, `rewards`): `void` + +Given a service type, it sets the AssetPrice in the escrowPayment condition + +#### Parameters + +| Name | Type | Description | +| :------------ | :------------------------------------------------ | :--------------------------- | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | the service to search in | +| `rewards` | [`AssetPrice`](AssetPrice.md) | the AssetPrice object to set | + +#### Returns + +`void` + +#### Defined in + +[src/ddo/DDO.ts:562](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L562) + +--- + +### setNFTRewardsFromService + +▸ **setNFTRewardsFromService**(`serviceType`, `rewards`, `holderAddress`): `DDOConditionNotFoundError` + +Given the service type it sets the AssetPrice and NFT holder + +#### Parameters + +| Name | Type | Description | +| :-------------- | :------------------------------------------------ | :---------------------------- | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | the service type to search in | +| `rewards` | [`AssetPrice`](AssetPrice.md) | the AssetPrice object to set | +| `holderAddress` | `string` | the NFT Holder address to set | + +#### Returns + +`DDOConditionNotFoundError` + +#### Defined in + +[src/ddo/DDO.ts:585](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L585) --- @@ -432,28 +722,77 @@ BigNumber #### Defined in -[src/ddo/DDO.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L97) +[src/ddo/DDO.ts:130](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L130) + +--- + +### updateMetadataService + +▸ **updateMetadataService**(`service`): `void` + +Updates a service in the DDO + +#### Parameters + +| Name | Type | Description | +| :-------- | :---- | :------------------------ | +| `service` | `any` | the service to be updated | + +#### Returns + +`void` + +#### Defined in + +[src/ddo/DDO.ts:368](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L368) --- ### updateService -▸ **updateService**(`nevermined`, `service`): `Promise`<`void`\> +▸ **updateService**(`service`, `serviceIndex?`): `void` #### Parameters -| Name | Type | -| :----------- | :---------------------------- | -| `nevermined` | [`Nevermined`](Nevermined.md) | -| `service` | `any` | +| Name | Type | Default value | Description | +| :------------- | :------- | :------------ | :---------------------------------------------------- | +| `service` | `any` | `undefined` | the service to be updated | +| `serviceIndex` | `number` | `0` | the position of the service in the DDO.services array | #### Returns -`Promise`<`void`\> +`void` + +**`Deprecated`** + +use the `updateMetadataService` or `replaceService` methods instead +Updates a service in the DDO + +#### Defined in + +[src/ddo/DDO.ts:359](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L359) + +--- + +### createAuthorizationService + +▸ `Static` **createAuthorizationService**(`neverminedNodeUri`, `publicKey`, `method`): [`ServiceCommon`](../interfaces/ServiceCommon.md) + +#### Parameters + +| Name | Type | +| :------------------ | :------- | +| `neverminedNodeUri` | `string` | +| `publicKey` | `string` | +| `method` | `string` | + +#### Returns + +[`ServiceCommon`](../interfaces/ServiceCommon.md) #### Defined in -[src/ddo/DDO.ts:230](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L230) +[src/ddo/DDO.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L58) --- @@ -477,7 +816,130 @@ The deserialized [DDO](DDO.md). #### Defined in -[src/ddo/DDO.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L35) +[src/ddo/DDO.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L52) + +--- + +### findAndReplaceDDOAttribute + +▸ `Static` **findAndReplaceDDOAttribute**(`ddo`, `paramName`, `value`): [`DDO`](DDO.md) + +Finds an attribute in the DDO and replace it with the given value + +#### Parameters + +| Name | Type | Description | +| :---------- | :-------------- | :------------------------ | +| `ddo` | [`DDO`](DDO.md) | the originial DDO | +| `paramName` | `string` | the param name to replace | +| `value` | `string` | the new value | + +#### Returns + +[`DDO`](DDO.md) + +the DDO with the replaced attribute + +#### Defined in + +[src/ddo/DDO.ts:606](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L606) + +--- + +### findServiceConditionByName + +▸ `Static` **findServiceConditionByName**(`service`, `name`): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md) + +If fins a service condition by name + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------------------------------------- | :------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | +| `name` | [`ConditionType`](../code-reference.md#conditiontype) | the name of the condition | + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md) + +ServiceAgreementTemplateCondition the condition + +#### Defined in + +[src/ddo/DDO.ts:416](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L416) + +--- + +### getAssetPriceFromService + +▸ `Static` **getAssetPriceFromService**(`service`): [`AssetPrice`](AssetPrice.md) + +It gets the AssetPrice from a service with escrowPayment condition + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | + +#### Returns + +[`AssetPrice`](AssetPrice.md) + +the AssetPrice object + +#### Defined in + +[src/ddo/DDO.ts:529](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L529) + +--- + +### getDIDFromService + +▸ `Static` **getDIDFromService**(`service`): `string` + +Gets the DID in the escrowPayment condition of the service + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | + +#### Returns + +`string` + +the DID + +#### Defined in + +[src/ddo/DDO.ts:432](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L432) + +--- + +### getDurationFromService + +▸ `Static` **getDurationFromService**(`service`): `number` + +Gets the duration parameter in the transferNFT condition of the service + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | + +#### Returns + +`number` + +the duration of the subscription + +#### Defined in + +[src/ddo/DDO.ts:486](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L486) --- @@ -499,7 +961,153 @@ The deserialized [DDO](DDO.md). #### Defined in -[src/ddo/DDO.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L69) +[src/ddo/DDO.ts:106](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L106) + +--- + +### getNFTTransferFromService + +▸ `Static` **getNFTTransferFromService**(`service`): `boolean` + +Gets the nftTransfer parameter in the transferNFT condition of the service + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | + +#### Returns + +`boolean` + +if condition will do a nft transfer or a mint + +#### Defined in + +[src/ddo/DDO.ts:475](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L475) + +--- + +### getNftAmountFromService + +▸ `Static` **getNftAmountFromService**(`service`): `bigint` + +Gets the number of NFTs in the transferNFT condition of the service + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | + +#### Returns + +`bigint` + +the number of NFTs + +#### Defined in + +[src/ddo/DDO.ts:463](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L463) + +--- + +### getNftContractAddressFromService + +▸ `Static` **getNftContractAddressFromService**(`service`): `string` + +Gets the NFT Contract address used in the NFT Access or NFT Sales service + +#### Parameters + +| Name | Type | Description | +| :-------- | :--------------------------------------------------------------------------------------------------------------- | :----------------------- | +| `service` | [`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md) \| [`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) | the service to search in | + +#### Returns + +`string` + +the NFT contract address + +#### Defined in + +[src/ddo/DDO.ts:515](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L515) + +--- + +### getNftHolderFromService + +▸ `Static` **getNftHolderFromService**(`service`): `string` + +Gets the NFT Holder in the transferNFT condition of the service + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | + +#### Returns + +`string` + +the NFT Holder address + +#### Defined in + +[src/ddo/DDO.ts:442](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L442) + +--- + +### getParameterFromCondition + +▸ `Static` **getParameterFromCondition**(`service`, `conditionType`, `paramName`): `string` \| `number` \| `string`[] + +Given a service, condition and param name it returns the value + +#### Parameters + +| Name | Type | Description | +| :-------------- | :---------------------------------------------------- | :--------------------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | The service where the condition is | +| `conditionType` | [`ConditionType`](../code-reference.md#conditiontype) | the condition type | +| `paramName` | `string` | the param name | + +#### Returns + +`string` \| `number` \| `string`[] + +the value + +#### Defined in + +[src/ddo/DDO.ts:497](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L497) + +--- + +### getTokenIdFromService + +▸ `Static` **getTokenIdFromService**(`service`): `string` + +Gets the NFT TokenId in the nftHolder condition of the service + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------------------------ | :----------------------- | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | the service to search in | + +#### Returns + +`string` + +the NFT Token Id + +#### Defined in + +[src/ddo/DDO.ts:451](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L451) --- @@ -523,4 +1131,4 @@ DDO serialized. #### Defined in -[src/ddo/DDO.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/DDO.ts#L26) +[src/ddo/DDO.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L43) diff --git a/docs/api-reference/classes/DDOError.md b/docs/api-reference/classes/DDOError.md new file mode 100644 index 000000000..140f178cc --- /dev/null +++ b/docs/api-reference/classes/DDOError.md @@ -0,0 +1,170 @@ +[@nevermined-io/sdk](../code-reference.md) / DDOError + +# Class: DDOError + +## Hierarchy + +- `Error` + + ↳ **`DDOError`** + + ↳↳ [`DDOPriceNotFoundError`](DDOPriceNotFoundError.md) + + ↳↳ [`DDOServiceNotFoundError`](DDOServiceNotFoundError.md) + +## Table of contents + +### Constructors + +- [constructor](DDOError.md#constructor) + +### Properties + +- [message](DDOError.md#message) +- [name](DDOError.md#name) +- [stack](DDOError.md#stack) +- [prepareStackTrace](DDOError.md#preparestacktrace) +- [stackTraceLimit](DDOError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](DDOError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new DDOError**(`message`, `did?`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | +| `did?` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/DDOError.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/DDOError.ts#L4) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/DDOPriceNotFoundError.md b/docs/api-reference/classes/DDOPriceNotFoundError.md new file mode 100644 index 000000000..558ccb6bb --- /dev/null +++ b/docs/api-reference/classes/DDOPriceNotFoundError.md @@ -0,0 +1,166 @@ +[@nevermined-io/sdk](../code-reference.md) / DDOPriceNotFoundError + +# Class: DDOPriceNotFoundError + +## Hierarchy + +- [`DDOError`](DDOError.md) + + ↳ **`DDOPriceNotFoundError`** + +## Table of contents + +### Constructors + +- [constructor](DDOPriceNotFoundError.md#constructor) + +### Properties + +- [message](DDOPriceNotFoundError.md#message) +- [name](DDOPriceNotFoundError.md#name) +- [stack](DDOPriceNotFoundError.md#stack) +- [prepareStackTrace](DDOPriceNotFoundError.md#preparestacktrace) +- [stackTraceLimit](DDOPriceNotFoundError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](DDOPriceNotFoundError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new DDOPriceNotFoundError**(`serviceType`, `did?`) + +#### Parameters + +| Name | Type | +| :------------ | :------------------------------------------------ | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | +| `did?` | `string` | + +#### Overrides + +[DDOError](DDOError.md).[constructor](DDOError.md#constructor) + +#### Defined in + +[src/errors/DDOError.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/DDOError.ts#L42) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +[DDOError](DDOError.md).[message](DDOError.md#message) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +[DDOError](DDOError.md).[name](DDOError.md#name) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[DDOError](DDOError.md).[stack](DDOError.md#stack) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[DDOError](DDOError.md).[prepareStackTrace](DDOError.md#preparestacktrace) + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[DDOError](DDOError.md).[stackTraceLimit](DDOError.md#stacktracelimit) + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[DDOError](DDOError.md).[captureStackTrace](DDOError.md#capturestacktrace) + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/DDOServiceNotFoundError.md b/docs/api-reference/classes/DDOServiceNotFoundError.md new file mode 100644 index 000000000..a9c0f2040 --- /dev/null +++ b/docs/api-reference/classes/DDOServiceNotFoundError.md @@ -0,0 +1,166 @@ +[@nevermined-io/sdk](../code-reference.md) / DDOServiceNotFoundError + +# Class: DDOServiceNotFoundError + +## Hierarchy + +- [`DDOError`](DDOError.md) + + ↳ **`DDOServiceNotFoundError`** + +## Table of contents + +### Constructors + +- [constructor](DDOServiceNotFoundError.md#constructor) + +### Properties + +- [message](DDOServiceNotFoundError.md#message) +- [name](DDOServiceNotFoundError.md#name) +- [stack](DDOServiceNotFoundError.md#stack) +- [prepareStackTrace](DDOServiceNotFoundError.md#preparestacktrace) +- [stackTraceLimit](DDOServiceNotFoundError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](DDOServiceNotFoundError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new DDOServiceNotFoundError**(`serviceType`, `did?`) + +#### Parameters + +| Name | Type | +| :------------ | :------------------------------------------------ | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | +| `did?` | `string` | + +#### Overrides + +[DDOError](DDOError.md).[constructor](DDOError.md#constructor) + +#### Defined in + +[src/errors/DDOError.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/DDOError.ts#L18) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +[DDOError](DDOError.md).[message](DDOError.md#message) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +[DDOError](DDOError.md).[name](DDOError.md#name) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[DDOError](DDOError.md).[stack](DDOError.md#stack) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[DDOError](DDOError.md).[prepareStackTrace](DDOError.md#preparestacktrace) + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[DDOError](DDOError.md).[stackTraceLimit](DDOError.md#stacktracelimit) + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[DDOError](DDOError.md).[captureStackTrace](DDOError.md#capturestacktrace) + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/DID.md b/docs/api-reference/classes/DID.md index 39e82f65e..290374bed 100644 --- a/docs/api-reference/classes/DID.md +++ b/docs/api-reference/classes/DID.md @@ -17,9 +17,12 @@ Decentralized ID. ### Methods - [getDid](DID.md#getdid) +- [getEncoded](DID.md#getencoded) - [getId](DID.md#getid) +- [fromEncoded](DID.md#fromencoded) - [generate](DID.md#generate) - [parse](DID.md#parse) +- [parseBigInt](DID.md#parsebigint) ## Constructors @@ -35,7 +38,7 @@ Decentralized ID. #### Defined in -[src/nevermined/DID.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/DID.ts#L45) +[src/nevermined/DID.ts:83](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L83) ## Properties @@ -43,11 +46,11 @@ Decentralized ID. • `Private` **id**: `string` -ID. +Short ID. #### Defined in -[src/nevermined/DID.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/DID.ts#L43) +[src/nevermined/DID.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L81) ## Methods @@ -55,7 +58,7 @@ ID. ▸ **getDid**(): `string` -Returns the DID. +Returns the DID (i.e did:nv:...) #### Returns @@ -65,7 +68,25 @@ A string with the prefixed id. #### Defined in -[src/nevermined/DID.ts:53](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/DID.ts#L53) +[src/nevermined/DID.ts:91](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L91) + +--- + +### getEncoded + +▸ **getEncoded**(): `string` + +Generates an encoded string in base 36 from a DID. + +#### Returns + +`string` + +A base36 encoded string. + +#### Defined in + +[src/nevermined/DID.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L74) --- @@ -73,7 +94,7 @@ A string with the prefixed id. ▸ **getId**(): `string` -Returns the ID. +Returns the Short ID. #### Returns @@ -83,7 +104,31 @@ A string of the _id_ without the prefix. #### Defined in -[src/nevermined/DID.ts:61](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/DID.ts#L61) +[src/nevermined/DID.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L99) + +--- + +### fromEncoded + +▸ `Static` **fromEncoded**(`encoded`): [`DID`](DID.md) + +Returns a new DID from a base36 encoded string. + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :--------------------- | +| `encoded` | `string` | Base36 encoded string. | + +#### Returns + +[`DID`](DID.md) + +[DID](DID.md) + +#### Defined in + +[src/nevermined/DID.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L64) --- @@ -101,7 +146,7 @@ Returns a new DID. #### Defined in -[src/nevermined/DID.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/DID.ts#L36) +[src/nevermined/DID.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L43) --- @@ -113,9 +158,9 @@ Parses a DID from a string. #### Parameters -| Name | Type | Description | -| :---------- | :-------------------------- | :------------- | -| `didString` | `string` \| [`DID`](DID.md) | DID in string. | +| Name | Type | Description | +| :---------- | :-------------------------- | :------------------------------------------------------------------------------------------ | +| `didString` | `string` \| [`DID`](DID.md) | DID in string format or DID instance. The didString can be in did:nv: format or 0x: format. | #### Returns @@ -125,4 +170,25 @@ Parses a DID from a string. #### Defined in -[src/nevermined/DID.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/DID.ts#L14) +[src/nevermined/DID.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L14) + +--- + +### parseBigInt + +▸ `Static` **parseBigInt**(`value`, `radix?`): `any` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------- | :------------ | +| `value` | `any` | `undefined` | +| `radix` | `number` | `36` | + +#### Returns + +`any` + +#### Defined in + +[src/nevermined/DID.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/DID.ts#L47) diff --git a/docs/api-reference/classes/DIDRegistry.md b/docs/api-reference/classes/DIDRegistry.md new file mode 100644 index 000000000..d36059491 --- /dev/null +++ b/docs/api-reference/classes/DIDRegistry.md @@ -0,0 +1,1491 @@ +[@nevermined-io/sdk](../code-reference.md) / DIDRegistry + +# Class: DIDRegistry + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`DIDRegistry`** + +## Table of contents + +### Constructors + +- [constructor](DIDRegistry.md#constructor) + +### Properties + +- [address](DIDRegistry.md#address) +- [contract](DIDRegistry.md#contract) +- [contractName](DIDRegistry.md#contractname) +- [events](DIDRegistry.md#events) +- [version](DIDRegistry.md#version) + +### Accessors + +- [artifactsFolder](DIDRegistry.md#artifactsfolder) +- [circuitsFolder](DIDRegistry.md#circuitsfolder) +- [config](DIDRegistry.md#config) +- [instanceConfig](DIDRegistry.md#instanceconfig) +- [instantiableConfig](DIDRegistry.md#instantiableconfig) +- [logger](DIDRegistry.md#logger) +- [nevermined](DIDRegistry.md#nevermined) +- [web3](DIDRegistry.md#web3) + +### Methods + +- [actedOnBehalf](DIDRegistry.md#actedonbehalf) +- [addDidProvenanceDelegate](DIDRegistry.md#adddidprovenancedelegate) +- [addProvider](DIDRegistry.md#addprovider) +- [burn](DIDRegistry.md#burn) +- [call](DIDRegistry.md#call) +- [enableAndMintDidNft](DIDRegistry.md#enableandmintdidnft) +- [enableAndMintDidNft721](DIDRegistry.md#enableandmintdidnft721) +- [getAttributesByDid](DIDRegistry.md#getattributesbydid) +- [getAttributesByOwner](DIDRegistry.md#getattributesbyowner) +- [getBlockNumberUpdated](DIDRegistry.md#getblocknumberupdated) +- [getDIDOwner](DIDRegistry.md#getdidowner) +- [getDIDProvenanceEvents](DIDRegistry.md#getdidprovenanceevents) +- [getDIDProvenanceMethodEvents](DIDRegistry.md#getdidprovenancemethodevents) +- [getDIDRegister](DIDRegistry.md#getdidregister) +- [getDIDRoyalties](DIDRegistry.md#getdidroyalties) +- [getFromAddress](DIDRegistry.md#getfromaddress) +- [getInputsOfMethod](DIDRegistry.md#getinputsofmethod) +- [getNFTInfo](DIDRegistry.md#getnftinfo) +- [getPermission](DIDRegistry.md#getpermission) +- [getProvenanceEntry](DIDRegistry.md#getprovenanceentry) +- [getProvenanceOwner](DIDRegistry.md#getprovenanceowner) +- [getProviders](DIDRegistry.md#getproviders) +- [getSignatureOfMethod](DIDRegistry.md#getsignatureofmethod) +- [grantPermission](DIDRegistry.md#grantpermission) +- [grantRegistryOperatorRole](DIDRegistry.md#grantregistryoperatorrole) +- [hashDID](DIDRegistry.md#hashdid) +- [init](DIDRegistry.md#init) +- [isDIDProvider](DIDRegistry.md#isdidprovider) +- [isProvenanceDelegate](DIDRegistry.md#isprovenancedelegate) +- [mint](DIDRegistry.md#mint) +- [registerAttribute](DIDRegistry.md#registerattribute) +- [registerDID](DIDRegistry.md#registerdid) +- [registerMintableDID](DIDRegistry.md#registermintabledid) +- [registerMintableDID721](DIDRegistry.md#registermintabledid721) +- [removeDidProvenanceDelegate](DIDRegistry.md#removedidprovenancedelegate) +- [removeProvider](DIDRegistry.md#removeprovider) +- [revokePermission](DIDRegistry.md#revokepermission) +- [send](DIDRegistry.md#send) +- [sendFrom](DIDRegistry.md#sendfrom) +- [setDIDRoyalties](DIDRegistry.md#setdidroyalties) +- [setInstanceConfig](DIDRegistry.md#setinstanceconfig) +- [transferDIDOwnership](DIDRegistry.md#transferdidownership) +- [updateMetadataUrl](DIDRegistry.md#updatemetadataurl) +- [used](DIDRegistry.md#used) +- [wasAssociatedWith](DIDRegistry.md#wasassociatedwith) +- [wasDerivedFrom](DIDRegistry.md#wasderivedfrom) +- [getInstance](DIDRegistry.md#getinstance) +- [setInstanceConfig](DIDRegistry.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new DIDRegistry**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### actedOnBehalf + +▸ **actedOnBehalf**(`provId`, `did`, `delegateAgentId`, `responsibleAgentId`, `activityId`, `signatureDelegate`, `attributes`, `ownerAddress`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------- | +| `provId` | `string` | +| `did` | `string` | +| `delegateAgentId` | `string` | +| `responsibleAgentId` | `string` | +| `activityId` | `string` | +| `signatureDelegate` | `string` | +| `attributes` | `string` | +| `ownerAddress` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:533](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L533) + +--- + +### addDidProvenanceDelegate + +▸ **addDidProvenanceDelegate**(`did`, `delegateAddress`, `ownerAddress`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------- | +| `did` | `string` | +| `delegateAddress` | `string` | +| `ownerAddress` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:560](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L560) + +--- + +### addProvider + +▸ **addProvider**(`did`, `provider`, `from`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------- | :---------------------------------------------- | +| `did` | `string` | +| `provider` | `string` | +| `from` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:604](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L604) + +--- + +### burn + +▸ **burn**(`did`, `amount`, `from`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `did` | `string` | +| `amount` | `bigint` | +| `from` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:600](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L600) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### enableAndMintDidNft + +▸ **enableAndMintDidNft**(`did`, `cap`, `royalties`, `preMint`, `ownerAddress`, `nftMetadata`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It activates a NFT associated to a NFT (ERC-1155) and allows to pre-mint. This method only can be called once per DID, so if this was called +or executed before internally the method will fail. +Only use if the intention is to register a mintable asset and it was registered via `registerDID` or `registerAttribute` + +#### Parameters + +| Name | Type | Description | +| :------------- | :---------------------------------------------- | :-------------------------------------- | +| `did` | `string` | The unique identifier of the asset | +| `cap` | `number` | Max number of editions | +| `royalties` | `number` | Asset royalties in the secondary market | +| `preMint` | `boolean` | If true pre-mints the editions of NFT | +| `ownerAddress` | `string` | Address of the user registering the DID | +| `nftMetadata` | `string` | URL to the metadata describing the NFT | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:215](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L215) + +--- + +### enableAndMintDidNft721 + +▸ **enableAndMintDidNft721**(`did`, `royalties`, `preMint`, `ownerAddress`, `nftMetadata`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It activates a NFT associated to a NFT (ERC-721) and allows to pre-mint. This method only can be called once per DID, so if this was called +or executed before internally the method will fail. +Only use if the intention is to register a mintable asset and it was registered via `registerDID` or `registerAttribute` + +#### Parameters + +| Name | Type | Description | +| :------------- | :---------------------------------------------- | :-------------------------------------- | +| `did` | `string` | The unique identifier of the asset | +| `royalties` | `number` | Asset royalties in the secondary market | +| `preMint` | `boolean` | If true pre-mints the editions of NFT | +| `ownerAddress` | `string` | Address of the user registering the DID | +| `nftMetadata` | `string` | URL to the metadata describing the NFT | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:245](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L245) + +--- + +### getAttributesByDid + +▸ **getAttributesByDid**(`did`): `Promise`<{ `checksum`: `string` ; `did`: `string` ; `immutableUrl`: `string` ; `nftInitialized`: `boolean` ; `owner`: `string` ; `providers`: `string`[] ; `royalties`: `bigint` ; `serviceEndpoint`: `string` }\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<{ `checksum`: `string` ; `did`: `string` ; `immutableUrl`: `string` ; `nftInitialized`: `boolean` ; `owner`: `string` ; `providers`: `string`[] ; `royalties`: `bigint` ; `serviceEndpoint`: `string` }\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:298](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L298) + +--- + +### getAttributesByOwner + +▸ **getAttributesByOwner**(`owner`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `owner` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:273](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L273) + +--- + +### getBlockNumberUpdated + +▸ **getBlockNumberUpdated**(`did`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:265](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L265) + +--- + +### getDIDOwner + +▸ **getDIDOwner**(`did`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:261](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L261) + +--- + +### getDIDProvenanceEvents + +▸ **getDIDProvenanceEvents**(`did`): `Promise`<{ `activityId`: `string` ; `agentId`: `string` ; `agentInvolvedId`: `string` ; `attributes?`: `string` ; `blockNumberUpdated`: `number` ; `did`: `string` ; `id`: `string` ; `method`: `number` ; `provId`: `string` ; `relatedDid`: `string` }[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<{ `activityId`: `string` ; `agentId`: `string` ; `agentInvolvedId`: `string` ; `attributes?`: `string` ; `blockNumberUpdated`: `number` ; `did`: `string` ; `id`: `string` ; `method`: `number` ; `provId`: `string` ; `relatedDid`: `string` }[]\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:374](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L374) + +--- + +### getDIDProvenanceMethodEvents + +▸ **getDIDProvenanceMethodEvents**<`T`\>(`did`, `method`): `Promise`<[`ProvenanceEvent`](../code-reference.md#provenanceevent)<`T`\>[]\> + +#### Type parameters + +| Name | Type | +| :--- | :--------------------------------------------------------- | +| `T` | extends [`ProvenanceMethod`](../enums/ProvenanceMethod.md) | + +#### Parameters + +| Name | Type | +| :------- | :------- | +| `did` | `string` | +| `method` | `T` | + +#### Returns + +`Promise`<[`ProvenanceEvent`](../code-reference.md#provenanceevent)<`T`\>[]\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:409](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L409) + +--- + +### getDIDRegister + +▸ **getDIDRegister**(`did`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:617](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L617) + +--- + +### getDIDRoyalties + +▸ **getDIDRoyalties**(`did`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:351](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L351) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getNFTInfo + +▸ **getNFTInfo**(`did`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:621](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L621) + +--- + +### getPermission + +▸ **getPermission**(`did`, `grantee`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `did` | `string` | +| `grantee` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:355](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L355) + +--- + +### getProvenanceEntry + +▸ **getProvenanceEntry**(`provId`): `Promise`<[`ProvenanceRegistry`](../interfaces/ProvenanceRegistry.md)\> + +#### Parameters + +| Name | Type | +| :------- | :------- | +| `provId` | `string` | + +#### Returns + +`Promise`<[`ProvenanceRegistry`](../interfaces/ProvenanceRegistry.md)\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:458](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L458) + +--- + +### getProvenanceOwner + +▸ **getProvenanceOwner**(`did`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L592) + +--- + +### getProviders + +▸ **getProviders**(`did`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:612](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L612) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### grantPermission + +▸ **grantPermission**(`did`, `grantee`, `ownerAddress`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `did` | `string` | +| `grantee` | `string` | +| `ownerAddress` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L324) + +--- + +### grantRegistryOperatorRole + +▸ **grantRegistryOperatorRole**(`manager`, `from`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `manager` | `string` | +| `from` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:629](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L629) + +--- + +### hashDID + +▸ **hashDID**(`didSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `didSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:625](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L625) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### isDIDProvider + +▸ **isDIDProvider**(`did`, `provider`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `did` | `string` | +| `provider` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:269](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L269) + +--- + +### isProvenanceDelegate + +▸ **isProvenanceDelegate**(`did`, `delegateAddress`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `did` | `string` | +| `delegateAddress` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:588](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L588) + +--- + +### mint + +▸ **mint**(`did`, `amount`, `from`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `did` | `string` | +| `amount` | `bigint` | +| `from` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:596](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L596) + +--- + +### registerAttribute + +▸ **registerAttribute**(`did`, `checksum`, `providers`, `url`, `ownerAddress`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It registers a decentralized identifier (aka DID) in the `DIDRegistry` smart contract + +#### Parameters + +| Name | Type | Description | +| :------------- | :---------------------------------------------- | :----------------------------------------------------- | +| `did` | `string` | The unique identifier of the asset | +| `checksum` | `string` | Checksum resulted of hash the asset metadata | +| `providers` | `string`[] | List of addresses in charge of interact with the asset | +| `url` | `string` | URL to the metadata in the Metadata/Marketplace API | +| `ownerAddress` | `string` | Address of the user registering the DID | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L33) + +--- + +### registerDID + +▸ **registerDID**(`did`, `checksum`, `providers`, `ownerAddress`, `url`, `immutableUrl?`, `activityId?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It registers a decentralized identifier (aka DID) in the `DIDRegistry` smart contract + +#### Parameters + +| Name | Type | Default value | Description | +| :------------- | :---------------------------------------------- | :--------------------------------- | :------------------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The unique identifier of the asset | +| `checksum` | `string` | `undefined` | Checksum resulted of hash the asset metadata | +| `providers` | `string`[] | `undefined` | List of addresses in charge of interact with the asset | +| `ownerAddress` | `string` | `undefined` | Address of the user registering the DID | +| `url` | `string` | `undefined` | URL to the metadata in the Metadata/Marketplace API | +| `immutableUrl` | `string` | `''` | Hash or URL to the metadata stored in a immutable data store like IPFS, Filecoin, etc | +| `activityId` | `string` | `DEFAULT_REGISTRATION_ACTIVITY_ID` | Provenance identifier about the asset registration action | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L62) + +--- + +### registerMintableDID + +▸ **registerMintableDID**(`did`, `nftContractAddress`, `checksum`, `providers`, `ownerAddress`, `nftAttributes`, `url`, `immutableUrl?`, `activityId?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It registers a decentralized identifier (aka DID) in the `DIDRegistry` smart contract with a ERC-1155 NFT attached to it + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------- | :---------------------------------------------- | :--------------------------------- | :------------------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The unique identifier of the asset | +| `nftContractAddress` | `string` | `undefined` | - | +| `checksum` | `string` | `undefined` | Checksum resulted of hash the asset metadata | +| `providers` | `string`[] | `undefined` | List of addresses in charge of interact with the asset | +| `ownerAddress` | `string` | `undefined` | Address of the user registering the DID | +| `nftAttributes` | [`NFTAttributes`](NFTAttributes.md) | `undefined` | Attributes of the NFT associated to the NFT | +| `url` | `string` | `undefined` | URL to the metadata in the Metadata/Marketplace API | +| `immutableUrl` | `string` | `''` | Hash or URL to the metadata stored in a immutable data store like IPFS, Filecoin, etc | +| `activityId` | `string` | `DEFAULT_REGISTRATION_ACTIVITY_ID` | Provenance identifier about the asset registration action | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L94) + +--- + +### registerMintableDID721 + +▸ **registerMintableDID721**(`did`, `nftContractAddress`, `checksum`, `providers`, `ownerAddress`, `nftAttributes`, `url`, `immutableUrl?`, `activityId?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It registers a decentralized identifier (aka DID) in the `DIDRegistry` smart contract with a ERC-721 NFT attached to it + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------- | :---------------------------------------------- | :--------------------------------- | :------------------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The unique identifier of the asset | +| `nftContractAddress` | `string` | `undefined` | - | +| `checksum` | `string` | `undefined` | Checksum resulted of hash the asset metadata | +| `providers` | `string`[] | `undefined` | List of addresses in charge of interact with the asset | +| `ownerAddress` | `string` | `undefined` | Address of the user registering the DID | +| `nftAttributes` | [`NFTAttributes`](NFTAttributes.md) | `undefined` | Attributes of the NFT associated to the NFT | +| `url` | `string` | `undefined` | URL to the metadata in the Metadata/Marketplace API | +| `immutableUrl` | `string` | `''` | Hash or URL to the metadata stored in a immutable data store like IPFS, Filecoin, etc | +| `activityId` | `string` | `DEFAULT_REGISTRATION_ACTIVITY_ID` | Provenance identifier about the asset registration action | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L142) + +--- + +### removeDidProvenanceDelegate + +▸ **removeDidProvenanceDelegate**(`did`, `delegateAddress`, `ownerAddress`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------- | +| `did` | `string` | +| `delegateAddress` | `string` | +| `ownerAddress` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:574](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L574) + +--- + +### removeProvider + +▸ **removeProvider**(`did`, `provider`, `from`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------- | :---------------------------------------------- | +| `did` | `string` | +| `provider` | `string` | +| `from` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:608](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L608) + +--- + +### revokePermission + +▸ **revokePermission**(`did`, `grantee`, `ownerAddress`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `did` | `string` | +| `grantee` | `string` | +| `ownerAddress` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:333](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L333) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setDIDRoyalties + +▸ **setDIDRoyalties**(`did`, `scheme`, `ownerAddress`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `did` | `string` | +| `scheme` | `string` | +| `ownerAddress` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:342](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L342) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transferDIDOwnership + +▸ **transferDIDOwnership**(`did`, `newOwnerAddress`, `ownerAddress`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------- | +| `did` | `string` | +| `newOwnerAddress` | `string` | +| `ownerAddress` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:359](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L359) + +--- + +### updateMetadataUrl + +▸ **updateMetadataUrl**(`did`, `checksum`, `ownerAddress`, `url`, `immutableUrl?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It registers a decentralized identifier (aka DID) in the `DIDRegistry` smart contract with a ERC-721 NFT attached to it + +#### Parameters + +| Name | Type | Default value | Description | +| :------------- | :---------------------------------------------- | :------------ | :------------------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The unique identifier of the asset | +| `checksum` | `string` | `undefined` | Checksum resulted of hash the asset metadata | +| `ownerAddress` | `string` | `undefined` | Address of the user registering the DID | +| `url` | `string` | `undefined` | URL to the metadata in the Metadata/Marketplace API | +| `immutableUrl` | `string` | `''` | Hash or URL to the metadata stored in a immutable data store like IPFS, Filecoin, etc | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:185](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L185) + +--- + +### used + +▸ **used**(`provId`, `did`, `agentId`, `activityId`, `signatureUsing`, `attributes`, `ownerAddress`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `provId` | `string` | +| `did` | `string` | +| `agentId` | `string` | +| `activityId` | `string` | +| `signatureUsing` | `string` | +| `attributes` | `string` | +| `ownerAddress` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:466](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L466) + +--- + +### wasAssociatedWith + +▸ **wasAssociatedWith**(`provId`, `did`, `agentId`, `activityId`, `attributes`, `ownerAddress`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `provId` | `string` | +| `did` | `string` | +| `agentId` | `string` | +| `activityId` | `string` | +| `attributes` | `string` | +| `ownerAddress` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:516](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L516) + +--- + +### wasDerivedFrom + +▸ **wasDerivedFrom**(`provId`, `newEntityDid`, `usedEntityDid`, `agentId`, `activityId`, `attributes`, `ownerAddress`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `provId` | `string` | +| `newEntityDid` | `string` | +| `usedEntityDid` | `string` | +| `agentId` | `string` | +| `activityId` | `string` | +| `attributes` | `string` | +| `ownerAddress` | `string` | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:491](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L491) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`DIDRegistry`](DIDRegistry.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`DIDRegistry`](DIDRegistry.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/DIDRegistry.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/DIDRegistry.ts#L16) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/DIDSalesTemplate.md b/docs/api-reference/classes/DIDSalesTemplate.md new file mode 100644 index 000000000..590427462 --- /dev/null +++ b/docs/api-reference/classes/DIDSalesTemplate.md @@ -0,0 +1,1438 @@ +[@nevermined-io/sdk](../code-reference.md) / DIDSalesTemplate + +# Class: DIDSalesTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<`DIDSalesTemplateParams`, `any`\> + + ↳ **`DIDSalesTemplate`** + +## Table of contents + +### Constructors + +- [constructor](DIDSalesTemplate.md#constructor) + +### Properties + +- [address](DIDSalesTemplate.md#address) +- [contract](DIDSalesTemplate.md#contract) +- [contractName](DIDSalesTemplate.md#contractname) +- [events](DIDSalesTemplate.md#events) +- [version](DIDSalesTemplate.md#version) + +### Accessors + +- [artifactsFolder](DIDSalesTemplate.md#artifactsfolder) +- [circuitsFolder](DIDSalesTemplate.md#circuitsfolder) +- [config](DIDSalesTemplate.md#config) +- [instanceConfig](DIDSalesTemplate.md#instanceconfig) +- [instantiableConfig](DIDSalesTemplate.md#instantiableconfig) +- [logger](DIDSalesTemplate.md#logger) +- [nevermined](DIDSalesTemplate.md#nevermined) +- [web3](DIDSalesTemplate.md#web3) + +### Methods + +- [accept](DIDSalesTemplate.md#accept) +- [agreementId](DIDSalesTemplate.md#agreementid) +- [call](DIDSalesTemplate.md#call) +- [conditions](DIDSalesTemplate.md#conditions) +- [createAgreement](DIDSalesTemplate.md#createagreement) +- [createAgreementAndPay](DIDSalesTemplate.md#createagreementandpay) +- [createAgreementFromDDO](DIDSalesTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](DIDSalesTemplate.md#createagreementwithpaymentfromddo) +- [createService](DIDSalesTemplate.md#createservice) +- [description](DIDSalesTemplate.md#description) +- [extraGen](DIDSalesTemplate.md#extragen) +- [getAgreementCreatedEvent](DIDSalesTemplate.md#getagreementcreatedevent) +- [getAgreementData](DIDSalesTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](DIDSalesTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](DIDSalesTemplate.md#getagreementstatus) +- [getAgreementsForDID](DIDSalesTemplate.md#getagreementsfordid) +- [getConditionTypes](DIDSalesTemplate.md#getconditiontypes) +- [getConditions](DIDSalesTemplate.md#getconditions) +- [getFromAddress](DIDSalesTemplate.md#getfromaddress) +- [getInputsOfMethod](DIDSalesTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](DIDSalesTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](DIDSalesTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](DIDSalesTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](DIDSalesTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](DIDSalesTemplate.md#getsignatureofmethod) +- [init](DIDSalesTemplate.md#init) +- [instanceFromDDO](DIDSalesTemplate.md#instancefromddo) +- [lockConditionIndex](DIDSalesTemplate.md#lockconditionindex) +- [lockTokens](DIDSalesTemplate.md#locktokens) +- [name](DIDSalesTemplate.md#name) +- [params](DIDSalesTemplate.md#params) +- [paramsGen](DIDSalesTemplate.md#paramsgen) +- [paymentData](DIDSalesTemplate.md#paymentdata) +- [printAgreementStatus](DIDSalesTemplate.md#printagreementstatus) +- [process](DIDSalesTemplate.md#process) +- [send](DIDSalesTemplate.md#send) +- [sendFrom](DIDSalesTemplate.md#sendfrom) +- [service](DIDSalesTemplate.md#service) +- [serviceEndpoint](DIDSalesTemplate.md#serviceendpoint) +- [setInstanceConfig](DIDSalesTemplate.md#setinstanceconfig) +- [standardContext](DIDSalesTemplate.md#standardcontext) +- [track](DIDSalesTemplate.md#track) +- [validateAgreement](DIDSalesTemplate.md#validateagreement) +- [getInstance](DIDSalesTemplate.md#getinstance) +- [setInstanceConfig](DIDSalesTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new DIDSalesTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`_params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L98) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`LockPaymentCondition`](LockPaymentCondition.md), [`TransferDIDOwnershipCondition`](TransferDIDOwnershipCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Returns + +[[`LockPaymentCondition`](LockPaymentCondition.md), [`TransferDIDOwnershipCondition`](TransferDIDOwnershipCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L32) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `DIDSalesTemplateParams` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `DIDSalesTemplateParams` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): `any` + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +`any` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L28) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :----------------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `DIDSalesTemplateParams` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L90) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`DIDSalesTemplateParams`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :----------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `DIDSalesTemplateParams` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`DIDSalesTemplateParams`\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L42) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L25) + +--- + +### params + +▸ **params**(`receiverId`): `DIDSalesTemplateParams` + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `receiverId` | `string` | + +#### Returns + +`DIDSalesTemplateParams` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L22) + +--- + +### paramsGen + +▸ **paramsGen**(`params`): `Promise`<`DIDSalesTemplateParams`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------------------------ | :----------------- | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`DIDSalesTemplateParams`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L19) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:83](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L83) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `DIDSalesTemplateParams` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`DIDSalesTemplate`](DIDSalesTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`DIDSalesTemplate`](DIDSalesTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/DIDSalesTemplate.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/DIDSalesTemplate.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Dispenser.md b/docs/api-reference/classes/Dispenser.md new file mode 100644 index 000000000..deccf4c6d --- /dev/null +++ b/docs/api-reference/classes/Dispenser.md @@ -0,0 +1,567 @@ +[@nevermined-io/sdk](../code-reference.md) / Dispenser + +# Class: Dispenser + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`Dispenser`** + +## Table of contents + +### Constructors + +- [constructor](Dispenser.md#constructor) + +### Properties + +- [address](Dispenser.md#address) +- [contract](Dispenser.md#contract) +- [contractName](Dispenser.md#contractname) +- [events](Dispenser.md#events) +- [version](Dispenser.md#version) + +### Accessors + +- [artifactsFolder](Dispenser.md#artifactsfolder) +- [circuitsFolder](Dispenser.md#circuitsfolder) +- [config](Dispenser.md#config) +- [instanceConfig](Dispenser.md#instanceconfig) +- [instantiableConfig](Dispenser.md#instantiableconfig) +- [logger](Dispenser.md#logger) +- [nevermined](Dispenser.md#nevermined) +- [web3](Dispenser.md#web3) + +### Methods + +- [call](Dispenser.md#call) +- [getFromAddress](Dispenser.md#getfromaddress) +- [getInputsOfMethod](Dispenser.md#getinputsofmethod) +- [getSignatureOfMethod](Dispenser.md#getsignatureofmethod) +- [init](Dispenser.md#init) +- [requestTokens](Dispenser.md#requesttokens) +- [send](Dispenser.md#send) +- [sendFrom](Dispenser.md#sendfrom) +- [setInstanceConfig](Dispenser.md#setinstanceconfig) +- [getInstance](Dispenser.md#getinstance) +- [setInstanceConfig](Dispenser.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Dispenser**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### requestTokens + +▸ **requestTokens**(`amount`, `receiverAddress`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------- | +| `amount` | `string` \| `number` \| `bigint` | +| `receiverAddress` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/Dispenser.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Dispenser.ts#L11) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`Dispenser`](Dispenser.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`Dispenser`](Dispenser.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/Dispenser.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Dispenser.ts#L5) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/DistributeNFTCollateralCondition.md b/docs/api-reference/classes/DistributeNFTCollateralCondition.md new file mode 100644 index 000000000..4cd7ceb03 --- /dev/null +++ b/docs/api-reference/classes/DistributeNFTCollateralCondition.md @@ -0,0 +1,976 @@ +[@nevermined-io/sdk](../code-reference.md) / DistributeNFTCollateralCondition + +# Class: DistributeNFTCollateralCondition + +Condition allowing to transfer an NFT either to the original owner or a lender +depending on the loan status. + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`DistributeNFTCollateralConditionContext`\> + + ↳ **`DistributeNFTCollateralCondition`** + +## Table of contents + +### Constructors + +- [constructor](DistributeNFTCollateralCondition.md#constructor) + +### Properties + +- [address](DistributeNFTCollateralCondition.md#address) +- [contract](DistributeNFTCollateralCondition.md#contract) +- [contractName](DistributeNFTCollateralCondition.md#contractname) +- [events](DistributeNFTCollateralCondition.md#events) +- [version](DistributeNFTCollateralCondition.md#version) + +### Accessors + +- [artifactsFolder](DistributeNFTCollateralCondition.md#artifactsfolder) +- [circuitsFolder](DistributeNFTCollateralCondition.md#circuitsfolder) +- [config](DistributeNFTCollateralCondition.md#config) +- [instanceConfig](DistributeNFTCollateralCondition.md#instanceconfig) +- [instantiableConfig](DistributeNFTCollateralCondition.md#instantiableconfig) +- [logger](DistributeNFTCollateralCondition.md#logger) +- [nevermined](DistributeNFTCollateralCondition.md#nevermined) +- [web3](DistributeNFTCollateralCondition.md#web3) + +### Methods + +- [abortByTimeOut](DistributeNFTCollateralCondition.md#abortbytimeout) +- [call](DistributeNFTCollateralCondition.md#call) +- [fulfill](DistributeNFTCollateralCondition.md#fulfill) +- [fulfillInstance](DistributeNFTCollateralCondition.md#fulfillinstance) +- [fulfillPlain](DistributeNFTCollateralCondition.md#fulfillplain) +- [fulfillWithNode](DistributeNFTCollateralCondition.md#fulfillwithnode) +- [generateId](DistributeNFTCollateralCondition.md#generateid) +- [generateIdHash](DistributeNFTCollateralCondition.md#generateidhash) +- [generateIdWithSeed](DistributeNFTCollateralCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](DistributeNFTCollateralCondition.md#getconditionfulfilledevent) +- [getFromAddress](DistributeNFTCollateralCondition.md#getfromaddress) +- [getInputsOfMethod](DistributeNFTCollateralCondition.md#getinputsofmethod) +- [getSignatureOfMethod](DistributeNFTCollateralCondition.md#getsignatureofmethod) +- [hashValues](DistributeNFTCollateralCondition.md#hashvalues) +- [hashValuesPlain](DistributeNFTCollateralCondition.md#hashvaluesplain) +- [init](DistributeNFTCollateralCondition.md#init) +- [instance](DistributeNFTCollateralCondition.md#instance) +- [instanceFromDDO](DistributeNFTCollateralCondition.md#instancefromddo) +- [nodeMethod](DistributeNFTCollateralCondition.md#nodemethod) +- [params](DistributeNFTCollateralCondition.md#params) +- [paramsFromDDO](DistributeNFTCollateralCondition.md#paramsfromddo) +- [send](DistributeNFTCollateralCondition.md#send) +- [sendFrom](DistributeNFTCollateralCondition.md#sendfrom) +- [setInstanceConfig](DistributeNFTCollateralCondition.md#setinstanceconfig) +- [getInstance](DistributeNFTCollateralCondition.md#getinstance) +- [setInstanceConfig](DistributeNFTCollateralCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new DistributeNFTCollateralCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `nftContractAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill the distribute NFT collateral condition. +Only the borrower or the lender can call this method. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :---------------------------------------------- | :--------------------------------------------------------- | +| `agreementId` | `string` | The agreement identifier. | +| `did` | `string` | The DID of the asset with NFTs. | +| `vaultAddress` | `string` | The address of the vault contract where the NFT is locked. | +| `nftContractAddress` | `string` | The address of the NFT721 contract | +| `from?` | [`Account`](Account.md) | | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Condition state. + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L58) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `DistributeNFTCollateralConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `vaultAddress`, `nftContractAddress`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generates the ash of condition inputs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------- | :--------------------------------------------------------- | +| `did` | `string` | The DID of the asset with NFTs. | +| `vaultAddress` | `string` | The address of the vault contract where the NFT is locked. | +| `nftContractAddress` | `string` | The address of the NFT721 contract | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Hash of all the values + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L35) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------- | +| `«destructured»` | `DistributeNFTCollateralConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L39) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`DistributeNFTCollateralCondition`](DistributeNFTCollateralCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`DistributeNFTCollateralCondition`](DistributeNFTCollateralCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L17) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/EscrowComputeExecutionTemplate.md b/docs/api-reference/classes/EscrowComputeExecutionTemplate.md new file mode 100644 index 000000000..1b845d9e5 --- /dev/null +++ b/docs/api-reference/classes/EscrowComputeExecutionTemplate.md @@ -0,0 +1,1461 @@ +[@nevermined-io/sdk](../code-reference.md) / EscrowComputeExecutionTemplate + +# Class: EscrowComputeExecutionTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<`EscrowComputeExecutionParams`, [`ServiceCompute`](../interfaces/ServiceCompute.md)\> + + ↳ **`EscrowComputeExecutionTemplate`** + +## Table of contents + +### Constructors + +- [constructor](EscrowComputeExecutionTemplate.md#constructor) + +### Properties + +- [address](EscrowComputeExecutionTemplate.md#address) +- [contract](EscrowComputeExecutionTemplate.md#contract) +- [contractName](EscrowComputeExecutionTemplate.md#contractname) +- [events](EscrowComputeExecutionTemplate.md#events) +- [version](EscrowComputeExecutionTemplate.md#version) + +### Accessors + +- [artifactsFolder](EscrowComputeExecutionTemplate.md#artifactsfolder) +- [circuitsFolder](EscrowComputeExecutionTemplate.md#circuitsfolder) +- [config](EscrowComputeExecutionTemplate.md#config) +- [instanceConfig](EscrowComputeExecutionTemplate.md#instanceconfig) +- [instantiableConfig](EscrowComputeExecutionTemplate.md#instantiableconfig) +- [logger](EscrowComputeExecutionTemplate.md#logger) +- [nevermined](EscrowComputeExecutionTemplate.md#nevermined) +- [web3](EscrowComputeExecutionTemplate.md#web3) + +### Methods + +- [accept](EscrowComputeExecutionTemplate.md#accept) +- [agreementId](EscrowComputeExecutionTemplate.md#agreementid) +- [call](EscrowComputeExecutionTemplate.md#call) +- [conditions](EscrowComputeExecutionTemplate.md#conditions) +- [createAgreement](EscrowComputeExecutionTemplate.md#createagreement) +- [createAgreementAndPay](EscrowComputeExecutionTemplate.md#createagreementandpay) +- [createAgreementFromDDO](EscrowComputeExecutionTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](EscrowComputeExecutionTemplate.md#createagreementwithpaymentfromddo) +- [createService](EscrowComputeExecutionTemplate.md#createservice) +- [description](EscrowComputeExecutionTemplate.md#description) +- [extraGen](EscrowComputeExecutionTemplate.md#extragen) +- [getAgreementCreatedEvent](EscrowComputeExecutionTemplate.md#getagreementcreatedevent) +- [getAgreementData](EscrowComputeExecutionTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](EscrowComputeExecutionTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](EscrowComputeExecutionTemplate.md#getagreementstatus) +- [getAgreementsForDID](EscrowComputeExecutionTemplate.md#getagreementsfordid) +- [getConditionTypes](EscrowComputeExecutionTemplate.md#getconditiontypes) +- [getConditions](EscrowComputeExecutionTemplate.md#getconditions) +- [getFromAddress](EscrowComputeExecutionTemplate.md#getfromaddress) +- [getInputsOfMethod](EscrowComputeExecutionTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](EscrowComputeExecutionTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](EscrowComputeExecutionTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](EscrowComputeExecutionTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](EscrowComputeExecutionTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](EscrowComputeExecutionTemplate.md#getsignatureofmethod) +- [init](EscrowComputeExecutionTemplate.md#init) +- [instanceFromDDO](EscrowComputeExecutionTemplate.md#instancefromddo) +- [lockConditionIndex](EscrowComputeExecutionTemplate.md#lockconditionindex) +- [lockTokens](EscrowComputeExecutionTemplate.md#locktokens) +- [name](EscrowComputeExecutionTemplate.md#name) +- [params](EscrowComputeExecutionTemplate.md#params) +- [paramsGen](EscrowComputeExecutionTemplate.md#paramsgen) +- [paymentData](EscrowComputeExecutionTemplate.md#paymentdata) +- [printAgreementStatus](EscrowComputeExecutionTemplate.md#printagreementstatus) +- [process](EscrowComputeExecutionTemplate.md#process) +- [providerConfig](EscrowComputeExecutionTemplate.md#providerconfig) +- [send](EscrowComputeExecutionTemplate.md#send) +- [sendFrom](EscrowComputeExecutionTemplate.md#sendfrom) +- [service](EscrowComputeExecutionTemplate.md#service) +- [serviceEndpoint](EscrowComputeExecutionTemplate.md#serviceendpoint) +- [setInstanceConfig](EscrowComputeExecutionTemplate.md#setinstanceconfig) +- [standardContext](EscrowComputeExecutionTemplate.md#standardcontext) +- [track](EscrowComputeExecutionTemplate.md#track) +- [validateAgreement](EscrowComputeExecutionTemplate.md#validateagreement) +- [getInstance](EscrowComputeExecutionTemplate.md#getinstance) +- [setInstanceConfig](EscrowComputeExecutionTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new EscrowComputeExecutionTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`_params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L98) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`ComputeExecutionCondition`](ComputeExecutionCondition.md), [`LockPaymentCondition`](LockPaymentCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Returns + +[[`ComputeExecutionCondition`](ComputeExecutionCondition.md), [`LockPaymentCondition`](LockPaymentCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L102) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `EscrowComputeExecutionParams` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `EscrowComputeExecutionParams` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): [`ServiceCompute`](../interfaces/ServiceCompute.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceCompute`](../interfaces/ServiceCompute.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L39) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :----------------------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `EscrowComputeExecutionParams` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): `Object` + +#### Returns + +`Object` + +| Name | Type | +| :-------------------- | :------------------------------------------------------------------------------------------ | +| `conditionDependency` | { `[condition: string]`: `string`[]; } | +| `conditions` | [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] | +| `contractName` | `string` | +| `events` | [`ServiceAgreementTemplateEvent`](../interfaces/ServiceAgreementTemplateEvent.md)[] | +| `fulfillmentOrder` | `string`[] | + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L90) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`EscrowComputeExecutionParams`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :----------------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `EscrowComputeExecutionParams` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`EscrowComputeExecutionParams`\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:108](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L108) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L36) + +--- + +### params + +▸ **params**(`consumer`): `EscrowComputeExecutionParams` + +#### Parameters + +| Name | Type | +| :--------- | :---------------------- | +| `consumer` | [`Account`](Account.md) | + +#### Returns + +`EscrowComputeExecutionParams` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L98) + +--- + +### paramsGen + +▸ **paramsGen**(`params`): `Promise`<`EscrowComputeExecutionParams`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------------------------ | :----------------- | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`EscrowComputeExecutionParams`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L22) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### providerConfig + +▸ **providerConfig**(): `Promise`<{ `description`: `string` = ''; `environment`: { `cluster`: { `type`: `string` = 'Kubernetes'; `url`: `string` = 'http://10.0.0.17/xxx' } ; `supportedContainers`: { `checksum`: `string` = 'sha256:cb57ecfa6ebbefd8ffc7f75c0f00e57a7fa739578a429b6f72a0df19315deadc'; `image`: `string` = 'tensorflow/tensorflow'; `tag`: `string` = 'latest' }[] ; `supportedServers`: { `cpu`: `string` = '16'; `disk`: `string` = '160gb'; `gpu`: `string` = '0'; `maxExecutionTime`: `number` = 86400; `memory`: `string` = '128gb'; `price`: `string` = '50'; `serverId`: `string` = '1'; `serverType`: `string` = 'xlsize' }[] } ; `type`: `string` = 'Azure' }\> + +#### Returns + +`Promise`<{ `description`: `string` = ''; `environment`: { `cluster`: { `type`: `string` = 'Kubernetes'; `url`: `string` = 'http://10.0.0.17/xxx' } ; `supportedContainers`: { `checksum`: `string` = 'sha256:cb57ecfa6ebbefd8ffc7f75c0f00e57a7fa739578a429b6f72a0df19315deadc'; `image`: `string` = 'tensorflow/tensorflow'; `tag`: `string` = 'latest' }[] ; `supportedServers`: { `cpu`: `string` = '16'; `disk`: `string` = '160gb'; `gpu`: `string` = '0'; `maxExecutionTime`: `number` = 86400; `memory`: `string` = '128gb'; `price`: `string` = '50'; `serverId`: `string` = '1'; `serverType`: `string` = 'xlsize' }[] } ; `type`: `string` = 'Azure' }\> + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L43) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L94) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `EscrowComputeExecutionParams` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L27) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/EscrowPaymentCondition.md b/docs/api-reference/classes/EscrowPaymentCondition.md new file mode 100644 index 000000000..21d607b15 --- /dev/null +++ b/docs/api-reference/classes/EscrowPaymentCondition.md @@ -0,0 +1,976 @@ +[@nevermined-io/sdk](../code-reference.md) / EscrowPaymentCondition + +# Class: EscrowPaymentCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`EscrowPaymentConditionContext`\> + + ↳ **`EscrowPaymentCondition`** + +## Table of contents + +### Constructors + +- [constructor](EscrowPaymentCondition.md#constructor) + +### Properties + +- [address](EscrowPaymentCondition.md#address) +- [contract](EscrowPaymentCondition.md#contract) +- [contractName](EscrowPaymentCondition.md#contractname) +- [events](EscrowPaymentCondition.md#events) +- [version](EscrowPaymentCondition.md#version) + +### Accessors + +- [artifactsFolder](EscrowPaymentCondition.md#artifactsfolder) +- [circuitsFolder](EscrowPaymentCondition.md#circuitsfolder) +- [config](EscrowPaymentCondition.md#config) +- [instanceConfig](EscrowPaymentCondition.md#instanceconfig) +- [instantiableConfig](EscrowPaymentCondition.md#instantiableconfig) +- [logger](EscrowPaymentCondition.md#logger) +- [nevermined](EscrowPaymentCondition.md#nevermined) +- [web3](EscrowPaymentCondition.md#web3) + +### Methods + +- [abortByTimeOut](EscrowPaymentCondition.md#abortbytimeout) +- [call](EscrowPaymentCondition.md#call) +- [fulfill](EscrowPaymentCondition.md#fulfill) +- [fulfillInstance](EscrowPaymentCondition.md#fulfillinstance) +- [fulfillPlain](EscrowPaymentCondition.md#fulfillplain) +- [fulfillWithNode](EscrowPaymentCondition.md#fulfillwithnode) +- [generateId](EscrowPaymentCondition.md#generateid) +- [generateIdHash](EscrowPaymentCondition.md#generateidhash) +- [generateIdWithSeed](EscrowPaymentCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](EscrowPaymentCondition.md#getconditionfulfilledevent) +- [getFromAddress](EscrowPaymentCondition.md#getfromaddress) +- [getInputsOfMethod](EscrowPaymentCondition.md#getinputsofmethod) +- [getSignatureOfMethod](EscrowPaymentCondition.md#getsignatureofmethod) +- [hashValues](EscrowPaymentCondition.md#hashvalues) +- [hashValuesPlain](EscrowPaymentCondition.md#hashvaluesplain) +- [init](EscrowPaymentCondition.md#init) +- [instance](EscrowPaymentCondition.md#instance) +- [instanceFromDDO](EscrowPaymentCondition.md#instancefromddo) +- [nodeMethod](EscrowPaymentCondition.md#nodemethod) +- [params](EscrowPaymentCondition.md#params) +- [paramsFromDDO](EscrowPaymentCondition.md#paramsfromddo) +- [send](EscrowPaymentCondition.md#send) +- [sendFrom](EscrowPaymentCondition.md#sendfrom) +- [setInstanceConfig](EscrowPaymentCondition.md#setinstanceconfig) +- [getInstance](EscrowPaymentCondition.md#getinstance) +- [setInstanceConfig](EscrowPaymentCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new EscrowPaymentCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `amounts`, `receivers`, `returnAddress`, `lockPaymentAddress`, `tokenAddress`, `lockCondition`, `releaseCondition`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `returnAddress` | `string` | +| `lockPaymentAddress` | `string` | +| `tokenAddress` | `string` | +| `lockCondition` | `string` | +| `releaseCondition` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:60](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L60) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `EscrowPaymentConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `amounts`, `receivers`, `returnAddress`, `sender`, `tokenAddress`, `lockCondition`, `releaseCondition`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :----------------- | :--------- | +| `did` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `returnAddress` | `string` | +| `sender` | `string` | +| `tokenAddress` | `string` | +| `lockCondition` | `string` | +| `releaseCondition` | `string` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L22) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`, `access`, `lock`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :------------------------------------------------------------------ | +| `«destructured»` | `EscrowPaymentConditionContext` | +| `access` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md) | +| `lock` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md) | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L41) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`EscrowPaymentCondition`](EscrowPaymentCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`EscrowPaymentCondition`](EscrowPaymentCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L18) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/EthSignJWT.md b/docs/api-reference/classes/EthSignJWT.md new file mode 100644 index 000000000..5e8aa9632 --- /dev/null +++ b/docs/api-reference/classes/EthSignJWT.md @@ -0,0 +1,441 @@ +[@nevermined-io/sdk](../code-reference.md) / EthSignJWT + +# Class: EthSignJWT + +## Hierarchy + +- `SignJWT` + + ↳ **`EthSignJWT`** + +## Table of contents + +### Constructors + +- [constructor](EthSignJWT.md#constructor) + +### Properties + +- [\_payload](EthSignJWT.md#_payload) +- [protectedHeader](EthSignJWT.md#protectedheader) + +### Methods + +- [base64url](EthSignJWT.md#base64url) +- [concat](EthSignJWT.md#concat) +- [ethSign](EthSignJWT.md#ethsign) +- [setAudience](EthSignJWT.md#setaudience) +- [setExpirationTime](EthSignJWT.md#setexpirationtime) +- [setIssuedAt](EthSignJWT.md#setissuedat) +- [setIssuer](EthSignJWT.md#setissuer) +- [setJti](EthSignJWT.md#setjti) +- [setNotBefore](EthSignJWT.md#setnotbefore) +- [setProtectedHeader](EthSignJWT.md#setprotectedheader) +- [setSubject](EthSignJWT.md#setsubject) +- [sign](EthSignJWT.md#sign) +- [signMessage](EthSignJWT.md#signmessage) +- [signText](EthSignJWT.md#signtext) +- [signTypedMessage](EthSignJWT.md#signtypedmessage) + +## Constructors + +### constructor + +• **new EthSignJWT**(`payload`) + +#### Parameters + +| Name | Type | Description | +| :-------- | :----------- | :------------------------- | +| `payload` | `JWTPayload` | The JWT Claims Set object. | + +#### Inherited from + +SignJWT.constructor + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:6 + +## Properties + +### \_payload + +• `Protected` **\_payload**: `JWTPayload` + +#### Inherited from + +SignJWT.\_payload + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:4 + +--- + +### protectedHeader + +• **protectedHeader**: `JWSHeaderParameters` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L27) + +## Methods + +### base64url + +▸ `Private` **base64url**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :----------------------- | +| `input` | `string` \| `Uint8Array` | + +#### Returns + +`string` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:128](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L128) + +--- + +### concat + +▸ `Private` **concat**(`...buffers`): `Uint8Array` + +#### Parameters + +| Name | Type | +| :----------- | :------------- | +| `...buffers` | `Uint8Array`[] | + +#### Returns + +`Uint8Array` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:136](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L136) + +--- + +### ethSign + +▸ **ethSign**(`signer`, `eip712Data?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------- | +| `signer` | `Signer` \| `ZeroDevAccountSigner`<`"ECDSA"`\> | +| `eip712Data?` | [`Eip712Data`](../interfaces/Eip712Data.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L34) + +--- + +### setAudience + +▸ **setAudience**(`audience`): [`EthSignJWT`](EthSignJWT.md) + +Set "aud" (Audience) Claim. + +#### Parameters + +| Name | Type | Description | +| :--------- | :--------------------- | :--------------------------------------------------------- | +| `audience` | `string` \| `string`[] | "aud" (Audience) Claim value to set on the JWT Claims Set. | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Inherited from + +SignJWT.setAudience + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:24 + +--- + +### setExpirationTime + +▸ **setExpirationTime**(`input`): [`EthSignJWT`](EthSignJWT.md) + +Set "exp" (Expiration Time) Claim. + +#### Parameters + +| Name | Type | Description | +| :------ | :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | `string` \| `number` | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Inherited from + +SignJWT.setExpirationTime + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:46 + +--- + +### setIssuedAt + +▸ **setIssuedAt**(`input?`): [`EthSignJWT`](EthSignJWT.md) + +Set "iat" (Issued At) Claim. + +#### Parameters + +| Name | Type | Description | +| :------- | :------- | :---------------------------------------------------------------------------------------- | +| `input?` | `number` | "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current timestamp. | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Inherited from + +SignJWT.setIssuedAt + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:52 + +--- + +### setIssuer + +▸ **setIssuer**(`issuer`): [`EthSignJWT`](EthSignJWT.md) + +Set "iss" (Issuer) Claim. + +#### Parameters + +| Name | Type | Description | +| :------- | :------- | :------------------------------------------------- | +| `issuer` | `string` | "Issuer" Claim value to set on the JWT Claims Set. | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Inherited from + +SignJWT.setIssuer + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:12 + +--- + +### setJti + +▸ **setJti**(`jwtId`): [`EthSignJWT`](EthSignJWT.md) + +Set "jti" (JWT ID) Claim. + +#### Parameters + +| Name | Type | Description | +| :------ | :------- | :------------------------------------------------------- | +| `jwtId` | `string` | "jti" (JWT ID) Claim value to set on the JWT Claims Set. | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Inherited from + +SignJWT.setJti + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:30 + +--- + +### setNotBefore + +▸ **setNotBefore**(`input`): [`EthSignJWT`](EthSignJWT.md) + +Set "nbf" (Not Before) Claim. + +#### Parameters + +| Name | Type | Description | +| :------ | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | `string` \| `number` | "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Inherited from + +SignJWT.setNotBefore + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:38 + +--- + +### setProtectedHeader + +▸ **setProtectedHeader**(`protectedHeader`): [`EthSignJWT`](EthSignJWT.md) + +#### Parameters + +| Name | Type | +| :---------------- | :-------------------- | +| `protectedHeader` | `JWSHeaderParameters` | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Overrides + +SignJWT.setProtectedHeader + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L29) + +--- + +### setSubject + +▸ **setSubject**(`subject`): [`EthSignJWT`](EthSignJWT.md) + +Set "sub" (Subject) Claim. + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :-------------------------------------------------------- | +| `subject` | `string` | "sub" (Subject) Claim value to set on the JWT Claims Set. | + +#### Returns + +[`EthSignJWT`](EthSignJWT.md) + +#### Inherited from + +SignJWT.setSubject + +#### Defined in + +node_modules/jose/dist/types/jwt/produce.d.ts:18 + +--- + +### sign + +▸ **sign**(`key`, `options?`): `Promise`<`string`\> + +Signs and returns the JWT. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------------------------ | :------------------------------------------ | +| `key` | `Uint8Array` \| `KeyLike` | Private Key or Secret to sign the JWT with. | +| `options?` | `SignOptions` | JWT Sign options. | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +SignJWT.sign + +#### Defined in + +node_modules/jose/dist/types/jwt/sign.d.ts:34 + +--- + +### signMessage + +▸ `Static` `Private` **signMessage**(`message`, `signer`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :--------------------------------------------- | +| `message` | `string` \| `Uint8Array` | +| `signer` | `Signer` \| `ZeroDevAccountSigner`<`"ECDSA"`\> | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:100](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L100) + +--- + +### signText + +▸ `Static` **signText**(`text`, `signer`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------- | :----------------------- | +| `text` | `string` \| `Uint8Array` | +| `signer` | `Signer` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L90) + +--- + +### signTypedMessage + +▸ `Static` `Private` **signTypedMessage**(`domain`, `types`, `value`, `signer`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------- | +| `domain` | [`TypedDataDomain`](../interfaces/TypedDataDomain.md) | +| `types` | [`TypedDataTypes`](../interfaces/TypedDataTypes.md) | +| `value` | `Record`<`string`, `any`\> | +| `signer` | `Signer` \| `ZeroDevAccountSigner`<`"ECDSA"`\> | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:111](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L111) diff --git a/docs/api-reference/classes/events.EventHandler.md b/docs/api-reference/classes/EventHandler.md similarity index 59% rename from docs/api-reference/classes/events.EventHandler.md rename to docs/api-reference/classes/EventHandler.md index c9d9ed730..43f24b89d 100644 --- a/docs/api-reference/classes/events.EventHandler.md +++ b/docs/api-reference/classes/EventHandler.md @@ -1,33 +1,31 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / EventHandler +[@nevermined-io/sdk](../code-reference.md) / EventHandler # Class: EventHandler -[events](../modules/events.md).EventHandler - ## Table of contents ### Constructors -- [constructor](events.EventHandler.md#constructor) +- [constructor](EventHandler.md#constructor) ### Properties -- [events](events.EventHandler.md#events) -- [getBlockNumber](events.EventHandler.md#getblocknumber) -- [interval](events.EventHandler.md#interval) -- [lastBlock](events.EventHandler.md#lastblock) -- [lastTimeout](events.EventHandler.md#lasttimeout) -- [polling](events.EventHandler.md#polling) +- [events](EventHandler.md#events) +- [getBlockNumber](EventHandler.md#getblocknumber) +- [interval](EventHandler.md#interval) +- [lastBlock](EventHandler.md#lastblock) +- [lastTimeout](EventHandler.md#lasttimeout) +- [polling](EventHandler.md#polling) ### Accessors -- [count](events.EventHandler.md#count) +- [count](EventHandler.md#count) ### Methods -- [checkBlock](events.EventHandler.md#checkblock) -- [subscribe](events.EventHandler.md#subscribe) -- [unsubscribe](events.EventHandler.md#unsubscribe) +- [checkBlock](EventHandler.md#checkblock) +- [subscribe](EventHandler.md#subscribe) +- [unsubscribe](EventHandler.md#unsubscribe) ## Constructors @@ -43,7 +41,7 @@ #### Defined in -[src/events/EventHandler.ts:6](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L6) +[src/events/EventHandler.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L6) --- @@ -61,7 +59,7 @@ #### Defined in -[src/events/EventHandler.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L16) +[src/events/EventHandler.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L16) --- @@ -71,7 +69,7 @@ #### Defined in -[src/events/EventHandler.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L10) +[src/events/EventHandler.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L10) --- @@ -81,7 +79,7 @@ #### Defined in -[src/events/EventHandler.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L8) +[src/events/EventHandler.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L8) --- @@ -91,7 +89,7 @@ #### Defined in -[src/events/EventHandler.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L14) +[src/events/EventHandler.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L14) --- @@ -101,7 +99,7 @@ #### Defined in -[src/events/EventHandler.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L12) +[src/events/EventHandler.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L12) ## Accessors @@ -115,20 +113,19 @@ #### Defined in -[src/events/EventHandler.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L2) +[src/events/EventHandler.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L2) ## Methods ### checkBlock -▸ `Private` **checkBlock**(`isInterval?`, `n?`): `Promise`<`void`\> +▸ `Private` **checkBlock**(`isInterval?`): `Promise`<`void`\> #### Parameters -| Name | Type | Default value | -| :------------ | :-------- | :------------ | -| `isInterval?` | `boolean` | `undefined` | -| `n` | `number` | `0` | +| Name | Type | +| :------------ | :-------- | +| `isInterval?` | `boolean` | #### Returns @@ -136,7 +133,7 @@ #### Defined in -[src/events/EventHandler.ts:40](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L40) +[src/events/EventHandler.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L37) --- @@ -161,7 +158,7 @@ #### Defined in -[src/events/EventHandler.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L18) +[src/events/EventHandler.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L18) --- @@ -181,4 +178,4 @@ #### Defined in -[src/events/EventHandler.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/EventHandler.ts#L31) +[src/events/EventHandler.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/EventHandler.ts#L28) diff --git a/docs/api-reference/classes/Files.md b/docs/api-reference/classes/Files.md new file mode 100644 index 000000000..d71efe915 --- /dev/null +++ b/docs/api-reference/classes/Files.md @@ -0,0 +1,297 @@ +[@nevermined-io/sdk](../code-reference.md) / Files + +# Class: Files + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`Files`** + +## Table of contents + +### Constructors + +- [constructor](Files.md#constructor) + +### Accessors + +- [artifactsFolder](Files.md#artifactsfolder) +- [circuitsFolder](Files.md#circuitsfolder) +- [config](Files.md#config) +- [instanceConfig](Files.md#instanceconfig) +- [instantiableConfig](Files.md#instantiableconfig) +- [logger](Files.md#logger) +- [nevermined](Files.md#nevermined) +- [web3](Files.md#web3) + +### Methods + +- [setInstanceConfig](Files.md#setinstanceconfig) +- [uploadFilecoin](Files.md#uploadfilecoin) +- [getInstance](Files.md#getinstance) +- [setInstanceConfig](Files.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Files**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/Files.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Files.ts#L5) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### uploadFilecoin + +▸ **uploadFilecoin**(`data`, `encrypt?`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :--------- | :----------------------- | +| `data` | `string` \| `ReadStream` | +| `encrypt?` | `boolean` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/nevermined/Files.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Files.ts#L10) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/GenericContract.md b/docs/api-reference/classes/GenericContract.md new file mode 100644 index 000000000..35af32a50 --- /dev/null +++ b/docs/api-reference/classes/GenericContract.md @@ -0,0 +1,573 @@ +[@nevermined-io/sdk](../code-reference.md) / GenericContract + +# Class: GenericContract + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`GenericContract`** + +## Table of contents + +### Constructors + +- [constructor](GenericContract.md#constructor) + +### Properties + +- [address](GenericContract.md#address) +- [contract](GenericContract.md#contract) +- [contractName](GenericContract.md#contractname) +- [events](GenericContract.md#events) +- [fixedAddress](GenericContract.md#fixedaddress) +- [version](GenericContract.md#version) + +### Accessors + +- [artifactsFolder](GenericContract.md#artifactsfolder) +- [circuitsFolder](GenericContract.md#circuitsfolder) +- [config](GenericContract.md#config) +- [instanceConfig](GenericContract.md#instanceconfig) +- [instantiableConfig](GenericContract.md#instantiableconfig) +- [logger](GenericContract.md#logger) +- [nevermined](GenericContract.md#nevermined) +- [web3](GenericContract.md#web3) + +### Methods + +- [call](GenericContract.md#call) +- [getContract](GenericContract.md#getcontract) +- [getFromAddress](GenericContract.md#getfromaddress) +- [getInputsOfMethod](GenericContract.md#getinputsofmethod) +- [getSignatureOfMethod](GenericContract.md#getsignatureofmethod) +- [init](GenericContract.md#init) +- [send](GenericContract.md#send) +- [sendFrom](GenericContract.md#sendfrom) +- [setInstanceConfig](GenericContract.md#setinstanceconfig) +- [getInstance](GenericContract.md#getinstance) +- [setInstanceConfig](GenericContract.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Private` **new GenericContract**(`contractName`, `address?`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | +| `address?` | `string` | + +#### Overrides + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/GenericContract.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/GenericContract.ts#L18) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### fixedAddress + +• `Protected` **fixedAddress**: `string` + +#### Defined in + +[src/keeper/contracts/GenericContract.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/GenericContract.ts#L6) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Overrides + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/GenericContract.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/GenericContract.ts#L34) + +--- + +### getContract + +▸ **getContract**(): `BaseContract` + +#### Returns + +`BaseContract` + +#### Defined in + +[src/keeper/contracts/GenericContract.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/GenericContract.ts#L47) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Overrides + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/GenericContract.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/GenericContract.ts#L23) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/GenericContract.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/GenericContract.ts#L38) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `contractName`, `address?`): `Promise`<[`GenericContract`](GenericContract.md)\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | +| `contractName` | `string` | +| `address?` | `string` | + +#### Returns + +`Promise`<[`GenericContract`](GenericContract.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/GenericContract.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/GenericContract.ts#L8) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/GraphError.md b/docs/api-reference/classes/GraphError.md new file mode 100644 index 000000000..7be6b54bf --- /dev/null +++ b/docs/api-reference/classes/GraphError.md @@ -0,0 +1,165 @@ +[@nevermined-io/sdk](../code-reference.md) / GraphError + +# Class: GraphError + +## Hierarchy + +- `Error` + + ↳ **`GraphError`** + +## Table of contents + +### Constructors + +- [constructor](GraphError.md#constructor) + +### Properties + +- [message](GraphError.md#message) +- [name](GraphError.md#name) +- [stack](GraphError.md#stack) +- [prepareStackTrace](GraphError.md#preparestacktrace) +- [stackTraceLimit](GraphError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](GraphError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new GraphError**(`message`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/GraphError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/GraphError.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/HttpError.md b/docs/api-reference/classes/HttpError.md new file mode 100644 index 000000000..8ba3ad647 --- /dev/null +++ b/docs/api-reference/classes/HttpError.md @@ -0,0 +1,166 @@ +[@nevermined-io/sdk](../code-reference.md) / HttpError + +# Class: HttpError + +## Hierarchy + +- `Error` + + ↳ **`HttpError`** + +## Table of contents + +### Constructors + +- [constructor](HttpError.md#constructor) + +### Properties + +- [message](HttpError.md#message) +- [name](HttpError.md#name) +- [stack](HttpError.md#stack) +- [prepareStackTrace](HttpError.md#preparestacktrace) +- [stackTraceLimit](HttpError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](HttpError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new HttpError**(`message`, `code`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | +| `code` | `number` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/HttpError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/HttpError.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/Instantiable.md b/docs/api-reference/classes/Instantiable.md new file mode 100644 index 000000000..55ec73553 --- /dev/null +++ b/docs/api-reference/classes/Instantiable.md @@ -0,0 +1,283 @@ +[@nevermined-io/sdk](../code-reference.md) / Instantiable + +# Class: Instantiable + +## Hierarchy + +- **`Instantiable`** + + ↳ [`NeverminedEvent`](NeverminedEvent.md) + + ↳ [`AccountsApi`](AccountsApi.md) + + ↳ [`AgreementsApi`](AgreementsApi.md) + + ↳ [`ProvenanceApi`](ProvenanceApi.md) + + ↳ [`RegistryBaseApi`](RegistryBaseApi.md) + + ↳ [`SearchApi`](SearchApi.md) + + ↳ [`ServicesApi`](ServicesApi.md) + + ↳ [`UtilsApi`](UtilsApi.md) + + ↳ [`JwtUtils`](JwtUtils.md) + + ↳ [`ServiceAgreement`](ServiceAgreement.md) + + ↳ [`SignatureUtils`](SignatureUtils.md) + + ↳ [`WebServiceConnector`](WebServiceConnector.md) + + ↳ [`AccessService`](AccessService.md) + + ↳ [`NFTAccessService`](NFTAccessService.md) + + ↳ [`NFTSalesService`](NFTSalesService.md) + + ↳ [`Account`](Account.md) + + ↳ [`Files`](Files.md) + + ↳ [`Nevermined`](Nevermined.md) + + ↳ [`Providers`](Providers.md) + + ↳ [`TokenUtils`](TokenUtils.md) + + ↳ [`Versions`](Versions.md) + + ↳ [`AaveCredit`](AaveCredit.md) + + ↳ [`MarketplaceApi`](MarketplaceApi.md) + + ↳ [`NeverminedNode`](NeverminedNode.md) + + ↳ [`ContractBase`](ContractBase.md) + + ↳ [`ContractHandler`](ContractHandler.md) + + ↳ [`Keeper`](Keeper.md) + +## Table of contents + +### Constructors + +- [constructor](Instantiable.md#constructor) + +### Properties + +- [\_instantiableConfig](Instantiable.md#_instantiableconfig) + +### Accessors + +- [artifactsFolder](Instantiable.md#artifactsfolder) +- [circuitsFolder](Instantiable.md#circuitsfolder) +- [config](Instantiable.md#config) +- [instanceConfig](Instantiable.md#instanceconfig) +- [instantiableConfig](Instantiable.md#instantiableconfig) +- [logger](Instantiable.md#logger) +- [nevermined](Instantiable.md#nevermined) +- [web3](Instantiable.md#web3) + +### Methods + +- [setInstanceConfig](Instantiable.md#setinstanceconfig) +- [getInstance](Instantiable.md#getinstance) +- [setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Instantiable**() + +## Properties + +### \_instantiableConfig + +• `Private` `Optional` **\_instantiableConfig**: [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Defined in + +[src/Instantiable.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L97) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/JwtUtils.md b/docs/api-reference/classes/JwtUtils.md new file mode 100644 index 000000000..4e20967ca --- /dev/null +++ b/docs/api-reference/classes/JwtUtils.md @@ -0,0 +1,592 @@ +[@nevermined-io/sdk](../code-reference.md) / JwtUtils + +# Class: JwtUtils + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`JwtUtils`** + +## Table of contents + +### Constructors + +- [constructor](JwtUtils.md#constructor) + +### Properties + +- [BASE_AUD](JwtUtils.md#base_aud) +- [CLIENT_ASSERTION_TYPE](JwtUtils.md#client_assertion_type) +- [tokenCache](JwtUtils.md#tokencache) + +### Accessors + +- [artifactsFolder](JwtUtils.md#artifactsfolder) +- [circuitsFolder](JwtUtils.md#circuitsfolder) +- [config](JwtUtils.md#config) +- [instanceConfig](JwtUtils.md#instanceconfig) +- [instantiableConfig](JwtUtils.md#instantiableconfig) +- [logger](JwtUtils.md#logger) +- [nevermined](JwtUtils.md#nevermined) +- [web3](JwtUtils.md#web3) + +### Methods + +- [accountToJwk](JwtUtils.md#accounttojwk) +- [generateAccessGrantToken](JwtUtils.md#generateaccessgranttoken) +- [generateCacheKey](JwtUtils.md#generatecachekey) +- [generateClientAssertion](JwtUtils.md#generateclientassertion) +- [generateComputeGrantToken](JwtUtils.md#generatecomputegranttoken) +- [generateDownloadGrantToken](JwtUtils.md#generatedownloadgranttoken) +- [generateExecuteGrantToken](JwtUtils.md#generateexecutegranttoken) +- [generateNftAccessGrantToken](JwtUtils.md#generatenftaccessgranttoken) +- [generateToken](JwtUtils.md#generatetoken) +- [getDownloadGrantToken](JwtUtils.md#getdownloadgranttoken) +- [getNftAccessGrantToken](JwtUtils.md#getnftaccessgranttoken) +- [getSigner](JwtUtils.md#getsigner) +- [setInstanceConfig](JwtUtils.md#setinstanceconfig) +- [getInstance](JwtUtils.md#getinstance) +- [setInstanceConfig](JwtUtils.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new JwtUtils**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L154) + +## Properties + +### BASE_AUD + +• **BASE_AUD**: `string` = `'/api/v1/node/services'` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L150) + +--- + +### CLIENT_ASSERTION_TYPE + +• **CLIENT_ASSERTION_TYPE**: `string` = `'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:149](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L149) + +--- + +### tokenCache + +• **tokenCache**: `Map`<`string`, `string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:152](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L152) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accountToJwk + +▸ **accountToJwk**(`account`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------- | +| `account` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:171](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L171) + +--- + +### generateAccessGrantToken + +▸ **generateAccessGrantToken**(`account`, `serviceAgreementId`, `did`, `buyer?`, `babysig?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------------- | :------------------------------------ | +| `account` | [`Account`](Account.md) | +| `serviceAgreementId` | `string` | +| `did` | `string` | +| `buyer?` | `string` | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:212](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L212) + +--- + +### generateCacheKey + +▸ **generateCacheKey**(`...args`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :--------- | +| `...args` | `string`[] | + +#### Returns + +`string` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:167](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L167) + +--- + +### generateClientAssertion + +▸ **generateClientAssertion**(`account`, `message?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :--------- | :---------------------- | +| `account` | [`Account`](Account.md) | +| `message?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:192](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L192) + +--- + +### generateComputeGrantToken + +▸ **generateComputeGrantToken**(`account`, `serviceAgreementId`, `executionId`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------- | +| `account` | [`Account`](Account.md) | +| `serviceAgreementId` | `string` | +| `executionId` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:323](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L323) + +--- + +### generateDownloadGrantToken + +▸ **generateDownloadGrantToken**(`account`, `did`, `buyer?`, `babysig?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :--------- | :------------------------------------ | +| `account` | [`Account`](Account.md) | +| `did` | `string` | +| `buyer?` | `string` | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:261](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L261) + +--- + +### generateExecuteGrantToken + +▸ **generateExecuteGrantToken**(`account`, `serviceAgreementId`, `workflowId`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------- | +| `account` | [`Account`](Account.md) | +| `serviceAgreementId` | `string` | +| `workflowId` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:302](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L302) + +--- + +### generateNftAccessGrantToken + +▸ **generateNftAccessGrantToken**(`agreementId`, `did`, `serviceIndex`, `account`, `buyer?`, `babysig?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------- | :------------------------------------ | +| `agreementId` | `string` | +| `did` | `string` | +| `serviceIndex` | `number` | +| `account` | [`Account`](Account.md) | +| `buyer?` | `string` | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:344](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L344) + +--- + +### generateToken + +▸ **generateToken**(`account`, `serviceAgreementId`, `did`, `aud`, `obj`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------- | +| `account` | [`Account`](Account.md) | +| `serviceAgreementId` | `string` | +| `did` | `string` | +| `aud` | `string` | +| `obj` | `any` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:237](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L237) + +--- + +### getDownloadGrantToken + +▸ **getDownloadGrantToken**(`did`, `account`, `buyer?`, `babysig?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :--------- | :------------------------------------ | +| `did` | `string` | +| `account` | [`Account`](Account.md) | +| `buyer?` | `string` | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:283](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L283) + +--- + +### getNftAccessGrantToken + +▸ **getNftAccessGrantToken**(`agreementId`, `did`, `serviceIndex`, `account`, `buyer?`, `babysig?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------- | :------------------------------------ | +| `agreementId` | `string` | +| `did` | `string` | +| `serviceIndex` | `number` | +| `account` | [`Account`](Account.md) | +| `buyer?` | `string` | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:372](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L372) + +--- + +### getSigner + +▸ **getSigner**(`account`): `Promise`<`Signer` \| `ZeroDevAccountSigner`<`"ECDSA"`\>\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------- | +| `account` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`Signer` \| `ZeroDevAccountSigner`<`"ECDSA"`\>\> + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:160](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L160) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Keeper.md b/docs/api-reference/classes/Keeper.md index 672976fb7..e1b9b7853 100644 --- a/docs/api-reference/classes/Keeper.md +++ b/docs/api-reference/classes/Keeper.md @@ -11,7 +11,7 @@ Nevermined Keeper implementation where we put the following modules together: ## Hierarchy -- `Instantiable` +- [`Instantiable`](Instantiable.md) ↳ **`Keeper`** @@ -41,11 +41,11 @@ Nevermined Keeper implementation where we put the following modules together: - [templates](Keeper.md#templates) - [token](Keeper.md#token) - [utils](Keeper.md#utils) -- [version](Keeper.md#version) ### Accessors - [artifactsFolder](Keeper.md#artifactsfolder) +- [circuitsFolder](Keeper.md#circuitsfolder) - [config](Keeper.md#config) - [instanceConfig](Keeper.md#instanceconfig) - [instantiableConfig](Keeper.md#instantiableconfig) @@ -55,20 +55,18 @@ Nevermined Keeper implementation where we put the following modules together: ### Methods -- [addresses](Keeper.md#addresses) -- [checkExists](Keeper.md#checkexists) -- [findSigner](Keeper.md#findsigner) - [getAccessTemplateByName](Keeper.md#getaccesstemplatebyname) - [getAllInstances](Keeper.md#getallinstances) - [getConditionByAddress](Keeper.md#getconditionbyaddress) - [getNetworkId](Keeper.md#getnetworkid) - [getNetworkName](Keeper.md#getnetworkname) +- [getNetworkVersion](Keeper.md#getnetworkversion) - [getTemplateByAddress](Keeper.md#gettemplatebyaddress) - [getTemplateByName](Keeper.md#gettemplatebyname) - [init](Keeper.md#init) +- [loadAaveInstances](Keeper.md#loadaaveinstances) +- [loadCurveRoyaltiesInstance](Keeper.md#loadcurveroyaltiesinstance) - [setInstanceConfig](Keeper.md#setinstanceconfig) -- [addressesStatic](Keeper.md#addressesstatic) -- [findSignerStatic](Keeper.md#findsignerstatic) - [getInstance](Keeper.md#getinstance) - [setInstanceConfig](Keeper.md#setinstanceconfig-1) @@ -80,31 +78,31 @@ Nevermined Keeper implementation where we put the following modules together: #### Inherited from -Instantiable.constructor +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) ## Properties ### agreementStoreManager -• **agreementStoreManager**: `AgreementStoreManager` +• **agreementStoreManager**: [`AgreementStoreManager`](AgreementStoreManager.md) Template store manager smart contract instance. #### Defined in -[src/keeper/Keeper.ts:316](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L316) +[src/keeper/Keeper.ts:268](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L268) --- ### conditionStoreManager -• **conditionStoreManager**: `ConditionStoreManager` +• **conditionStoreManager**: [`ConditionStoreManager`](ConditionStoreManager.md) Template store manager smart contract instance. #### Defined in -[src/keeper/Keeper.ts:321](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L321) +[src/keeper/Keeper.ts:273](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L273) --- @@ -116,39 +114,39 @@ Conditions instances. #### Type declaration -| Name | Type | -| :--------------------------------- | :----------------------------------------------------------------------------------- | -| `aaveBorrowCondition` | [`AaveBorrowCondition`](conditions.AaveBorrowCondition.md) | -| `aaveCollateralDepositCondition` | [`AaveCollateralDepositCondition`](conditions.AaveCollateralDepositCondition.md) | -| `aaveCollateralWithdrawCondition` | [`AaveCollateralWithdrawCondition`](conditions.AaveCollateralWithdrawCondition.md) | -| `aaveRepayCondition` | [`AaveRepayCondition`](conditions.AaveRepayCondition.md) | -| `accessCondition` | [`AccessCondition`](conditions.AccessCondition.md) | -| `computeExecutionCondition` | [`ComputeExecutionCondition`](conditions.ComputeExecutionCondition.md) | -| `distributeNftCollateralCondition` | [`DistributeNFTCollateralCondition`](conditions.DistributeNFTCollateralCondition.md) | -| `escrowPaymentCondition` | [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md) | -| `lockPaymentCondition` | [`LockPaymentCondition`](conditions.LockPaymentCondition.md) | -| `nft721HolderCondition` | [`NFT721HolderCondition`](conditions.NFT721HolderCondition.md) | -| `nft721LockCondition` | [`NFT721LockCondition`](conditions.NFT721LockCondition.md) | -| `nftAccessCondition` | [`NFTAccessCondition`](conditions.NFTAccessCondition.md) | -| `nftHolderCondition` | [`NFTHolderCondition`](conditions.NFTHolderCondition.md) | -| `nftLockCondition` | [`NFTLockCondition`](conditions.NFTLockCondition.md) | -| `transferDidOwnershipCondition` | [`TransferDIDOwnershipCondition`](conditions.TransferDIDOwnershipCondition.md) | -| `transferNft721Condition` | [`TransferNFT721Condition`](conditions.TransferNFT721Condition.md) | -| `transferNftCondition` | [`TransferNFTCondition`](conditions.TransferNFTCondition.md) | +| Name | Type | +| :--------------------------------- | :------------------------------------------------------------------------ | +| `aaveBorrowCondition` | [`AaveBorrowCondition`](AaveBorrowCondition.md) | +| `aaveCollateralDepositCondition` | [`AaveCollateralDepositCondition`](AaveCollateralDepositCondition.md) | +| `aaveCollateralWithdrawCondition` | [`AaveCollateralWithdrawCondition`](AaveCollateralWithdrawCondition.md) | +| `aaveRepayCondition` | [`AaveRepayCondition`](AaveRepayCondition.md) | +| `accessCondition` | [`AccessCondition`](AccessCondition.md) | +| `computeExecutionCondition` | [`ComputeExecutionCondition`](ComputeExecutionCondition.md) | +| `distributeNftCollateralCondition` | [`DistributeNFTCollateralCondition`](DistributeNFTCollateralCondition.md) | +| `escrowPaymentCondition` | [`EscrowPaymentCondition`](EscrowPaymentCondition.md) | +| `lockPaymentCondition` | [`LockPaymentCondition`](LockPaymentCondition.md) | +| `nft721HolderCondition` | [`NFT721HolderCondition`](NFT721HolderCondition.md) | +| `nft721LockCondition` | [`NFT721LockCondition`](NFT721LockCondition.md) | +| `nftAccessCondition` | [`NFTAccessCondition`](NFTAccessCondition.md) | +| `nftHolderCondition` | [`NFTHolderCondition`](NFTHolderCondition.md) | +| `nftLockCondition` | [`NFTLockCondition`](NFTLockCondition.md) | +| `transferDidOwnershipCondition` | [`TransferDIDOwnershipCondition`](TransferDIDOwnershipCondition.md) | +| `transferNft721Condition` | [`TransferNFT721Condition`](TransferNFT721Condition.md) | +| `transferNftCondition` | [`TransferNFTCondition`](TransferNFTCondition.md) | #### Defined in -[src/keeper/Keeper.ts:326](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L326) +[src/keeper/Keeper.ts:278](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L278) --- ### conditionsList -• **conditionsList**: [`ConditionSmall`](conditions.ConditionSmall.md)[] +• **conditionsList**: [`ConditionSmall`](ConditionSmall.md)[] #### Defined in -[src/keeper/Keeper.ts:346](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L346) +[src/keeper/Keeper.ts:298](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L298) --- @@ -160,31 +158,31 @@ Is connected to the correct network or not. #### Defined in -[src/keeper/Keeper.ts:281](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L281) +[src/keeper/Keeper.ts:233](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L233) --- ### didRegistry -• **didRegistry**: `default` +• **didRegistry**: [`DIDRegistry`](DIDRegistry.md) DID registry smart contract instance. #### Defined in -[src/keeper/Keeper.ts:301](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L301) +[src/keeper/Keeper.ts:253](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L253) --- ### dispenser -• **dispenser**: `default` +• **dispenser**: [`Dispenser`](Dispenser.md) Market smart contract instance. #### Defined in -[src/keeper/Keeper.ts:291](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L291) +[src/keeper/Keeper.ts:243](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L243) --- @@ -194,11 +192,11 @@ Market smart contract instance. #### Index signature -▪ [contractRef: `string`]: `ContractBase` & `any` +▪ [contractRef: `string`]: [`ContractBase`](ContractBase.md) & `any` #### Defined in -[src/keeper/Keeper.ts:392](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L392) +[src/keeper/Keeper.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L353) --- @@ -210,26 +208,28 @@ Network id loaded from web3 #### Type declaration -| Name | Type | -| :-------- | :-------- | -| `id?` | `number` | -| `loading` | `boolean` | +| Name | Type | Description | +| :--------- | :-------- | :--------------------------------- | +| `chainId?` | `number` | chainId of the network | +| `loading` | `boolean` | True if keeper is still connecting | +| `name?` | `string` | Name of the network | +| `version?` | `string` | Version of the artifacts in use | #### Defined in -[src/keeper/Keeper.ts:385](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L385) +[src/keeper/Keeper.ts:332](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L332) --- ### nftUpgradeable -• **nftUpgradeable**: `NFT1155Upgradeable` +• **nftUpgradeable**: [`Nft1155Contract`](Nft1155Contract.md) NFT upgradeable smart contract instance. #### Defined in -[src/keeper/Keeper.ts:306](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L306) +[src/keeper/Keeper.ts:258](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L258) --- @@ -241,17 +241,17 @@ Nevermined Config smart contract instance. #### Defined in -[src/keeper/Keeper.ts:296](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L296) +[src/keeper/Keeper.ts:248](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L248) --- ### rewardsDistributor -• **rewardsDistributor**: `RewardsDistributor` +• **rewardsDistributor**: [`RewardsDistributor`](RewardsDistributor.md) #### Defined in -[src/keeper/Keeper.ts:368](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L368) +[src/keeper/Keeper.ts:320](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L320) --- @@ -261,36 +261,36 @@ Nevermined Config smart contract instance. #### Type declaration -| Name | Type | -| :--------- | :------------------ | -| `curve` | `CurveRoyalties` | -| `standard` | `StandardRoyalties` | +| Name | Type | +| :--------- | :------------------------------------------ | +| `curve` | [`CurveRoyalties`](CurveRoyalties.md) | +| `standard` | [`StandardRoyalties`](StandardRoyalties.md) | #### Defined in -[src/keeper/Keeper.ts:363](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L363) +[src/keeper/Keeper.ts:315](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L315) --- ### templateList -• **templateList**: `GenericAccess`[] +• **templateList**: [`GenericAccess`](../interfaces/GenericAccess.md)[] #### Defined in -[src/keeper/Keeper.ts:347](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L347) +[src/keeper/Keeper.ts:299](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L299) --- ### templateStoreManager -• **templateStoreManager**: `TemplateStoreManager` +• **templateStoreManager**: [`TemplateStoreManager`](TemplateStoreManager.md) Template store manager smart contract instance. #### Defined in -[src/keeper/Keeper.ts:311](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L311) +[src/keeper/Keeper.ts:263](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L263) --- @@ -302,32 +302,32 @@ Templates instances. #### Type declaration -| Name | Type | -| :------------------------------- | :------------------------------------------------------------------------------ | -| `aaveCreditTemplate` | [`AaveCreditTemplate`](templates.AaveCreditTemplate.md) | -| `accessTemplate` | [`AccessTemplate`](templates.AccessTemplate.md) | -| `didSalesTemplate` | [`DIDSalesTemplate`](templates.DIDSalesTemplate.md) | -| `escrowComputeExecutionTemplate` | [`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md) | -| `nft721AccessTemplate` | [`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md) | -| `nft721SalesTemplate` | [`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md) | -| `nftAccessTemplate` | [`NFTAccessTemplate`](templates.NFTAccessTemplate.md) | -| `nftSalesTemplate` | [`NFTSalesTemplate`](templates.NFTSalesTemplate.md) | +| Name | Type | +| :------------------------------- | :-------------------------------------------------------------------- | +| `aaveCreditTemplate` | [`AaveCreditTemplate`](AaveCreditTemplate.md) | +| `accessTemplate` | [`AccessTemplate`](AccessTemplate.md) | +| `didSalesTemplate` | [`DIDSalesTemplate`](DIDSalesTemplate.md) | +| `escrowComputeExecutionTemplate` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft721AccessTemplate` | [`NFT721AccessTemplate`](NFT721AccessTemplate.md) | +| `nft721SalesTemplate` | [`NFT721SalesTemplate`](NFT721SalesTemplate.md) | +| `nftAccessTemplate` | [`NFTAccessTemplate`](NFTAccessTemplate.md) | +| `nftSalesTemplate` | [`NFTSalesTemplate`](NFTSalesTemplate.md) | #### Defined in -[src/keeper/Keeper.ts:352](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L352) +[src/keeper/Keeper.ts:304](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L304) --- ### token -• **token**: `default` +• **token**: [`Token`](Token.md) Nevermined Token smart contract instance. #### Defined in -[src/keeper/Keeper.ts:286](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L286) +[src/keeper/Keeper.ts:238](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L238) --- @@ -339,31 +339,37 @@ Helpers for contracts. #### Type declaration -| Name | Type | -| :------------- | :--------------------------------------- | -| `eventHandler` | [`EventHandler`](events.EventHandler.md) | +| Name | Type | +| :------------- | :-------------------------------- | +| `eventHandler` | [`EventHandler`](EventHandler.md) | #### Defined in -[src/keeper/Keeper.ts:373](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L373) +[src/keeper/Keeper.ts:325](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L325) ---- +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` -### version +#### Returns + +`string` -• **version**: `string` +#### Inherited from -Version of the artifacts in use +Instantiable.artifactsFolder #### Defined in -[src/keeper/Keeper.ts:380](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L380) +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) -## Accessors +--- -### artifactsFolder +### circuitsFolder -• `Protected` `get` **artifactsFolder**(): `string` +• `Protected` `get` **circuitsFolder**(): `string` #### Returns @@ -371,21 +377,21 @@ Version of the artifacts in use #### Inherited from -Instantiable.artifactsFolder +Instantiable.circuitsFolder #### Defined in -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) --- ### config -• `Protected` `get` **config**(): [`Config`](Config.md) +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) #### Returns -[`Config`](Config.md) +[`NeverminedOptions`](NeverminedOptions.md) #### Inherited from @@ -393,17 +399,17 @@ Instantiable.config #### Defined in -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) --- ### instanceConfig -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -411,17 +417,17 @@ Instantiable.instanceConfig #### Defined in -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) --- ### instantiableConfig -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -429,17 +435,17 @@ Instantiable.instantiableConfig #### Defined in -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) --- ### logger -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) +• `Protected` `get` **logger**(): `Logger` #### Returns -[`Logger`](utils.Logger.md) +`Logger` #### Inherited from @@ -447,7 +453,7 @@ Instantiable.logger #### Defined in -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) --- @@ -465,17 +471,17 @@ Instantiable.nevermined #### Defined in -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) --- ### web3 -• `Protected` `get` **web3**(): `JsonRpcProvider` +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` #### Returns -`JsonRpcProvider` +`JsonRpcProvider` \| `BrowserProvider` #### Inherited from @@ -483,83 +489,13 @@ Instantiable.web3 #### Defined in -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) ## Methods -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -Instantiable.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - ### getAccessTemplateByName -▸ **getAccessTemplateByName**(`name`): `GenericAccess` +▸ **getAccessTemplateByName**(`name`): [`GenericAccess`](../interfaces/GenericAccess.md) Returns a Access template by name. @@ -571,13 +507,13 @@ Returns a Access template by name. #### Returns -`GenericAccess` +[`GenericAccess`](../interfaces/GenericAccess.md) Agreement template instance. #### Defined in -[src/keeper/Keeper.ts:419](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L419) +[src/keeper/Keeper.ts:417](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L417) --- @@ -591,13 +527,13 @@ Agreement template instance. #### Defined in -[src/keeper/Keeper.ts:459](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L459) +[src/keeper/Keeper.ts:430](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L430) --- ### getConditionByAddress -▸ **getConditionByAddress**(`address`): [`ConditionSmall`](conditions.ConditionSmall.md) +▸ **getConditionByAddress**(`address`): [`ConditionSmall`](ConditionSmall.md) Returns a condition by address. @@ -609,13 +545,13 @@ Returns a condition by address. #### Returns -[`ConditionSmall`](conditions.ConditionSmall.md) +[`ConditionSmall`](ConditionSmall.md) Condition instance. #### Defined in -[src/keeper/Keeper.ts:399](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L399) +[src/keeper/Keeper.ts:360](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L360) --- @@ -633,7 +569,7 @@ Network ID. #### Defined in -[src/keeper/Keeper.ts:446](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L446) +[src/keeper/Keeper.ts:388](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L388) --- @@ -651,13 +587,31 @@ Network name. #### Defined in -[src/keeper/Keeper.ts:438](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L438) +[src/keeper/Keeper.ts:377](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L377) + +--- + +### getNetworkVersion + +▸ **getNetworkVersion**(): `string` + +Returns the network version. + +#### Returns + +`string` + +Network version. + +#### Defined in + +[src/keeper/Keeper.ts:405](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L405) --- ### getTemplateByAddress -▸ **getTemplateByAddress**(`address`): [`AccessTemplate`](templates.AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](templates.DIDSalesTemplate.md) \| [`NFTAccessTemplate`](templates.NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](templates.NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](templates.AaveCreditTemplate.md) +▸ **getTemplateByAddress**(`address`): [`AccessTemplate`](AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](DIDSalesTemplate.md) \| [`NFTAccessTemplate`](NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](AaveCreditTemplate.md) Returns a template by address. @@ -669,19 +623,19 @@ Returns a template by address. #### Returns -[`AccessTemplate`](templates.AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](templates.DIDSalesTemplate.md) \| [`NFTAccessTemplate`](templates.NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](templates.NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](templates.AaveCreditTemplate.md) +[`AccessTemplate`](AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](DIDSalesTemplate.md) \| [`NFTAccessTemplate`](NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](AaveCreditTemplate.md) Agreement template instance. #### Defined in -[src/keeper/Keeper.ts:428](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L428) +[src/keeper/Keeper.ts:426](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L426) --- ### getTemplateByName -▸ **getTemplateByName**(`name`): [`AccessTemplate`](templates.AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](templates.DIDSalesTemplate.md) \| [`NFTAccessTemplate`](templates.NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](templates.NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](templates.AaveCreditTemplate.md) +▸ **getTemplateByName**(`name`): [`AccessTemplate`](AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](DIDSalesTemplate.md) \| [`NFTAccessTemplate`](NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](AaveCreditTemplate.md) Returns a template by name. @@ -693,13 +647,13 @@ Returns a template by name. #### Returns -[`AccessTemplate`](templates.AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](templates.DIDSalesTemplate.md) \| [`NFTAccessTemplate`](templates.NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](templates.NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](templates.AaveCreditTemplate.md) +[`AccessTemplate`](AccessTemplate.md) \| [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) \| [`DIDSalesTemplate`](DIDSalesTemplate.md) \| [`NFTAccessTemplate`](NFTAccessTemplate.md) \| [`NFT721AccessTemplate`](NFT721AccessTemplate.md) \| [`NFTSalesTemplate`](NFTSalesTemplate.md) \| [`NFT721SalesTemplate`](NFT721SalesTemplate.md) \| [`AaveCreditTemplate`](AaveCreditTemplate.md) Agreement template instance. #### Defined in -[src/keeper/Keeper.ts:408](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L408) +[src/keeper/Keeper.ts:369](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L369) --- @@ -713,82 +667,59 @@ Agreement template instance. #### Defined in -[src/keeper/Keeper.ts:74](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L74) +[src/keeper/Keeper.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L68) --- -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters +### loadAaveInstances -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | +▸ **loadAaveInstances**(): `Promise`<[`Keeper`](Keeper.md)\> #### Returns -`void` - -#### Inherited from - -Instantiable.setInstanceConfig +`Promise`<[`Keeper`](Keeper.md)\> #### Defined in -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) +[src/keeper/Keeper.ts:434](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L434) --- -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> +### loadCurveRoyaltiesInstance -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | +▸ **loadCurveRoyaltiesInstance**(): `Promise`<[`CurveRoyalties`](CurveRoyalties.md)\> #### Returns -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addressesStatic +`Promise`<[`CurveRoyalties`](CurveRoyalties.md)\> #### Defined in -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) +[src/keeper/Keeper.ts:457](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L457) --- -### findSignerStatic +### setInstanceConfig -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> +▸ `Protected` **setInstanceConfig**(`config`): `void` #### Parameters -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns -`Promise`<`Signer`\> +`void` #### Inherited from -Instantiable.findSignerStatic +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) #### Defined in -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) --- @@ -800,9 +731,9 @@ Returns Keeper instance. #### Parameters -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -812,11 +743,11 @@ Returns Keeper instance. #### Overrides -Instantiable.getInstance +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) #### Defined in -[src/keeper/Keeper.ts:68](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/Keeper.ts#L68) +[src/keeper/Keeper.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Keeper.ts#L62) --- @@ -826,16 +757,16 @@ Instantiable.getInstance #### Type parameters -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | #### Parameters -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -843,8 +774,8 @@ Instantiable.getInstance #### Inherited from -Instantiable.setInstanceConfig +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) #### Defined in -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/KeeperError.md b/docs/api-reference/classes/KeeperError.md new file mode 100644 index 000000000..0379a410a --- /dev/null +++ b/docs/api-reference/classes/KeeperError.md @@ -0,0 +1,165 @@ +[@nevermined-io/sdk](../code-reference.md) / KeeperError + +# Class: KeeperError + +## Hierarchy + +- `Error` + + ↳ **`KeeperError`** + +## Table of contents + +### Constructors + +- [constructor](KeeperError.md#constructor) + +### Properties + +- [message](KeeperError.md#message) +- [name](KeeperError.md#name) +- [stack](KeeperError.md#stack) +- [prepareStackTrace](KeeperError.md#preparestacktrace) +- [stackTraceLimit](KeeperError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](KeeperError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new KeeperError**(`message`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/KeeperError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/KeeperError.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/LockPaymentCondition.md b/docs/api-reference/classes/LockPaymentCondition.md new file mode 100644 index 000000000..2211f9d76 --- /dev/null +++ b/docs/api-reference/classes/LockPaymentCondition.md @@ -0,0 +1,949 @@ +[@nevermined-io/sdk](../code-reference.md) / LockPaymentCondition + +# Class: LockPaymentCondition + +## Hierarchy + +- [`ConsumerCondition`](ConsumerCondition.md)<[`ConditionContext`](../interfaces/ConditionContext.md)\> + + ↳ **`LockPaymentCondition`** + +## Table of contents + +### Constructors + +- [constructor](LockPaymentCondition.md#constructor) + +### Properties + +- [address](LockPaymentCondition.md#address) +- [contract](LockPaymentCondition.md#contract) +- [contractName](LockPaymentCondition.md#contractname) +- [events](LockPaymentCondition.md#events) +- [version](LockPaymentCondition.md#version) + +### Accessors + +- [artifactsFolder](LockPaymentCondition.md#artifactsfolder) +- [circuitsFolder](LockPaymentCondition.md#circuitsfolder) +- [config](LockPaymentCondition.md#config) +- [instanceConfig](LockPaymentCondition.md#instanceconfig) +- [instantiableConfig](LockPaymentCondition.md#instantiableconfig) +- [logger](LockPaymentCondition.md#logger) +- [nevermined](LockPaymentCondition.md#nevermined) +- [web3](LockPaymentCondition.md#web3) + +### Methods + +- [abortByTimeOut](LockPaymentCondition.md#abortbytimeout) +- [call](LockPaymentCondition.md#call) +- [fulfill](LockPaymentCondition.md#fulfill) +- [fulfillInstance](LockPaymentCondition.md#fulfillinstance) +- [fulfillPlain](LockPaymentCondition.md#fulfillplain) +- [fulfillWithNode](LockPaymentCondition.md#fulfillwithnode) +- [generateId](LockPaymentCondition.md#generateid) +- [generateIdHash](LockPaymentCondition.md#generateidhash) +- [generateIdWithSeed](LockPaymentCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](LockPaymentCondition.md#getconditionfulfilledevent) +- [getFromAddress](LockPaymentCondition.md#getfromaddress) +- [getInputsOfMethod](LockPaymentCondition.md#getinputsofmethod) +- [getSignatureOfMethod](LockPaymentCondition.md#getsignatureofmethod) +- [hashValues](LockPaymentCondition.md#hashvalues) +- [hashValuesPlain](LockPaymentCondition.md#hashvaluesplain) +- [init](LockPaymentCondition.md#init) +- [instance](LockPaymentCondition.md#instance) +- [instanceFromDDO](LockPaymentCondition.md#instancefromddo) +- [params](LockPaymentCondition.md#params) +- [paramsFromDDO](LockPaymentCondition.md#paramsfromddo) +- [send](LockPaymentCondition.md#send) +- [sendFrom](LockPaymentCondition.md#sendfrom) +- [setInstanceConfig](LockPaymentCondition.md#setinstanceconfig) +- [getInstance](LockPaymentCondition.md#getinstance) +- [setInstanceConfig](LockPaymentCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new LockPaymentCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[constructor](ConsumerCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[address](ConsumerCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contract](ConsumerCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contractName](ConsumerCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[events](ConsumerCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[version](ConsumerCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ConsumerCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ConsumerCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ConsumerCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ConsumerCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[abortByTimeOut](ConsumerCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[call](ConsumerCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[fulfill](ConsumerCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/LockPaymentCondition.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/LockPaymentCondition.ts#L42) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillInstance](ConsumerCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillPlain](ConsumerCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`_cond`, `_additionalParams`, `_from?`, `_txParams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------------ | :----------------------------------------------------------------------------------------- | +| `_cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `_additionalParams` | `Record`<`string`, `unknown`\> | +| `_from?` | [`Account`](Account.md) | +| `_txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillWithNode](ConsumerCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:217](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L217) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateId](ConsumerCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdHash](ConsumerCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdWithSeed](ConsumerCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getConditionFulfilledEvent](ConsumerCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getFromAddress](ConsumerCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getInputsOfMethod](ConsumerCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getSignatureOfMethod](ConsumerCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValues](ConsumerCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValuesPlain](ConsumerCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[init](ConsumerCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instance](ConsumerCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | [`ConditionContext`](../interfaces/ConditionContext.md) | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instanceFromDDO](ConsumerCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### params + +▸ **params**(`did`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :-------------- | :--------- | +| `did` | `string` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[params](ConsumerCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/LockPaymentCondition.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/LockPaymentCondition.ts#L13) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :------------------------------------------------------ | +| `«destructured»` | [`ConditionContext`](../interfaces/ConditionContext.md) | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[paramsFromDDO](ConsumerCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/LockPaymentCondition.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/LockPaymentCondition.ts#L31) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[send](ConsumerCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[sendFrom](ConsumerCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`LockPaymentCondition`](LockPaymentCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`LockPaymentCondition`](LockPaymentCondition.md)\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[getInstance](ConsumerCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/LockPaymentCondition.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/LockPaymentCondition.ts#L9) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/MarketplaceApi.md b/docs/api-reference/classes/MarketplaceApi.md new file mode 100644 index 000000000..0f0c40a1f --- /dev/null +++ b/docs/api-reference/classes/MarketplaceApi.md @@ -0,0 +1,340 @@ +[@nevermined-io/sdk](../code-reference.md) / MarketplaceApi + +# Class: MarketplaceApi + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`MarketplaceApi`** + + ↳↳ [`Bookmarks`](Bookmarks.md) + + ↳↳ [`MetadataService`](MetadataService.md) + + ↳↳ [`Permissions`](Permissions.md) + + ↳↳ [`Profiles`](Profiles.md) + +## Table of contents + +### Constructors + +- [constructor](MarketplaceApi.md#constructor) + +### Accessors + +- [artifactsFolder](MarketplaceApi.md#artifactsfolder) +- [circuitsFolder](MarketplaceApi.md#circuitsfolder) +- [config](MarketplaceApi.md#config) +- [instanceConfig](MarketplaceApi.md#instanceconfig) +- [instantiableConfig](MarketplaceApi.md#instantiableconfig) +- [logger](MarketplaceApi.md#logger) +- [nevermined](MarketplaceApi.md#nevermined) +- [url](MarketplaceApi.md#url) +- [web3](MarketplaceApi.md#web3) + +### Methods + +- [addNewAddress](MarketplaceApi.md#addnewaddress) +- [login](MarketplaceApi.md#login) +- [setInstanceConfig](MarketplaceApi.md#setinstanceconfig) +- [getInstance](MarketplaceApi.md#getinstance) +- [setInstanceConfig](MarketplaceApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new MarketplaceApi**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L7) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### url + +• `Protected` `get` **url**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L12) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addNewAddress + +▸ **addNewAddress**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L36) + +--- + +### login + +▸ **login**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L16) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/MetadataService.md b/docs/api-reference/classes/MetadataService.md new file mode 100644 index 000000000..04af128dd --- /dev/null +++ b/docs/api-reference/classes/MetadataService.md @@ -0,0 +1,671 @@ +[@nevermined-io/sdk](../code-reference.md) / MetadataService + +# Class: MetadataService + +Provides a interface with Metadata. +Metadata provides an off-chain database store for metadata about data assets. + +## Hierarchy + +- [`MarketplaceApi`](MarketplaceApi.md) + + ↳ **`MetadataService`** + +## Table of contents + +### Constructors + +- [constructor](MetadataService.md#constructor) + +### Accessors + +- [artifactsFolder](MetadataService.md#artifactsfolder) +- [circuitsFolder](MetadataService.md#circuitsfolder) +- [config](MetadataService.md#config) +- [instanceConfig](MetadataService.md#instanceconfig) +- [instantiableConfig](MetadataService.md#instantiableconfig) +- [logger](MetadataService.md#logger) +- [nevermined](MetadataService.md#nevermined) +- [url](MetadataService.md#url) +- [web3](MetadataService.md#web3) + +### Methods + +- [addNewAddress](MetadataService.md#addnewaddress) +- [delete](MetadataService.md#delete) +- [getAccessUrl](MetadataService.md#getaccessurl) +- [getServiceEndpoint](MetadataService.md#getserviceendpoint) +- [getVersionInfo](MetadataService.md#getversioninfo) +- [login](MetadataService.md#login) +- [queryMetadata](MetadataService.md#querymetadata) +- [queryServiceMetadata](MetadataService.md#queryservicemetadata) +- [retrieveDDO](MetadataService.md#retrieveddo) +- [retrieveDDOByUrl](MetadataService.md#retrieveddobyurl) +- [retrieveDDOFromImmutableBackend](MetadataService.md#retrieveddofromimmutablebackend) +- [retrieveService](MetadataService.md#retrieveservice) +- [setInstanceConfig](MetadataService.md#setinstanceconfig) +- [status](MetadataService.md#status) +- [storeDDO](MetadataService.md#storeddo) +- [storeService](MetadataService.md#storeservice) +- [updateDDO](MetadataService.md#updateddo) +- [getInstance](MetadataService.md#getinstance) +- [setInstanceConfig](MetadataService.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new MetadataService**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[constructor](MarketplaceApi.md#constructor) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L7) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +MarketplaceApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +MarketplaceApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +MarketplaceApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### url + +• `Protected` `get` **url**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.url + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L12) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +MarketplaceApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addNewAddress + +▸ **addNewAddress**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[addNewAddress](MarketplaceApi.md#addnewaddress) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L36) + +--- + +### delete + +▸ **delete**(`did`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | +| :---- | :-------------------------- | +| `did` | `string` \| [`DID`](DID.md) | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/services/metadata/MetadataService.ts:240](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L240) + +--- + +### getAccessUrl + +▸ **getAccessUrl**(`accessToken`, `payload`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :---- | +| `accessToken` | `any` | +| `payload` | `any` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/services/metadata/MetadataService.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L46) + +--- + +### getServiceEndpoint + +▸ **getServiceEndpoint**(`did`): `string` + +#### Parameters + +| Name | Type | +| :---- | :-------------- | +| `did` | [`DID`](DID.md) | + +#### Returns + +`string` + +#### Defined in + +[src/services/metadata/MetadataService.ts:356](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L356) + +--- + +### getVersionInfo + +▸ **getVersionInfo**(): `Promise`<`any`\> + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/metadata/MetadataService.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L42) + +--- + +### login + +▸ **login**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[login](MarketplaceApi.md#login) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L16) + +--- + +### queryMetadata + +▸ **queryMetadata**(`query`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search over the DDOs using a query. + +#### Parameters + +| Name | Type | Description | +| :------ | :-------------------------------------------- | :------------------------ | +| `query` | [`SearchQuery`](../interfaces/SearchQuery.md) | Query to filter the DDOs. | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +A list of [QueryResult](../interfaces/QueryResult.md)s. + +#### Defined in + +[src/services/metadata/MetadataService.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L74) + +--- + +### queryServiceMetadata + +▸ **queryServiceMetadata**(`query`): `Promise`<[`ServiceSecondary`](../interfaces/ServiceSecondary.md)[]\> + +Search over the Services using a query. + +#### Parameters + +| Name | Type | Description | +| :------ | :------- | :---------------------------- | +| `query` | `Object` | Query to filter the Services. | + +#### Returns + +`Promise`<[`ServiceSecondary`](../interfaces/ServiceSecondary.md)[]\> + +A list of [ServiceSecondary](../interfaces/ServiceSecondary.md). + +#### Defined in + +[src/services/metadata/MetadataService.ts:106](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L106) + +--- + +### retrieveDDO + +▸ **retrieveDDO**(`did?`, `metadataServiceEndpoint?`): `Promise`<[`DDO`](DDO.md)\> + +Retrieves a DDO by DID. + +#### Parameters + +| Name | Type | Description | +| :------------------------- | :-------------------------- | :------------------------- | +| `did?` | `string` \| [`DID`](DID.md) | DID of the asset. | +| `metadataServiceEndpoint?` | `string` | Metadata service endpoint. | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +DDO of the asset. + +#### Defined in + +[src/services/metadata/MetadataService.ts:196](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L196) + +--- + +### retrieveDDOByUrl + +▸ **retrieveDDOByUrl**(`metadataServiceEndpoint?`): `Promise`<[`DDO`](DDO.md)\> + +#### Parameters + +| Name | Type | +| :------------------------- | :------- | +| `metadataServiceEndpoint?` | `string` | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +#### Defined in + +[src/services/metadata/MetadataService.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L252) + +--- + +### retrieveDDOFromImmutableBackend + +▸ **retrieveDDOFromImmutableBackend**(`immutableUrl`): `Promise`<[`DDO`](DDO.md)\> + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `immutableUrl` | `string` | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +#### Defined in + +[src/services/metadata/MetadataService.ts:229](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L229) + +--- + +### retrieveService + +▸ **retrieveService**(`agreementId`, `metadataServiceEndpoint?`): `Promise`<[`ServiceSecondary`](../interfaces/ServiceSecondary.md)\> + +Retrieves a service by its agreementId. + +#### Parameters + +| Name | Type | Description | +| :------------------------- | :------- | :-------------------------- | +| `agreementId` | `string` | agreementId of the service. | +| `metadataServiceEndpoint?` | `string` | - | + +#### Returns + +`Promise`<[`ServiceSecondary`](../interfaces/ServiceSecondary.md)\> + +Service object. + +#### Defined in + +[src/services/metadata/MetadataService.ts:291](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L291) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### status + +▸ **status**(`did`, `metadataServiceEndpoint?`): `Promise`<[`DDOStatus`](../interfaces/DDOStatus.md)\> + +Retrieves a DDO by DID. + +#### Parameters + +| Name | Type | Description | +| :------------------------- | :-------------------------- | :---------------- | +| `did` | `string` \| [`DID`](DID.md) | DID of the asset. | +| `metadataServiceEndpoint?` | `string` | - | + +#### Returns + +`Promise`<[`DDOStatus`](../interfaces/DDOStatus.md)\> + +DDO of the asset. + +#### Defined in + +[src/services/metadata/MetadataService.ts:261](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L261) + +--- + +### storeDDO + +▸ **storeDDO**(`ddo`): `Promise`<[`DDO`](DDO.md)\> + +Stores a DDO in Metadata. + +#### Parameters + +| Name | Type | Description | +| :---- | :-------------- | :---------------- | +| `ddo` | [`DDO`](DDO.md) | DDO to be stored. | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +Final DDO. + +#### Defined in + +[src/services/metadata/MetadataService.ts:164](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L164) + +--- + +### storeService + +▸ **storeService**(`agreementId`, `agreement`): `Promise`<[`ServiceSecondary`](../interfaces/ServiceSecondary.md)\> + +#### Parameters + +| Name | Type | Description | +| :------------ | :------------------------------------------------------ | :--------------------------------------------- | +| `agreementId` | `string` | The agreement ID of the service. | +| `agreement` | [`ServiceSecondary`](../interfaces/ServiceSecondary.md) | Stores the Service object with its agreementId | + +#### Returns + +`Promise`<[`ServiceSecondary`](../interfaces/ServiceSecondary.md)\> + +the newly stored service object + +#### Defined in + +[src/services/metadata/MetadataService.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L324) + +--- + +### updateDDO + +▸ **updateDDO**(`did`, `ddo`): `Promise`<[`DDO`](DDO.md)\> + +Update a DDO in Metadata. + +#### Parameters + +| Name | Type | Description | +| :---- | :-------------------------- | :---------------- | +| `did` | `string` \| [`DID`](DID.md) | - | +| `ddo` | [`DDO`](DDO.md) | DDO to be stored. | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +Final DDO. + +#### Defined in + +[src/services/metadata/MetadataService.ts:132](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L132) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[getInstance](MarketplaceApi.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/KeyTransfer.MimcCipher.md b/docs/api-reference/classes/MimcCipher.md similarity index 58% rename from docs/api-reference/classes/KeyTransfer.MimcCipher.md rename to docs/api-reference/classes/MimcCipher.md index 5f57f8926..328b4a152 100644 --- a/docs/api-reference/classes/KeyTransfer.MimcCipher.md +++ b/docs/api-reference/classes/MimcCipher.md @@ -1,23 +1,21 @@ -[@nevermined-io/sdk](../code-reference.md) / [KeyTransfer](../modules/KeyTransfer.md) / MimcCipher +[@nevermined-io/sdk](../code-reference.md) / MimcCipher # Class: MimcCipher -[KeyTransfer](../modules/KeyTransfer.md).MimcCipher - ## Table of contents ### Constructors -- [constructor](KeyTransfer.MimcCipher.md#constructor) +- [constructor](MimcCipher.md#constructor) ### Properties -- [x](KeyTransfer.MimcCipher.md#x) -- [y](KeyTransfer.MimcCipher.md#y) +- [x](MimcCipher.md#x) +- [y](MimcCipher.md#y) ### Methods -- [param](KeyTransfer.MimcCipher.md#param) +- [param](MimcCipher.md#param) ## Constructors @@ -34,7 +32,7 @@ #### Defined in -[src/models/KeyTransfer.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L23) +[src/models/KeyTransfer.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L23) ## Properties @@ -44,7 +42,7 @@ #### Defined in -[src/models/KeyTransfer.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L20) +[src/models/KeyTransfer.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L20) --- @@ -54,7 +52,7 @@ #### Defined in -[src/models/KeyTransfer.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L21) +[src/models/KeyTransfer.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L21) ## Methods @@ -68,4 +66,4 @@ #### Defined in -[src/models/KeyTransfer.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L28) +[src/models/KeyTransfer.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/KeyTransfer.ts#L28) diff --git a/docs/api-reference/classes/NFT1155Api.md b/docs/api-reference/classes/NFT1155Api.md new file mode 100644 index 000000000..918cb9965 --- /dev/null +++ b/docs/api-reference/classes/NFT1155Api.md @@ -0,0 +1,1598 @@ +[@nevermined-io/sdk](../code-reference.md) / NFT1155Api + +# Class: NFT1155Api + +Allows the interaction with external ERC-1155 NFT contracts built on top of the Nevermined NFT extra features. + +## Hierarchy + +- [`NFTsBaseApi`](NFTsBaseApi.md) + + ↳ **`NFT1155Api`** + + ↳↳ [`SubscriptionCreditsNFTApi`](SubscriptionCreditsNFTApi.md) + +## Table of contents + +### Constructors + +- [constructor](NFT1155Api.md#constructor) + +### Properties + +- [nftContract](NFT1155Api.md#nftcontract) +- [servicePlugin](NFT1155Api.md#serviceplugin) + +### Accessors + +- [address](NFT1155Api.md#address) +- [artifactsFolder](NFT1155Api.md#artifactsfolder) +- [circuitsFolder](NFT1155Api.md#circuitsfolder) +- [config](NFT1155Api.md#config) +- [getContract](NFT1155Api.md#getcontract) +- [instanceConfig](NFT1155Api.md#instanceconfig) +- [instantiableConfig](NFT1155Api.md#instantiableconfig) +- [logger](NFT1155Api.md#logger) +- [nevermined](NFT1155Api.md#nevermined) +- [web3](NFT1155Api.md#web3) + +### Methods + +- [\_details](NFT1155Api.md#_details) +- [access](NFT1155Api.md#access) +- [addRating](NFT1155Api.md#addrating) +- [balance](NFT1155Api.md#balance) +- [burn](NFT1155Api.md#burn) +- [burnFromHolder](NFT1155Api.md#burnfromholder) +- [buySecondaryMarketNft](NFT1155Api.md#buysecondarymarketnft) +- [claim](NFT1155Api.md#claim) +- [claimNFT](NFT1155Api.md#claimnft) +- [create](NFT1155Api.md#create) +- [details](NFT1155Api.md#details) +- [getSubscriptionToken](NFT1155Api.md#getsubscriptiontoken) +- [grantOperatorRole](NFT1155Api.md#grantoperatorrole) +- [isApprovedForAll](NFT1155Api.md#isapprovedforall) +- [isOperator](NFT1155Api.md#isoperator) +- [isOperatorOfDID](NFT1155Api.md#isoperatorofdid) +- [list](NFT1155Api.md#list) +- [listOnSecondaryMarkets](NFT1155Api.md#listonsecondarymarkets) +- [mint](NFT1155Api.md#mint) +- [order](NFT1155Api.md#order) +- [orderAsset](NFT1155Api.md#orderasset) +- [owner](NFT1155Api.md#owner) +- [registerNeverminedAsset](NFT1155Api.md#registerneverminedasset) +- [releaseRewards](NFT1155Api.md#releaserewards) +- [releaseSecondaryMarketRewards](NFT1155Api.md#releasesecondarymarketrewards) +- [resolveAsset](NFT1155Api.md#resolveasset) +- [revokeOperatorRole](NFT1155Api.md#revokeoperatorrole) +- [setApprovalForAll](NFT1155Api.md#setapprovalforall) +- [setInstanceConfig](NFT1155Api.md#setinstanceconfig) +- [transfer](NFT1155Api.md#transfer) +- [updateAsset](NFT1155Api.md#updateasset) +- [getInstance](NFT1155Api.md#getinstance) +- [getNFTContractAddress](NFT1155Api.md#getnftcontractaddress) +- [getServicePlugin](NFT1155Api.md#getserviceplugin) +- [setInstanceConfig](NFT1155Api.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFT1155Api**() + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[constructor](NFTsBaseApi.md#constructor) + +## Properties + +### nftContract + +• **nftContract**: [`Nft1155Contract`](Nft1155Contract.md) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L22) + +--- + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[servicePlugin](NFTsBaseApi.md#serviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### address + +• `get` **address**(): `string` + +Gets the ERC-721 NFT Contract address + +#### Returns + +`string` + +The NFT contract address + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:60](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L60) + +--- + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTsBaseApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTsBaseApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NFTsBaseApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### getContract + +• `get` **getContract**(): [`Nft1155Contract`](Nft1155Contract.md) + +Gets the instance of the ERC-1155 NFT Contract where the API is connected + +#### Returns + +[`Nft1155Contract`](Nft1155Contract.md) + +The `Nft1155Contract` instance + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L68) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTsBaseApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTsBaseApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NFTsBaseApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NFTsBaseApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NFTsBaseApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_details + +▸ `Protected` **\_details**(`did`, `ercType`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `ercType` | [`ERCType`](../enums/ERCType.md) | The type of NFT used | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[\_details](NFTsBaseApi.md#_details) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L150) + +--- + +### access + +▸ **access**(`did`, `consumer`, `destination?`, `fileIndex?`, `agreementId?`, `buyer?`, `babysig?`, `serviceReference?`): `Promise`<`boolean`\> + +Access the files associated with an NFT. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `consumer` | [`Account`](Account.md) | `undefined` | The NFT holder account. | +| `destination?` | `string` | `undefined` | The download destination for the files. | +| `fileIndex?` | `number` | `undefined` | The index of the file. If unset will download all the files in the asset. | +| `agreementId` | `string` | `'0x'` | The NFT sales agreement id. | +| `buyer?` | `string` | `undefined` | Key which represent the buyer | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | - | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service reference to use. By default is nft-access. | + +#### Returns + +`Promise`<`boolean`\> + +true if the access was successful or file if isToDownload is false. + +**`Remarks`** + +This function will call the Node that will check if all the access conditions where fulfilled +before providing the files. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.access(ddo.id, collector, '/tmp/') +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[access](NFTsBaseApi.md#access) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:419](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L419) + +--- + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[addRating](NFTsBaseApi.md#addrating) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### balance + +▸ **balance**(`did`, `account`): `Promise`<`bigint`\> + +Get the NFT balance for a particular did associated to an account/address + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `account` | `string` \| [`Account`](Account.md) | The account/address to check the balance of. | + +#### Returns + +`Promise`<`bigint`\> + +The number of editions of a NFT owned by the account/address. + +**`Example`** + +```ts +const balance = await nevermined.nfts1155.balance(ddo.id, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:466](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L466) + +--- + +### burn + +▸ **burn**(`tokenId`, `nftAmount`, `account`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Burn NFTs associated with an asset. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `tokenId` | `string` | The Decentralized Identifier of the NFT asset. | +| `nftAmount` | `bigint` | The amount of NFTs to burn. | +| `account` | [`Account`](Account.md) | The account of the publisher of the NFT. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +The publisher can only burn NFTs that it owns. NFTs that were already transferred cannot be burned by the publisher. + +**`Example`** + +```ts +await nevermined.nfts1155.burn(did, 2n, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:185](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L185) + +--- + +### burnFromHolder + +▸ **burnFromHolder**(`holder`, `tokenId`, `nftAmount`, `account`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Burn NFTs associated with an asset of a specific account. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :---------------------------------------------- | +| `holder` | `string` | The address of the account that holds the NFTs. | +| `tokenId` | `string` | The TokenId of the NFT | +| `nftAmount` | `bigint` | The amount of NFTs to burn. | +| `account` | `string` \| [`Account`](Account.md) | The account of the publisher of the NFT. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +The publisher can only burn NFTs of an account if is an operator. NFTs that were already transferred cannot be burned by the publisher. + +**`Example`** + +```ts +await nevermined.nfts1155.burnTo(holder, tokenId, 2n, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L213) + +--- + +### buySecondaryMarketNft + +▸ **buySecondaryMarketNft**(`consumer`, `nftAmount?`, `agreementIdSeed`, `conditionsTimeout?`, `txParams?`): `Promise`<`boolean`\> + +Buys a number of listed NFTs on secondary markets. + +#### Parameters + +| Name | Type | Description | +| :------------------ | :---------------------------------------------- | :----------------------------------------- | +| `consumer` | [`Account`](Account.md) | The account of the buyer/consumer. | +| `nftAmount` | `bigint` | The number of assets to buy. 1 by default. | +| `agreementIdSeed` | `string` | - | +| `conditionsTimeout` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`boolean`\> + +true if the buy was successful. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.buySecondaryMarketNft(collector, 1n, agreementId) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error buying the NFT. + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[buySecondaryMarketNft](NFTsBaseApi.md#buysecondarymarketnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:341](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L341) + +--- + +### claim + +▸ **claim**(`agreementId`, `nftHolder`, `nftReceiver`, `numberEditions?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Description | +| :--------------- | :------- | :--------------------------------------------------------------------------- | +| `agreementId` | `string` | The NFT sales agreement id. | +| `nftHolder` | `string` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | The address where the NFT should be transferred. | +| `numberEditions` | `bigint` | The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 | +| `did?` | `string` | The Decentralized Identifier of the asset. | +| `serviceIndex?` | `number` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim(agreementId, editor.getId(), subscriber.getId(), 1n) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:321](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L321) + +--- + +### claimNFT + +▸ `Protected` **claimNFT**(`agreementId`, `nftHolder`, `nftReceiver`, `numberEditions?`, `ercType?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------- | :------------------------------- | :------------ | :--------------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `nftHolder` | `string` | `undefined` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | `undefined` | The address where the NFT should be transferred. | +| `numberEditions` | `bigint` | `undefined` | The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The Type of the NFT ERC (1155 or 721). | +| `did?` | `string` | `undefined` | The DID of the asset. | +| `serviceIndex?` | `number` | `undefined` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim( + agreementId, + editor.getId(), + subscriber.getId(), + nftAmount, + 721, +) +``` + +**`Throws`** + +[NFTError](NFTError.md) if Nevermined is not an operator for this NFT + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[claimNFT](NFTsBaseApi.md#claimnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L50) + +--- + +### create + +▸ **create**(`nftAttributes`, `publisher`, `publicationOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +Creates a new Nevermined asset associated to a NFT (ERC-1155). + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `nftAttributes` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The newly registered [DDO](DDO.md). + +**`Example`** + +```ts +const assetAttributes = AssetAttributes.getInstance({ + metadata, + price: assetPrice, + serviceTypes: ['nft-sales', 'nft-access'], +}) +const nftAttributes = NFTAttributes.getNFT1155Instance({ + ...assetAttributes, + nftContractAddress: nftUpgradeable.address, + cap: cappedAmount, + amount: numberNFTs, + royaltyAttributes, + preMint, +}) +const ddo = await nevermined.nfts1155.create(nftAttributes, publisher) +``` + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:103](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L103) + +--- + +### details + +▸ **details**(`did`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:679](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L679) + +--- + +### getSubscriptionToken + +▸ **getSubscriptionToken**(`did`, `account`): `Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +Get a JWT token for an asset associated with a webService + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------- | :----------------------------------------------------------------------------- | +| `did` | `string` | The did of the asset with a webService resource and an associated subscription | +| `account` | [`Account`](Account.md) | Account of the user requesting the token | + +#### Returns + +`Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +[SubscriptionToken](../interfaces/SubscriptionToken.md) + +**`Example`** + +```ts +const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) + +assert.isDefined(response.accessToken) +assert.isDefined(response.neverminedProxyUri) +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[getSubscriptionToken](NFTsBaseApi.md#getsubscriptiontoken) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:478](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L478) + +--- + +### grantOperatorRole + +▸ **grantOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Adds a minter (`minterAddress`) to the NFT Contract. +Granting and revoking minting permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :--------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be added as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account giving operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts1155.grantOperatorRole(someoneElse, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:625](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L625) + +--- + +### isApprovedForAll + +▸ **isApprovedForAll**(`operatorAddress`, `from`): `Promise`<`unknown`\> + +Returns if the `operatorAddress` is approved + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------- | :--------------------------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address to check the permissions | +| `from` | `string` | The address of the account granting or revoking the permissions via `setApprovalForAll`. | + +#### Returns + +`Promise`<`unknown`\> + +Boolean saying if the `operatorAddress` is approved + +**`See`** + +[claim](NFT1155Api.md#claim) + +**`Example`** + +```ts +await nevermined.nfts1155.isApprovedForAll(someoneElse, artist.getId()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:540](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L540) + +--- + +### isOperator + +▸ **isOperator**(`nftContractAddress`, `operatorAddress`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of given a NFT address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------- | :------------------------------- | :------------ | :-------------------------------------- | +| `nftContractAddress` | `string` | `undefined` | The DID of the NFT to check | +| `operatorAddress` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[isOperator](NFTsBaseApi.md#isoperator) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L116) + +--- + +### isOperatorOfDID + +▸ **isOperatorOfDID**(`did`, `address`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of a DID. + +#### Parameters + +| Name | Type | Default value | Description | +| :-------- | :------------------------------- | :------------ | :-------------------------------------- | +| `did` | `string` | `undefined` | The DID of the NFT to check | +| `address` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[isOperatorOfDID](NFTsBaseApi.md#isoperatorofdid) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:91](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L91) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[list](NFTsBaseApi.md#list) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### listOnSecondaryMarkets + +▸ **listOnSecondaryMarkets**(`ddo`, `assetPrice`, `nftAmount`, `nftTransfer`, `provider`, `token`, `owner`): `Promise`<`string`\> + +After purchase re-list an NFT to enable secondary market sales. + +#### Parameters + +| Name | Type | Description | +| :------------ | :---------------------------- | :----------------------------------------------------------- | +| `ddo` | [`DDO`](DDO.md) | The DDO of the asset. | +| `assetPrice` | [`AssetPrice`](AssetPrice.md) | The current setup of asset rewards. | +| `nftAmount` | `bigint` | The number of NFTs put up for secondary sale. | +| `nftTransfer` | `boolean` | - | +| `provider` | `string` | The address that will be the provider of the secondary sale. | +| `token` | [`Token`](Token.md) | - | +| `owner` | [`Account`](Account.md) | The account of the current owner. | + +#### Returns + +`Promise`<`string`\> + +the agreementId of the secondary sale. + +**`Example`** + +```ts +const agreementId = await nevermined.nfts1155.listOnSecondaryMarkets( + ddo, + assetPrice, + numberNFTs, + collector.getId(), + token, + collector.getId(), +) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error listing the NFT. + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[listOnSecondaryMarkets](NFTsBaseApi.md#listonsecondarymarkets) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:260](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L260) + +--- + +### mint + +▸ **mint**(`did`, `nftAmount`, `receiver`, `account`, `data?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Mint NFTs associated with an asset. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :-------------------------------------------------------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `nftAmount` | `bigint` | The amount of NFTs to mint. | +| `receiver` | `string` | Account address of the NFT receiver, if `undefined` the minter account will receive the NFT/s | +| `account` | [`Account`](Account.md) | The account to mint the NFT. \* | +| `data?` | `string` | Data | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. + +**`Example`** + +```ts +await nevermined.nfts1155.mint(did, 10n, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:145](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L145) + +--- + +### order + +▸ **order**(`did`, `numberEditions`, `consumer`, `serviceReference?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Buy NFTs. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :------------------------------------------------------------- | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `numberEditions` | `bigint` | `undefined` | The amount of NFTs to buy. | +| `consumer` | [`Account`](Account.md) | `undefined` | The account of the NFT buyer. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to order | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +**`Remarks`** + +This will lock the funds of the consumer in escrow pending the transfer of the NFTs +from the publisher. + +**`Example`** + +```ts +agreementId = await nevermined.nfts1155.order(ddo.id, numberNFTs, collector) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L252) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[orderAsset](NFTsBaseApi.md#orderasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### owner + +▸ **owner**(): `Promise`<`string`\> + +Gets the contract owner + +#### Returns + +`Promise`<`string`\> + +Address of the contract owner + +**`Example`** + +```ts +const nftContractOwner = new Account(await nevermined.nfts1155.owner()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L485) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[registerNeverminedAsset](NFTsBaseApi.md#registerneverminedasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### releaseRewards + +▸ **releaseRewards**(`agreementId`, `did`, `serviceReference?`, `nftAmount`, `publisher`, `txParams?`): `Promise`<`boolean`\> + +Release the funds from escrow. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to release rewards | +| `nftAmount` | `bigint` | `undefined` | The amount of NFTs to transfer. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the funds release was successful. + +**`Remarks`** + +A publisher is able to release the funds put on escrow by the consumer after transferring the NFTs. + +**`Example`** + +```ts +const receipt = await nevermined.nfts1155.releaseRewards(agreementId, ddo.id, numberNFTs, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:424](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L424) + +--- + +### releaseSecondaryMarketRewards + +▸ **releaseSecondaryMarketRewards**(`owner`, `consumer`, `agreementIdSeed`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Used to release the secondary market NFT & the locked rewards. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------- | +| `owner` | [`Account`](Account.md) | `undefined` | The owner account. | +| `consumer` | [`Account`](Account.md) | `undefined` | The consumer account. | +| `agreementIdSeed` | `string` | `undefined` | the Id of the underlying service agreement seed. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to release rewards | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the transaction was successful. + +**`Example`** + +```ts +// TODO +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards. + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:562](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L562) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[resolveAsset](NFTsBaseApi.md#resolveasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### revokeOperatorRole + +▸ **revokeOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Revokes an address (`operatorAddress`) of the NFT Contract as operator. +Granting and revoking minting permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be revoked as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account revoking operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts1155.revokeOperatorRole(someoneElse, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:651](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L651) + +--- + +### setApprovalForAll + +▸ **setApprovalForAll**(`operatorAddress`, `approved`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Enable or disable NFT permissions for an operator. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address that of the operator we want to give transfer rights to. | +| `approved` | `boolean` | Give or remove transfer rights from the operator. | +| `from` | [`Account`](Account.md) | The account that wants to give transfer rights to the operator. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceiptnReceiptnReceipt + +**`See`** + +[claim](NFT1155Api.md#claim) + +**`Example`** + +```ts +await nevermined.nfts1155.setApprovalForAll(someoneElse, true, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:510](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L510) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[setInstanceConfig](NFTsBaseApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transfer + +▸ **transfer**(`agreementId`, `did`, `nftAmount`, `publisher`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Transfer NFTs to the consumer. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :---------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `nftAmount` | `bigint` | `undefined` | The number of NFTs to transfer. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to transfer | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +A publisher/provider will check if the consumer put the funds in escrow and +execute the transfer in order to be able to release the rewards. + +**`Example`** + +```ts +const receipt = await nevermined.nfts1155.transfer(agreementId, ddo.id, numberNFTs, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error transferring the NFT + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:368](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L368) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[updateAsset](NFTsBaseApi.md#updateasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `nftContractInstance?`, `nftContractAddress?`): `Promise`<[`NFT1155Api`](NFT1155Api.md)\> + +Create a new Nevermined NFTs (ERC-1155) instance allowing to interact with that kind of NFTs. + +#### Parameters + +| Name | Type | Description | +| :--------------------- | :---------------------------------------------------------- | :---------------------------------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | - | +| `nftContractInstance?` | [`Nft1155Contract`](Nft1155Contract.md) | If there is already deployed an instance of `Nft1155Contract` | +| `nftContractAddress?` | `string` | If the `Nft1155Contract` is deployed in an address it will connect to that contract | + +#### Returns + +`Promise`<[`NFT1155Api`](NFT1155Api.md)\> + +The NFTs 1155 API instance [NFT1155Api](NFT1155Api.md). + +**`Example`** + +```ts +nfts1155 = await Nft1155Api.getInstance(instanceConfig, nft1155Contract) +``` + +#### Overrides + +[NFTsBaseApi](NFTsBaseApi.md).[getInstance](NFTsBaseApi.md#getinstance) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L40) + +--- + +### getNFTContractAddress + +▸ `Static` **getNFTContractAddress**(`ddo`, `serviceReference?`): `any` + +Gets the NFT contract address associated with a Nevermined asset from the DDO. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------ | +| `ddo` | [`DDO`](DDO.md) | `undefined` | The DDO of the asset. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service type to look for the contract address | + +#### Returns + +`any` + +The NFT contract address. + +**`Example`** + +```ts +const nftContractAddress = NFT1155Api.getNFTContractAddress(ddo) +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[getNFTContractAddress](NFTsBaseApi.md#getnftcontractaddress) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:219](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L219) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[getServicePlugin](NFTsBaseApi.md#getserviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[setInstanceConfig](NFTsBaseApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFT721AccessTemplate.md b/docs/api-reference/classes/NFT721AccessTemplate.md new file mode 100644 index 000000000..ad642e226 --- /dev/null +++ b/docs/api-reference/classes/NFT721AccessTemplate.md @@ -0,0 +1,1438 @@ +[@nevermined-io/sdk](../code-reference.md) / NFT721AccessTemplate + +# Class: NFT721AccessTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<`NFT721AccessTemplateParams`, [`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md)\> + + ↳ **`NFT721AccessTemplate`** + +## Table of contents + +### Constructors + +- [constructor](NFT721AccessTemplate.md#constructor) + +### Properties + +- [address](NFT721AccessTemplate.md#address) +- [contract](NFT721AccessTemplate.md#contract) +- [contractName](NFT721AccessTemplate.md#contractname) +- [events](NFT721AccessTemplate.md#events) +- [version](NFT721AccessTemplate.md#version) + +### Accessors + +- [artifactsFolder](NFT721AccessTemplate.md#artifactsfolder) +- [circuitsFolder](NFT721AccessTemplate.md#circuitsfolder) +- [config](NFT721AccessTemplate.md#config) +- [instanceConfig](NFT721AccessTemplate.md#instanceconfig) +- [instantiableConfig](NFT721AccessTemplate.md#instantiableconfig) +- [logger](NFT721AccessTemplate.md#logger) +- [nevermined](NFT721AccessTemplate.md#nevermined) +- [web3](NFT721AccessTemplate.md#web3) + +### Methods + +- [accept](NFT721AccessTemplate.md#accept) +- [agreementId](NFT721AccessTemplate.md#agreementid) +- [call](NFT721AccessTemplate.md#call) +- [conditions](NFT721AccessTemplate.md#conditions) +- [createAgreement](NFT721AccessTemplate.md#createagreement) +- [createAgreementAndPay](NFT721AccessTemplate.md#createagreementandpay) +- [createAgreementFromDDO](NFT721AccessTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](NFT721AccessTemplate.md#createagreementwithpaymentfromddo) +- [createService](NFT721AccessTemplate.md#createservice) +- [description](NFT721AccessTemplate.md#description) +- [extraGen](NFT721AccessTemplate.md#extragen) +- [getAgreementCreatedEvent](NFT721AccessTemplate.md#getagreementcreatedevent) +- [getAgreementData](NFT721AccessTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](NFT721AccessTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](NFT721AccessTemplate.md#getagreementstatus) +- [getAgreementsForDID](NFT721AccessTemplate.md#getagreementsfordid) +- [getConditionTypes](NFT721AccessTemplate.md#getconditiontypes) +- [getConditions](NFT721AccessTemplate.md#getconditions) +- [getFromAddress](NFT721AccessTemplate.md#getfromaddress) +- [getInputsOfMethod](NFT721AccessTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](NFT721AccessTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](NFT721AccessTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](NFT721AccessTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](NFT721AccessTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](NFT721AccessTemplate.md#getsignatureofmethod) +- [init](NFT721AccessTemplate.md#init) +- [instanceFromDDO](NFT721AccessTemplate.md#instancefromddo) +- [lockConditionIndex](NFT721AccessTemplate.md#lockconditionindex) +- [lockTokens](NFT721AccessTemplate.md#locktokens) +- [name](NFT721AccessTemplate.md#name) +- [params](NFT721AccessTemplate.md#params) +- [paramsGen](NFT721AccessTemplate.md#paramsgen) +- [paymentData](NFT721AccessTemplate.md#paymentdata) +- [printAgreementStatus](NFT721AccessTemplate.md#printagreementstatus) +- [process](NFT721AccessTemplate.md#process) +- [send](NFT721AccessTemplate.md#send) +- [sendFrom](NFT721AccessTemplate.md#sendfrom) +- [service](NFT721AccessTemplate.md#service) +- [serviceEndpoint](NFT721AccessTemplate.md#serviceendpoint) +- [setInstanceConfig](NFT721AccessTemplate.md#setinstanceconfig) +- [standardContext](NFT721AccessTemplate.md#standardcontext) +- [track](NFT721AccessTemplate.md#track) +- [validateAgreement](NFT721AccessTemplate.md#validateagreement) +- [getInstance](NFT721AccessTemplate.md#getinstance) +- [setInstanceConfig](NFT721AccessTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new NFT721AccessTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L82) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`NFT721HolderCondition`](NFT721HolderCondition.md), [`NFTAccessCondition`](NFTAccessCondition.md)] + +#### Returns + +[[`NFT721HolderCondition`](NFT721HolderCondition.md), [`NFTAccessCondition`](NFTAccessCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L49) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `NFT721AccessTemplateParams` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `NFT721AccessTemplateParams` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): [`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L34) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :--------------------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `NFT721AccessTemplateParams` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L78) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFT721AccessTemplateParams`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :--------------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `NFT721AccessTemplateParams` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFT721AccessTemplateParams`\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L54) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L31) + +--- + +### params + +▸ **params**(`holderAddress`): `NFT721AccessTemplateParams` + +#### Parameters + +| Name | Type | +| :-------------- | :------- | +| `holderAddress` | `string` | + +#### Returns + +`NFT721AccessTemplateParams` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L45) + +--- + +### paramsGen + +▸ **paramsGen**(`«destructured»`): `Promise`<`NFT721AccessTemplateParams`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :--------------- | :------------------------------------------------------ | :----------------- | +| `«destructured»` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`NFT721AccessTemplateParams`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L23) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L38) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L41) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `NFT721AccessTemplateParams` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721AccessTemplate`](NFT721AccessTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFT721AccessTemplate`](NFT721AccessTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/NFT721AccessTemplate.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L28) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFT721Api.md b/docs/api-reference/classes/NFT721Api.md new file mode 100644 index 000000000..ffc3cfc32 --- /dev/null +++ b/docs/api-reference/classes/NFT721Api.md @@ -0,0 +1,1676 @@ +[@nevermined-io/sdk](../code-reference.md) / NFT721Api + +# Class: NFT721Api + +Allows the interaction with external ERC-721 NFT contracts built on top of the Nevermined NFT extra features. + +## Hierarchy + +- [`NFTsBaseApi`](NFTsBaseApi.md) + + ↳ **`NFT721Api`** + + ↳↳ [`SubscriptionNFTApi`](SubscriptionNFTApi.md) + +## Table of contents + +### Constructors + +- [constructor](NFT721Api.md#constructor) + +### Properties + +- [nftContract](NFT721Api.md#nftcontract) +- [servicePlugin](NFT721Api.md#serviceplugin) + +### Accessors + +- [address](NFT721Api.md#address) +- [artifactsFolder](NFT721Api.md#artifactsfolder) +- [circuitsFolder](NFT721Api.md#circuitsfolder) +- [config](NFT721Api.md#config) +- [getContract](NFT721Api.md#getcontract) +- [instanceConfig](NFT721Api.md#instanceconfig) +- [instantiableConfig](NFT721Api.md#instantiableconfig) +- [logger](NFT721Api.md#logger) +- [nevermined](NFT721Api.md#nevermined) +- [web3](NFT721Api.md#web3) + +### Methods + +- [\_details](NFT721Api.md#_details) +- [access](NFT721Api.md#access) +- [addRating](NFT721Api.md#addrating) +- [balanceOf](NFT721Api.md#balanceof) +- [burn](NFT721Api.md#burn) +- [buySecondaryMarketNft](NFT721Api.md#buysecondarymarketnft) +- [claim](NFT721Api.md#claim) +- [claimNFT](NFT721Api.md#claimnft) +- [create](NFT721Api.md#create) +- [details](NFT721Api.md#details) +- [getSubscriptionToken](NFT721Api.md#getsubscriptiontoken) +- [grantOperatorRole](NFT721Api.md#grantoperatorrole) +- [isApprovedForAll](NFT721Api.md#isapprovedforall) +- [isOperator](NFT721Api.md#isoperator) +- [isOperatorOfDID](NFT721Api.md#isoperatorofdid) +- [list](NFT721Api.md#list) +- [listOnSecondaryMarkets](NFT721Api.md#listonsecondarymarkets) +- [mint](NFT721Api.md#mint) +- [mintWithURL](NFT721Api.md#mintwithurl) +- [order](NFT721Api.md#order) +- [orderAsset](NFT721Api.md#orderasset) +- [ownerOf](NFT721Api.md#ownerof) +- [ownerOfAsset](NFT721Api.md#ownerofasset) +- [ownerOfAssetByAgreement](NFT721Api.md#ownerofassetbyagreement) +- [ownerOfTokenId](NFT721Api.md#owneroftokenid) +- [registerNeverminedAsset](NFT721Api.md#registerneverminedasset) +- [releaseRewards](NFT721Api.md#releaserewards) +- [releaseSecondaryMarketRewards](NFT721Api.md#releasesecondarymarketrewards) +- [resolveAsset](NFT721Api.md#resolveasset) +- [revokeOperatorRole](NFT721Api.md#revokeoperatorrole) +- [setApprovalForAll](NFT721Api.md#setapprovalforall) +- [setInstanceConfig](NFT721Api.md#setinstanceconfig) +- [transfer](NFT721Api.md#transfer) +- [updateAsset](NFT721Api.md#updateasset) +- [getInstance](NFT721Api.md#getinstance) +- [getNFTContractAddress](NFT721Api.md#getnftcontractaddress) +- [getServicePlugin](NFT721Api.md#getserviceplugin) +- [setInstanceConfig](NFT721Api.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFT721Api**() + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[constructor](NFTsBaseApi.md#constructor) + +## Properties + +### nftContract + +• **nftContract**: [`Nft721Contract`](Nft721Contract.md) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L22) + +--- + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[servicePlugin](NFTsBaseApi.md#serviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### address + +• `get` **address**(): `string` + +Gets the ERC-721 NFT Contract address + +#### Returns + +`string` + +The NFT contract address + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L55) + +--- + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTsBaseApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTsBaseApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NFTsBaseApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### getContract + +• `get` **getContract**(): [`Nft721Contract`](Nft721Contract.md) + +Gets the instance of the ERC-721 NFT Contract where the API is connected + +#### Returns + +[`Nft721Contract`](Nft721Contract.md) + +The `Nft721Contract` instance + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L63) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTsBaseApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTsBaseApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NFTsBaseApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NFTsBaseApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NFTsBaseApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_details + +▸ `Protected` **\_details**(`did`, `ercType`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `ercType` | [`ERCType`](../enums/ERCType.md) | The type of NFT used | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[\_details](NFTsBaseApi.md#_details) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L150) + +--- + +### access + +▸ **access**(`did`, `consumer`, `destination?`, `fileIndex?`, `agreementId?`, `buyer?`, `babysig?`, `serviceReference?`): `Promise`<`boolean`\> + +Access the files associated with an NFT. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `consumer` | [`Account`](Account.md) | `undefined` | The NFT holder account. | +| `destination?` | `string` | `undefined` | The download destination for the files. | +| `fileIndex?` | `number` | `undefined` | The index of the file. If unset will download all the files in the asset. | +| `agreementId` | `string` | `'0x'` | The NFT sales agreement id. | +| `buyer?` | `string` | `undefined` | Key which represent the buyer | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | - | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service reference to use. By default is nft-access. | + +#### Returns + +`Promise`<`boolean`\> + +true if the access was successful or file if isToDownload is false. + +**`Remarks`** + +This function will call the Node that will check if all the access conditions where fulfilled +before providing the files. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.access(ddo.id, collector, '/tmp/') +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[access](NFTsBaseApi.md#access) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:419](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L419) + +--- + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[addRating](NFTsBaseApi.md#addrating) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### balanceOf + +▸ **balanceOf**(`account`): `Promise`<`bigint`\> + +Get the NFT balance for a particular account/address + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------------------- | :------------------------------------------- | +| `account` | `string` \| [`Account`](Account.md) | The account/address to check the balance of. | + +#### Returns + +`Promise`<`bigint`\> + +The balance of NFTs owned by the account. + +**`Example`** + +```ts +const balance = await nevermined.nfts721.balance(artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:506](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L506) + +--- + +### burn + +▸ **burn**(`tokenId`, `account`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Burn NFTs associated with an asset. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------- | +| `tokenId` | `string` | The identifier of the token to burn | +| `account` | [`Account`](Account.md) | The account of the publisher of the NFT. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +The publisher can only burn NFTs that it owns. NFTs that were already transferred cannot be burned by the publisher. + +**`Example`** + +```ts +await nevermined.nfts721.burn(tokenId, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:347](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L347) + +--- + +### buySecondaryMarketNft + +▸ **buySecondaryMarketNft**(`consumer`, `nftAmount?`, `agreementIdSeed`, `conditionsTimeout?`, `txParams?`): `Promise`<`boolean`\> + +Buys a number of listed NFTs on secondary markets. + +#### Parameters + +| Name | Type | Description | +| :------------------ | :---------------------------------------------- | :----------------------------------------- | +| `consumer` | [`Account`](Account.md) | The account of the buyer/consumer. | +| `nftAmount` | `bigint` | The number of assets to buy. 1 by default. | +| `agreementIdSeed` | `string` | - | +| `conditionsTimeout` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`boolean`\> + +true if the buy was successful. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.buySecondaryMarketNft(collector, 1n, agreementId) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error buying the NFT. + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[buySecondaryMarketNft](NFTsBaseApi.md#buysecondarymarketnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:341](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L341) + +--- + +### claim + +▸ **claim**(`agreementId`, `nftHolder`, `nftReceiver`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Description | +| :-------------- | :------- | :------------------------------------------------------- | +| `agreementId` | `string` | The NFT sales agreement id. | +| `nftHolder` | `string` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | The address where the NFT should be transferred. | +| `did?` | `string` | The Decentralized Identifier of the asset. | +| `serviceIndex?` | `any` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim(agreementId, editor.getId(), subscriber.getId()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:193](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L193) + +--- + +### claimNFT + +▸ `Protected` **claimNFT**(`agreementId`, `nftHolder`, `nftReceiver`, `numberEditions?`, `ercType?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------- | :------------------------------- | :------------ | :--------------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `nftHolder` | `string` | `undefined` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | `undefined` | The address where the NFT should be transferred. | +| `numberEditions` | `bigint` | `undefined` | The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The Type of the NFT ERC (1155 or 721). | +| `did?` | `string` | `undefined` | The DID of the asset. | +| `serviceIndex?` | `number` | `undefined` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim( + agreementId, + editor.getId(), + subscriber.getId(), + nftAmount, + 721, +) +``` + +**`Throws`** + +[NFTError](NFTError.md) if Nevermined is not an operator for this NFT + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[claimNFT](NFTsBaseApi.md#claimnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L50) + +--- + +### create + +▸ **create**(`nftAttributes`, `publisher`, `publicationOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +Creates a new Nevermined asset associated to a NFT (ERC-721). + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `nftAttributes` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The newly registered [DDO](DDO.md). + +**`Example`** + +```ts + +// We define how the Asset is and the properties +// of the NFT attached to it +const nftAttributes = NFTAttributes.getNFT721Instance({ + metadata, + price: assetPrice1, + serviceTypes: ['nft-sales', 'nft-access'] + nftContractAddress: nftContract.address +}) + +// And register the asset +ddo = await nevermined.nfts721.create( + nftAttributes, + artist, + { metadata: PublishMetadata.IPFS } +) +``` + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:97](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L97) + +--- + +### details + +▸ **details**(`did`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:639](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L639) + +--- + +### getSubscriptionToken + +▸ **getSubscriptionToken**(`did`, `account`): `Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +Get a JWT token for an asset associated with a webService + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------- | :----------------------------------------------------------------------------- | +| `did` | `string` | The did of the asset with a webService resource and an associated subscription | +| `account` | [`Account`](Account.md) | Account of the user requesting the token | + +#### Returns + +`Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +[SubscriptionToken](../interfaces/SubscriptionToken.md) + +**`Example`** + +```ts +const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) + +assert.isDefined(response.accessToken) +assert.isDefined(response.neverminedProxyUri) +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[getSubscriptionToken](NFTsBaseApi.md#getsubscriptiontoken) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:478](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L478) + +--- + +### grantOperatorRole + +▸ **grantOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Adds a operator (`operatorAddress`) to the NFT Contract. +Granting and revoking operator permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :--------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be added as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account giving operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.grantOperatorRole(someoneElse, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:585](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L585) + +--- + +### isApprovedForAll + +▸ **isApprovedForAll**(`operatorAddress`, `from`): `Promise`<`unknown`\> + +Returns if the `operatorAddress` is approved + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------- | :--------------------------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address to check the permissions | +| `from` | `string` | The address of the account granting or revoking the permissions via `setApprovalForAll`. | + +#### Returns + +`Promise`<`unknown`\> + +Boolean saying if the `operatorAddress` is approved + +**`Example`** + +```ts +await nevermined.nfts721.isApprovedForAll(someoneElse, artist.getId()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:490](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L490) + +--- + +### isOperator + +▸ **isOperator**(`nftContractAddress`, `operatorAddress`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of given a NFT address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------- | :------------------------------- | :------------ | :-------------------------------------- | +| `nftContractAddress` | `string` | `undefined` | The DID of the NFT to check | +| `operatorAddress` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[isOperator](NFTsBaseApi.md#isoperator) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L116) + +--- + +### isOperatorOfDID + +▸ **isOperatorOfDID**(`did`, `address`): `Promise`<`boolean`\> + +Check if a particular address is the operator of a DID. + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :-------------------------------------- | +| `did` | `string` | The DID of the NFT to check | +| `address` | `string` | The address to check if operator status | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Overrides + +[NFTsBaseApi](NFTsBaseApi.md).[isOperatorOfDID](NFTsBaseApi.md#isoperatorofdid) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:643](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L643) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[list](NFTsBaseApi.md#list) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### listOnSecondaryMarkets + +▸ **listOnSecondaryMarkets**(`ddo`, `assetPrice`, `nftAmount`, `nftTransfer`, `provider`, `token`, `owner`): `Promise`<`string`\> + +After purchase re-list an NFT to enable secondary market sales. + +#### Parameters + +| Name | Type | Description | +| :------------ | :---------------------------- | :----------------------------------------------------------- | +| `ddo` | [`DDO`](DDO.md) | The DDO of the asset. | +| `assetPrice` | [`AssetPrice`](AssetPrice.md) | The current setup of asset rewards. | +| `nftAmount` | `bigint` | The number of NFTs put up for secondary sale. | +| `nftTransfer` | `boolean` | - | +| `provider` | `string` | The address that will be the provider of the secondary sale. | +| `token` | [`Token`](Token.md) | - | +| `owner` | [`Account`](Account.md) | The account of the current owner. | + +#### Returns + +`Promise`<`string`\> + +the agreementId of the secondary sale. + +**`Example`** + +```ts +const agreementId = await nevermined.nfts1155.listOnSecondaryMarkets( + ddo, + assetPrice, + numberNFTs, + collector.getId(), + token, + collector.getId(), +) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error listing the NFT. + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[listOnSecondaryMarkets](NFTsBaseApi.md#listonsecondarymarkets) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:260](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L260) + +--- + +### mint + +▸ **mint**(`did`, `publisher`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Mint NFTs associated with an asset. + +This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `publisher` | [`Account`](Account.md) | The account of the minter | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.mint(ddo.id, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:319](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L319) + +--- + +### mintWithURL + +▸ **mintWithURL**(`to`, `did`, `url`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Mint NFTs associated with an asset allowing to specify some metadata + +This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `to` | `string` | The address receiving the NFT minted | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `url` | `string` | The URL with NFT metadata | +| `from?` | [`Account`](Account.md) | The account of the minter | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.mintWithURL(receiverAddress, ddo.id, nftMetadata, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:367](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L367) + +--- + +### order + +▸ **order**(`did`, `consumer`, `serviceReference?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Order a NFT-721. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :------------------------------------------------------------- | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `consumer` | [`Account`](Account.md) | `undefined` | The account of the NFT buyer. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to order | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +**`Remarks`** + +This will lock the funds of the consumer in escrow pending the transfer of the NFTs +from the publisher. + +**`Example`** + +```ts +const agreementId = await nevermined.nfts721.order(ddo.id, collector) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:134](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L134) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[orderAsset](NFTsBaseApi.md#orderasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### ownerOf + +▸ **ownerOf**(`did`): `Promise`<`string`\> + +Gets the contract owner + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`\> + +Address of the contract owner + +**`Example`** + +```ts +const nftContractOwner = new Account(await nevermined.nfts721.ownerOf()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:416](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L416) + +--- + +### ownerOfAsset + +▸ **ownerOfAsset**(`did`): `Promise`<`string`\> + +Given a DID it gets the owner of the NFT if that DID is used as tokenId + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized identifier of the NFT asset. | + +#### Returns + +`Promise`<`string`\> + +The address of the NFT owner. + +**`Example`** + +```ts +const owner = await nevermined.nfts721.ownerOfAsset(ddo.id, nftTokenAddress) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:450](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L450) + +--- + +### ownerOfAssetByAgreement + +▸ **ownerOfAssetByAgreement**(`did`, `agreementId`): `Promise`<`string`\> + +Given a DID and an agreement id it gets the owner of the NFT + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized identifier of the NFT asset. | +| `agreementId` | `string` | The NFT sales agreement id. | + +#### Returns + +`Promise`<`string`\> + +The address of the NFT owner. + +**`Example`** + +```ts +const owner = await nevermined.nfts721.ownerOfAssetByAgreement(ddo.id, agreementId) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:468](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L468) + +--- + +### ownerOfTokenId + +▸ **ownerOfTokenId**(`tokenId`): `Promise`<`string`\> + +Given some information, it gets the owner of the NFT + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :----------- | +| `tokenId` | `string` | The token id | + +#### Returns + +`Promise`<`string`\> + +The address of the NFT owner. + +**`Example`** + +```ts +const owner = await nevermined.nfts721.ownerOfTokenId(tokenId) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:433](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L433) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[registerNeverminedAsset](NFTsBaseApi.md#registerneverminedasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### releaseRewards + +▸ **releaseRewards**(`agreementId`, `did`, `publisher`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Release the funds from escrow. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to release rewards | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the funds release was successful. + +**`Remarks`** + +A publisher is able to release the funds put on escrow by the consumer after transferring the NFTs. + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.releaseRewards(agreementId, ddo.id, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards. + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:277](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L277) + +--- + +### releaseSecondaryMarketRewards + +▸ **releaseSecondaryMarketRewards**(`owner`, `account`, `agreementIdSeed`, `txParams?`): `Promise`<`boolean`\> + +Used to release the secondary market NFT & the locked rewards. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------------------------------------------------------------- | +| `owner` | [`Account`](Account.md) | The owner account. | +| `account` | [`Account`](Account.md) | Account of the user sending the transaction | +| `agreementIdSeed` | `string` | the seed of the Agreement Id of the underlying service agreement. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the transaction was successful. + +**`Example`** + +```ts +// TODO +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards. + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:529](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L529) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[resolveAsset](NFTsBaseApi.md#resolveasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### revokeOperatorRole + +▸ **revokeOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Revokes a minter (`operatorAddress`) of the NFT Contract. +Granting and revoking minting permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be revoked as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account revoking operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.revokeOperatorRole(someoneElse, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:611](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L611) + +--- + +### setApprovalForAll + +▸ **setApprovalForAll**(`target`, `approved`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Enable or disable NFT permissions for an operator. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :------------------------------------------------------------------- | +| `target` | `string` | The address that of the operator we want to give transfer rights to. | +| `approved` | `boolean` | Give or remove transfer rights from the operator. | +| `from` | [`Account`](Account.md) | The account that wants to give transfer rights to the operator. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.setApprovalForAll(someoneElse, true, artist) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:395](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L395) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[setInstanceConfig](NFTsBaseApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transfer + +▸ **transfer**(`agreementId`, `did`, `publisher`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Transfer NFT-721 to the consumer. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :---------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to transfer | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +A publisher/provider will check if the consumer put the funds in escrow and +execute the transfer in order to be able to release the rewards. + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.transfer(agreementId, ddo.id, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error transferring the NFT + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:226](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L226) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[updateAsset](NFTsBaseApi.md#updateasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `nftContractAddress`): `Promise`<[`NFT721Api`](NFT721Api.md)\> + +Create a new Nevermined NFTs (ERC-721) instance allowing to interact with that kind of NFTs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :---------------------------------------------------------- | :-------------------------------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | The Nevermined config | +| `nftContractAddress` | `string` | If the Nft721 Contract is deployed in an address it will connect to that contract | + +#### Returns + +`Promise`<[`NFT721Api`](NFT721Api.md)\> + +The NFTs 721 API instance [NFT721Api](NFT721Api.md). + +**`Example`** + +```ts +nfts721 = await Nft721Api.getInstance(instanceConfig, nftContractAddress) +``` + +#### Overrides + +[NFTsBaseApi](NFTsBaseApi.md).[getInstance](NFTsBaseApi.md#getinstance) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L39) + +--- + +### getNFTContractAddress + +▸ `Static` **getNFTContractAddress**(`ddo`, `serviceReference?`): `any` + +Gets the NFT contract address associated with a Nevermined asset from the DDO. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------ | +| `ddo` | [`DDO`](DDO.md) | `undefined` | The DDO of the asset. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service type to look for the contract address | + +#### Returns + +`any` + +The NFT contract address. + +**`Example`** + +```ts +const nftContractAddress = NFT1155Api.getNFTContractAddress(ddo) +``` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[getNFTContractAddress](NFTsBaseApi.md#getnftcontractaddress) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:219](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L219) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[getServicePlugin](NFTsBaseApi.md#getserviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTsBaseApi](NFTsBaseApi.md).[setInstanceConfig](NFTsBaseApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFT721HolderCondition.md b/docs/api-reference/classes/NFT721HolderCondition.md new file mode 100644 index 000000000..cc33fc9df --- /dev/null +++ b/docs/api-reference/classes/NFT721HolderCondition.md @@ -0,0 +1,976 @@ +[@nevermined-io/sdk](../code-reference.md) / NFT721HolderCondition + +# Class: NFT721HolderCondition + +Allows to fulfill a condition to users holding some amount of NFTs for a specific DID. + +## Hierarchy + +- [`ConsumerCondition`](ConsumerCondition.md)<`NFT721HolderConditionContext`\> + + ↳ **`NFT721HolderCondition`** + +## Table of contents + +### Constructors + +- [constructor](NFT721HolderCondition.md#constructor) + +### Properties + +- [address](NFT721HolderCondition.md#address) +- [contract](NFT721HolderCondition.md#contract) +- [contractName](NFT721HolderCondition.md#contractname) +- [events](NFT721HolderCondition.md#events) +- [version](NFT721HolderCondition.md#version) + +### Accessors + +- [artifactsFolder](NFT721HolderCondition.md#artifactsfolder) +- [circuitsFolder](NFT721HolderCondition.md#circuitsfolder) +- [config](NFT721HolderCondition.md#config) +- [instanceConfig](NFT721HolderCondition.md#instanceconfig) +- [instantiableConfig](NFT721HolderCondition.md#instantiableconfig) +- [logger](NFT721HolderCondition.md#logger) +- [nevermined](NFT721HolderCondition.md#nevermined) +- [web3](NFT721HolderCondition.md#web3) + +### Methods + +- [abortByTimeOut](NFT721HolderCondition.md#abortbytimeout) +- [call](NFT721HolderCondition.md#call) +- [fulfill](NFT721HolderCondition.md#fulfill) +- [fulfillInstance](NFT721HolderCondition.md#fulfillinstance) +- [fulfillPlain](NFT721HolderCondition.md#fulfillplain) +- [fulfillWithNode](NFT721HolderCondition.md#fulfillwithnode) +- [generateId](NFT721HolderCondition.md#generateid) +- [generateIdHash](NFT721HolderCondition.md#generateidhash) +- [generateIdWithSeed](NFT721HolderCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](NFT721HolderCondition.md#getconditionfulfilledevent) +- [getFromAddress](NFT721HolderCondition.md#getfromaddress) +- [getInputsOfMethod](NFT721HolderCondition.md#getinputsofmethod) +- [getSignatureOfMethod](NFT721HolderCondition.md#getsignatureofmethod) +- [hashValues](NFT721HolderCondition.md#hashvalues) +- [hashValuesPlain](NFT721HolderCondition.md#hashvaluesplain) +- [init](NFT721HolderCondition.md#init) +- [instance](NFT721HolderCondition.md#instance) +- [instanceFromDDO](NFT721HolderCondition.md#instancefromddo) +- [nftContractFromService](NFT721HolderCondition.md#nftcontractfromservice) +- [params](NFT721HolderCondition.md#params) +- [paramsFromDDO](NFT721HolderCondition.md#paramsfromddo) +- [send](NFT721HolderCondition.md#send) +- [sendFrom](NFT721HolderCondition.md#sendfrom) +- [setInstanceConfig](NFT721HolderCondition.md#setinstanceconfig) +- [getInstance](NFT721HolderCondition.md#getinstance) +- [setInstanceConfig](NFT721HolderCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFT721HolderCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[constructor](ConsumerCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[address](ConsumerCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contract](ConsumerCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contractName](ConsumerCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[events](ConsumerCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[version](ConsumerCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ConsumerCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ConsumerCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ConsumerCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ConsumerCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[abortByTimeOut](ConsumerCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[call](ConsumerCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `holderAddress`, `nftTokenAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill requires a validation that holder as enough NFTs for a specific DID. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------------------------------- | +| `agreementId` | `string` | SEA agreement identifier. | +| `did` | `string` | The Decentralized Identifier of the asset. | +| `holderAddress` | `string` | The contract address where the reward is locked. | +| `nftTokenAddress` | `string` | The contract address of the nft to use. | +| `from?` | [`Account`](Account.md) | Account sending the transaction | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transacion parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +condition state + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[fulfill](ConsumerCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L52) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillInstance](ConsumerCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillPlain](ConsumerCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`_cond`, `_additionalParams`, `_from?`, `_txParams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------------ | :----------------------------------------------------------------------------------------- | +| `_cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `_additionalParams` | `Record`<`string`, `unknown`\> | +| `_from?` | [`Account`](Account.md) | +| `_txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillWithNode](ConsumerCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:217](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L217) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateId](ConsumerCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdHash](ConsumerCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdWithSeed](ConsumerCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getConditionFulfilledEvent](ConsumerCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getFromAddress](ConsumerCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getInputsOfMethod](ConsumerCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getSignatureOfMethod](ConsumerCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValues](ConsumerCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValuesPlain](ConsumerCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[init](ConsumerCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instance](ConsumerCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `NFT721HolderConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instanceFromDDO](ConsumerCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nftContractFromService + +▸ **nftContractFromService**(`service`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`string` + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L32) + +--- + +### params + +▸ **params**(`did`, `holderAddress`, `nftTokenAddress`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generate the hash of condition inputs with the following parameters. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------- | :----------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the asset. | +| `holderAddress` | `string` | The address of the NFT holder . | +| `nftTokenAddress` | `string` | The address of the nft 721 token to use | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +hash of all the values + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[params](ConsumerCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L28) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :----------------------------- | +| `«destructured»` | `NFT721HolderConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[paramsFromDDO](ConsumerCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L38) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[send](ConsumerCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[sendFrom](ConsumerCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721HolderCondition`](NFT721HolderCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFT721HolderCondition`](NFT721HolderCondition.md)\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[getInstance](ConsumerCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L16) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFT721LockCondition.md b/docs/api-reference/classes/NFT721LockCondition.md new file mode 100644 index 000000000..5f9716f03 --- /dev/null +++ b/docs/api-reference/classes/NFT721LockCondition.md @@ -0,0 +1,975 @@ +[@nevermined-io/sdk](../code-reference.md) / NFT721LockCondition + +# Class: NFT721LockCondition + +Implementation of the NFT Lock Condition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`NFT721LockConditionContext`\> + + ↳ **`NFT721LockCondition`** + +## Table of contents + +### Constructors + +- [constructor](NFT721LockCondition.md#constructor) + +### Properties + +- [address](NFT721LockCondition.md#address) +- [contract](NFT721LockCondition.md#contract) +- [contractName](NFT721LockCondition.md#contractname) +- [events](NFT721LockCondition.md#events) +- [version](NFT721LockCondition.md#version) + +### Accessors + +- [artifactsFolder](NFT721LockCondition.md#artifactsfolder) +- [circuitsFolder](NFT721LockCondition.md#circuitsfolder) +- [config](NFT721LockCondition.md#config) +- [instanceConfig](NFT721LockCondition.md#instanceconfig) +- [instantiableConfig](NFT721LockCondition.md#instantiableconfig) +- [logger](NFT721LockCondition.md#logger) +- [nevermined](NFT721LockCondition.md#nevermined) +- [web3](NFT721LockCondition.md#web3) + +### Methods + +- [abortByTimeOut](NFT721LockCondition.md#abortbytimeout) +- [call](NFT721LockCondition.md#call) +- [fulfill](NFT721LockCondition.md#fulfill) +- [fulfillInstance](NFT721LockCondition.md#fulfillinstance) +- [fulfillPlain](NFT721LockCondition.md#fulfillplain) +- [fulfillWithNode](NFT721LockCondition.md#fulfillwithnode) +- [generateId](NFT721LockCondition.md#generateid) +- [generateIdHash](NFT721LockCondition.md#generateidhash) +- [generateIdWithSeed](NFT721LockCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](NFT721LockCondition.md#getconditionfulfilledevent) +- [getFromAddress](NFT721LockCondition.md#getfromaddress) +- [getInputsOfMethod](NFT721LockCondition.md#getinputsofmethod) +- [getSignatureOfMethod](NFT721LockCondition.md#getsignatureofmethod) +- [hashValues](NFT721LockCondition.md#hashvalues) +- [hashValuesPlain](NFT721LockCondition.md#hashvaluesplain) +- [init](NFT721LockCondition.md#init) +- [instance](NFT721LockCondition.md#instance) +- [instanceFromDDO](NFT721LockCondition.md#instancefromddo) +- [nodeMethod](NFT721LockCondition.md#nodemethod) +- [params](NFT721LockCondition.md#params) +- [paramsFromDDO](NFT721LockCondition.md#paramsfromddo) +- [send](NFT721LockCondition.md#send) +- [sendFrom](NFT721LockCondition.md#sendfrom) +- [setInstanceConfig](NFT721LockCondition.md#setinstanceconfig) +- [getInstance](NFT721LockCondition.md#getinstance) +- [setInstanceConfig](NFT721LockCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFT721LockCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `lockAddress`, `amount`, `nftContractAddress`, `from?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill requires valid NFT transfer in order to lock the amount of DID NFTs based on SEA. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :---------------------- | :-------------------------------------------- | +| `agreementId` | `string` | SEA agreement identifier. | +| `did` | `string` | Asset Decentralized identifier. | +| `lockAddress` | `string` | The contract address where the NFT is locked. | +| `amount` | `number` | The amount of tokens to be locked. | +| `nftContractAddress` | `string` | The NFT721 contract address | +| `from?` | [`Account`](Account.md) | | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Condition state. + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/defi/NFT721LockCondition.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/NFT721LockCondition.ts#L56) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `NFT721LockConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `lockAddress`, `amount`, `nftContractAddress`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generates the hash of condition inputs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------- | :----------------------------------------------- | +| `did` | `string` | The DID of the asset with NFTs attached to lock. | +| `lockAddress` | `string` | the address to lock the NFT to (vault address) | +| `amount` | `number` | The amount of locked tokens. | +| `nftContractAddress` | `string` | The NFT721 contract address | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Hash of all the values. + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/defi/NFT721LockCondition.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/NFT721LockCondition.ts#L28) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :--------------------------- | +| `«destructured»` | `NFT721LockConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/defi/NFT721LockCondition.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/NFT721LockCondition.ts#L37) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721LockCondition`](NFT721LockCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFT721LockCondition`](NFT721LockCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/defi/NFT721LockCondition.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/NFT721LockCondition.ts#L16) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFT721SalesTemplate.md b/docs/api-reference/classes/NFT721SalesTemplate.md new file mode 100644 index 000000000..1e8089f31 --- /dev/null +++ b/docs/api-reference/classes/NFT721SalesTemplate.md @@ -0,0 +1,1440 @@ +[@nevermined-io/sdk](../code-reference.md) / NFT721SalesTemplate + +# Class: NFT721SalesTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<`NFT721SalesTemplateParams`, [`ServiceNFTSales`](../interfaces/ServiceNFTSales.md)\> + + ↳ **`NFT721SalesTemplate`** + +## Table of contents + +### Constructors + +- [constructor](NFT721SalesTemplate.md#constructor) + +### Properties + +- [address](NFT721SalesTemplate.md#address) +- [contract](NFT721SalesTemplate.md#contract) +- [contractName](NFT721SalesTemplate.md#contractname) +- [events](NFT721SalesTemplate.md#events) +- [version](NFT721SalesTemplate.md#version) + +### Accessors + +- [artifactsFolder](NFT721SalesTemplate.md#artifactsfolder) +- [circuitsFolder](NFT721SalesTemplate.md#circuitsfolder) +- [config](NFT721SalesTemplate.md#config) +- [instanceConfig](NFT721SalesTemplate.md#instanceconfig) +- [instantiableConfig](NFT721SalesTemplate.md#instantiableconfig) +- [logger](NFT721SalesTemplate.md#logger) +- [nevermined](NFT721SalesTemplate.md#nevermined) +- [web3](NFT721SalesTemplate.md#web3) + +### Methods + +- [accept](NFT721SalesTemplate.md#accept) +- [agreementId](NFT721SalesTemplate.md#agreementid) +- [call](NFT721SalesTemplate.md#call) +- [conditions](NFT721SalesTemplate.md#conditions) +- [createAgreement](NFT721SalesTemplate.md#createagreement) +- [createAgreementAndPay](NFT721SalesTemplate.md#createagreementandpay) +- [createAgreementFromDDO](NFT721SalesTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](NFT721SalesTemplate.md#createagreementwithpaymentfromddo) +- [createService](NFT721SalesTemplate.md#createservice) +- [description](NFT721SalesTemplate.md#description) +- [extraGen](NFT721SalesTemplate.md#extragen) +- [getAgreementCreatedEvent](NFT721SalesTemplate.md#getagreementcreatedevent) +- [getAgreementData](NFT721SalesTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](NFT721SalesTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](NFT721SalesTemplate.md#getagreementstatus) +- [getAgreementsForDID](NFT721SalesTemplate.md#getagreementsfordid) +- [getConditionTypes](NFT721SalesTemplate.md#getconditiontypes) +- [getConditions](NFT721SalesTemplate.md#getconditions) +- [getFromAddress](NFT721SalesTemplate.md#getfromaddress) +- [getInputsOfMethod](NFT721SalesTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](NFT721SalesTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](NFT721SalesTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](NFT721SalesTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](NFT721SalesTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](NFT721SalesTemplate.md#getsignatureofmethod) +- [init](NFT721SalesTemplate.md#init) +- [instanceFromDDO](NFT721SalesTemplate.md#instancefromddo) +- [lockConditionIndex](NFT721SalesTemplate.md#lockconditionindex) +- [lockTokens](NFT721SalesTemplate.md#locktokens) +- [name](NFT721SalesTemplate.md#name) +- [params](NFT721SalesTemplate.md#params) +- [paramsGen](NFT721SalesTemplate.md#paramsgen) +- [paymentData](NFT721SalesTemplate.md#paymentdata) +- [printAgreementStatus](NFT721SalesTemplate.md#printagreementstatus) +- [process](NFT721SalesTemplate.md#process) +- [send](NFT721SalesTemplate.md#send) +- [sendFrom](NFT721SalesTemplate.md#sendfrom) +- [service](NFT721SalesTemplate.md#service) +- [serviceEndpoint](NFT721SalesTemplate.md#serviceendpoint) +- [setInstanceConfig](NFT721SalesTemplate.md#setinstanceconfig) +- [standardContext](NFT721SalesTemplate.md#standardcontext) +- [track](NFT721SalesTemplate.md#track) +- [validateAgreement](NFT721SalesTemplate.md#validateagreement) +- [getInstance](NFT721SalesTemplate.md#getinstance) +- [setInstanceConfig](NFT721SalesTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new NFT721SalesTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`_params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L98) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`LockPaymentCondition`](LockPaymentCondition.md), [`TransferNFT721Condition`](TransferNFT721Condition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Returns + +[[`LockPaymentCondition`](LockPaymentCondition.md), [`TransferNFT721Condition`](TransferNFT721Condition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L56) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `NFT721SalesTemplateParams` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `NFT721SalesTemplateParams` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): [`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L38) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :-------------------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `NFT721SalesTemplateParams` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:105](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L105) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`, `serviceReference?`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFT721SalesTemplateParams`\>\> + +#### Parameters + +| Name | Type | +| :------------------ | :-------------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `NFT721SalesTemplateParams` | +| `serviceReference?` | `number` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFT721SalesTemplateParams`\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L62) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L52) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L35) + +--- + +### params + +▸ **params**(`consumerId`, `expiration?`): `NFT721SalesTemplateParams` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `consumerId` | `string` | `undefined` | +| `expiration` | `number` | `0` | + +#### Returns + +`NFT721SalesTemplateParams` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L42) + +--- + +### paramsGen + +▸ **paramsGen**(`«destructured»`): `Promise`<`NFT721SalesTemplateParams`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :--------------- | :------------------------------------------------------ | :----------------- | +| `«destructured»` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`NFT721SalesTemplateParams`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L45) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L28) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L31) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `NFT721SalesTemplateParams` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721SalesTemplate`](NFT721SalesTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFT721SalesTemplate`](NFT721SalesTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/NFT721SalesTemplate.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L24) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTAccessCondition.md b/docs/api-reference/classes/NFTAccessCondition.md new file mode 100644 index 000000000..4e014989b --- /dev/null +++ b/docs/api-reference/classes/NFTAccessCondition.md @@ -0,0 +1,985 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTAccessCondition + +# Class: NFTAccessCondition + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`NFTAccessConditionContext`\> + + ↳ **`NFTAccessCondition`** + +## Table of contents + +### Constructors + +- [constructor](NFTAccessCondition.md#constructor) + +### Properties + +- [address](NFTAccessCondition.md#address) +- [contract](NFTAccessCondition.md#contract) +- [contractName](NFTAccessCondition.md#contractname) +- [events](NFTAccessCondition.md#events) +- [version](NFTAccessCondition.md#version) + +### Accessors + +- [artifactsFolder](NFTAccessCondition.md#artifactsfolder) +- [circuitsFolder](NFTAccessCondition.md#circuitsfolder) +- [config](NFTAccessCondition.md#config) +- [instanceConfig](NFTAccessCondition.md#instanceconfig) +- [instantiableConfig](NFTAccessCondition.md#instantiableconfig) +- [logger](NFTAccessCondition.md#logger) +- [nevermined](NFTAccessCondition.md#nevermined) +- [web3](NFTAccessCondition.md#web3) + +### Methods + +- [abortByTimeOut](NFTAccessCondition.md#abortbytimeout) +- [call](NFTAccessCondition.md#call) +- [checkPermissions](NFTAccessCondition.md#checkpermissions) +- [fulfill](NFTAccessCondition.md#fulfill) +- [fulfillInstance](NFTAccessCondition.md#fulfillinstance) +- [fulfillPlain](NFTAccessCondition.md#fulfillplain) +- [fulfillWithNode](NFTAccessCondition.md#fulfillwithnode) +- [generateId](NFTAccessCondition.md#generateid) +- [generateIdHash](NFTAccessCondition.md#generateidhash) +- [generateIdWithSeed](NFTAccessCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](NFTAccessCondition.md#getconditionfulfilledevent) +- [getFromAddress](NFTAccessCondition.md#getfromaddress) +- [getInputsOfMethod](NFTAccessCondition.md#getinputsofmethod) +- [getSignatureOfMethod](NFTAccessCondition.md#getsignatureofmethod) +- [hashValues](NFTAccessCondition.md#hashvalues) +- [hashValuesPlain](NFTAccessCondition.md#hashvaluesplain) +- [init](NFTAccessCondition.md#init) +- [instance](NFTAccessCondition.md#instance) +- [instanceFromDDO](NFTAccessCondition.md#instancefromddo) +- [nodeMethod](NFTAccessCondition.md#nodemethod) +- [params](NFTAccessCondition.md#params) +- [paramsFromDDO](NFTAccessCondition.md#paramsfromddo) +- [send](NFTAccessCondition.md#send) +- [sendFrom](NFTAccessCondition.md#sendfrom) +- [setInstanceConfig](NFTAccessCondition.md#setinstanceconfig) +- [getInstance](NFTAccessCondition.md#getinstance) +- [setInstanceConfig](NFTAccessCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFTAccessCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### checkPermissions + +▸ **checkPermissions**(`grantee`, `did`, `from?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------- | +| `grantee` | `string` | +| `did` | `string` | +| `from?` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L34) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `grantee`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `grantee` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L24) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `NFTAccessConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `grantee`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `did` | `string` | +| `grantee` | `string` | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L16) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :-------------------------- | +| `«destructured»` | `NFTAccessConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L20) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFTAccessCondition`](NFTAccessCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFTAccessCondition`](NFTAccessCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L12) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTAccessService.md b/docs/api-reference/classes/NFTAccessService.md new file mode 100644 index 000000000..d5774f2fa --- /dev/null +++ b/docs/api-reference/classes/NFTAccessService.md @@ -0,0 +1,433 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTAccessService + +# Class: NFTAccessService + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`NFTAccessService`** + +## Implements + +- [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md)\> + +## Table of contents + +### Constructors + +- [constructor](NFTAccessService.md#constructor) + +### Properties + +- [normal](NFTAccessService.md#normal) +- [normal721](NFTAccessService.md#normal721) + +### Accessors + +- [artifactsFolder](NFTAccessService.md#artifactsfolder) +- [circuitsFolder](NFTAccessService.md#circuitsfolder) +- [config](NFTAccessService.md#config) +- [instanceConfig](NFTAccessService.md#instanceconfig) +- [instantiableConfig](NFTAccessService.md#instantiableconfig) +- [logger](NFTAccessService.md#logger) +- [nevermined](NFTAccessService.md#nevermined) +- [web3](NFTAccessService.md#web3) + +### Methods + +- [accept](NFTAccessService.md#accept) +- [createService](NFTAccessService.md#createservice) +- [process](NFTAccessService.md#process) +- [select](NFTAccessService.md#select) +- [setInstanceConfig](NFTAccessService.md#setinstanceconfig) +- [track](NFTAccessService.md#track) +- [getInstance](NFTAccessService.md#getinstance) +- [setInstanceConfig](NFTAccessService.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFTAccessService**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/AccessService.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L78) + +## Properties + +### normal + +• **normal**: [`NFTAccessTemplate`](NFTAccessTemplate.md) + +#### Defined in + +[src/nevermined/AccessService.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L75) + +--- + +### normal721 + +• **normal721**: [`NFT721AccessTemplate`](NFT721AccessTemplate.md) + +#### Defined in + +[src/nevermined/AccessService.ts:76](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L76) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[accept](../interfaces/ServicePlugin.md#accept) + +#### Defined in + +[src/nevermined/AccessService.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L115) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `pricedData?`): [`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `pricedData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md) + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[createService](../interfaces/ServicePlugin.md#createservice) + +#### Defined in + +[src/nevermined/AccessService.ts:85](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L85) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[process](../interfaces/ServicePlugin.md#process) + +#### Defined in + +[src/nevermined/AccessService.ts:106](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L106) + +--- + +### select + +▸ **select**(`main`): [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md)\> + +#### Parameters + +| Name | Type | +| :----- | :---------------------------------------------- | +| `main` | [`MetaDataMain`](../interfaces/MetaDataMain.md) | + +#### Returns + +[`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md)\> + +#### Defined in + +[src/nevermined/AccessService.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L102) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### track + +▸ **track**(`params`, `from`, `txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[track](../interfaces/ServicePlugin.md#track) + +#### Defined in + +[src/nevermined/AccessService.ts:120](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L120) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTAccessTemplate.md b/docs/api-reference/classes/NFTAccessTemplate.md new file mode 100644 index 000000000..316920ce3 --- /dev/null +++ b/docs/api-reference/classes/NFTAccessTemplate.md @@ -0,0 +1,1439 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTAccessTemplate + +# Class: NFTAccessTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<`NFTAccessTemplateParams`, [`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md)\> + + ↳ **`NFTAccessTemplate`** + +## Table of contents + +### Constructors + +- [constructor](NFTAccessTemplate.md#constructor) + +### Properties + +- [address](NFTAccessTemplate.md#address) +- [contract](NFTAccessTemplate.md#contract) +- [contractName](NFTAccessTemplate.md#contractname) +- [events](NFTAccessTemplate.md#events) +- [version](NFTAccessTemplate.md#version) + +### Accessors + +- [artifactsFolder](NFTAccessTemplate.md#artifactsfolder) +- [circuitsFolder](NFTAccessTemplate.md#circuitsfolder) +- [config](NFTAccessTemplate.md#config) +- [instanceConfig](NFTAccessTemplate.md#instanceconfig) +- [instantiableConfig](NFTAccessTemplate.md#instantiableconfig) +- [logger](NFTAccessTemplate.md#logger) +- [nevermined](NFTAccessTemplate.md#nevermined) +- [web3](NFTAccessTemplate.md#web3) + +### Methods + +- [accept](NFTAccessTemplate.md#accept) +- [agreementId](NFTAccessTemplate.md#agreementid) +- [call](NFTAccessTemplate.md#call) +- [conditions](NFTAccessTemplate.md#conditions) +- [createAgreement](NFTAccessTemplate.md#createagreement) +- [createAgreementAndPay](NFTAccessTemplate.md#createagreementandpay) +- [createAgreementFromDDO](NFTAccessTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](NFTAccessTemplate.md#createagreementwithpaymentfromddo) +- [createService](NFTAccessTemplate.md#createservice) +- [description](NFTAccessTemplate.md#description) +- [extraGen](NFTAccessTemplate.md#extragen) +- [getAgreementCreatedEvent](NFTAccessTemplate.md#getagreementcreatedevent) +- [getAgreementData](NFTAccessTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](NFTAccessTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](NFTAccessTemplate.md#getagreementstatus) +- [getAgreementsForDID](NFTAccessTemplate.md#getagreementsfordid) +- [getConditionTypes](NFTAccessTemplate.md#getconditiontypes) +- [getConditions](NFTAccessTemplate.md#getconditions) +- [getFromAddress](NFTAccessTemplate.md#getfromaddress) +- [getInputsOfMethod](NFTAccessTemplate.md#getinputsofmethod) +- [getServiceAgreementTemplate](NFTAccessTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](NFTAccessTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](NFTAccessTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](NFTAccessTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](NFTAccessTemplate.md#getsignatureofmethod) +- [init](NFTAccessTemplate.md#init) +- [instanceFromDDO](NFTAccessTemplate.md#instancefromddo) +- [lockConditionIndex](NFTAccessTemplate.md#lockconditionindex) +- [lockTokens](NFTAccessTemplate.md#locktokens) +- [name](NFTAccessTemplate.md#name) +- [params](NFTAccessTemplate.md#params) +- [paramsGen](NFTAccessTemplate.md#paramsgen) +- [paymentData](NFTAccessTemplate.md#paymentdata) +- [printAgreementStatus](NFTAccessTemplate.md#printagreementstatus) +- [process](NFTAccessTemplate.md#process) +- [send](NFTAccessTemplate.md#send) +- [sendFrom](NFTAccessTemplate.md#sendfrom) +- [service](NFTAccessTemplate.md#service) +- [serviceEndpoint](NFTAccessTemplate.md#serviceendpoint) +- [setInstanceConfig](NFTAccessTemplate.md#setinstanceconfig) +- [standardContext](NFTAccessTemplate.md#standardcontext) +- [track](NFTAccessTemplate.md#track) +- [validateAgreement](NFTAccessTemplate.md#validateagreement) +- [getInstance](NFTAccessTemplate.md#getinstance) +- [setInstanceConfig](NFTAccessTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new NFTAccessTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:107](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L107) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`NFTHolderCondition`](NFTHolderCondition.md), [`NFTAccessCondition`](NFTAccessCondition.md)] + +#### Returns + +[[`NFTHolderCondition`](NFTHolderCondition.md), [`NFTAccessCondition`](NFTAccessCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L42) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `NFTAccessTemplateParams` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `NFTAccessTemplateParams` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): [`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceNFTAccess`](../interfaces/ServiceNFTAccess.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L31) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------------------------ | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `NFTAccessTemplateParams` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:71](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L71) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFTAccessTemplateParams`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `NFTAccessTemplateParams` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFTAccessTemplateParams`\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L47) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L74) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L28) + +--- + +### params + +▸ **params**(`holderAddress`, `amount?`): `NFTAccessTemplateParams` + +#### Parameters + +| Name | Type | +| :-------------- | :------- | +| `holderAddress` | `string` | +| `amount?` | `bigint` | + +#### Returns + +`NFTAccessTemplateParams` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L35) + +--- + +### paramsGen + +▸ **paramsGen**(`«destructured»`): `Promise`<`NFTAccessTemplateParams`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :--------------- | :------------------------------------------------------ | :----------------- | +| `«destructured»` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`NFTAccessTemplateParams`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L38) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L75) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L25) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`params`, `from`, `txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:143](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L143) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `NFTAccessTemplateParams` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L90) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFTAccessTemplate`](NFTAccessTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFTAccessTemplate`](NFTAccessTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/NFTAccessTemplate.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTAccessTemplate.ts#L21) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTAttributes.md b/docs/api-reference/classes/NFTAttributes.md new file mode 100644 index 000000000..f6cec2c7b --- /dev/null +++ b/docs/api-reference/classes/NFTAttributes.md @@ -0,0 +1,501 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTAttributes + +# Class: NFTAttributes + +## Hierarchy + +- [`AssetAttributes`](AssetAttributes.md) + + ↳ **`NFTAttributes`** + +## Table of contents + +### Constructors + +- [constructor](NFTAttributes.md#constructor) + +### Properties + +- [appId](NFTAttributes.md#appid) +- [cap](NFTAttributes.md#cap) +- [encryptionMethod](NFTAttributes.md#encryptionmethod) +- [ercType](NFTAttributes.md#erctype) +- [fulfillAccessTimelock](NFTAttributes.md#fulfillaccesstimelock) +- [fulfillAccessTimeout](NFTAttributes.md#fulfillaccesstimeout) +- [metadata](NFTAttributes.md#metadata) +- [nftContractAddress](NFTAttributes.md#nftcontractaddress) +- [nftMetadataUrl](NFTAttributes.md#nftmetadataurl) +- [nftType](NFTAttributes.md#nfttype) +- [preMint](NFTAttributes.md#premint) +- [predefinedAssetServices](NFTAttributes.md#predefinedassetservices) +- [providers](NFTAttributes.md#providers) +- [royaltyAttributes](NFTAttributes.md#royaltyattributes) +- [services](NFTAttributes.md#services) +- [DEFAULT_ENCRYPTION_METHOD](NFTAttributes.md#default_encryption_method) +- [defaultValues](NFTAttributes.md#defaultvalues) + +### Methods + +- [getCreditsSubscriptionInstance](NFTAttributes.md#getcreditssubscriptioninstance) +- [getInstance](NFTAttributes.md#getinstance) +- [getNFT1155Instance](NFTAttributes.md#getnft1155instance) +- [getNFT721Instance](NFTAttributes.md#getnft721instance) +- [getPOAPInstance](NFTAttributes.md#getpoapinstance) +- [getSoulBoundInstance](NFTAttributes.md#getsoulboundinstance) +- [getSubscriptionInstance](NFTAttributes.md#getsubscriptioninstance) + +## Constructors + +### constructor + +• **new NFTAttributes**() + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[constructor](AssetAttributes.md#constructor) + +## Properties + +### appId + +• `Optional` **appId**: `string` + +Unique identifier of the application/domain/vertical where the asset belong to. +That asset association typically helps to search and filter between assets part of a domain via Marketplace API + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[appId](AssetAttributes.md#appid) + +#### Defined in + +[src/models/AssetAttributes.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L47) + +--- + +### cap + +• `Optional` **cap**: `bigint` + +Max number of nfts that can be minted, 0 means uncapped + +#### Defined in + +[src/models/NFTAttributes.ts:87](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L87) + +--- + +### encryptionMethod + +• `Optional` **encryptionMethod**: [`EncryptionMethod`](../code-reference.md#encryptionmethod) + +When an asset is published in a Nevermined network, some internal Metadata attributes are encrypted so they can't be accessed. +This method allows to specify the encryption method to be used. + +**`See`** + +[EncryptionMethod](../code-reference.md#encryptionmethod) + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[encryptionMethod](AssetAttributes.md#encryptionmethod) + +#### Defined in + +[src/models/AssetAttributes.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L20) + +--- + +### ercType + +• **ercType**: [`ERCType`](../enums/ERCType.md) + +The type of ERC used (721 or 1155) + +**`See`** + +- [https://ethereum.org/en/developers/docs/standards/tokens/erc-721/](https://ethereum.org/en/developers/docs/standards/tokens/erc-721/) +- [https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/](https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/) + +#### Defined in + +[src/models/NFTAttributes.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L55) + +--- + +### fulfillAccessTimelock + +• `Optional` **fulfillAccessTimelock**: `number` + +An asset can offer different services. Each service can have different conditions that need to be fulfilled +to provide that service. These conditions can expire if they are not fulfilled in a certain period of time. +This attribute allows to specify a period of time the condition can not be fullfilled +Setting up a timelock of 0 means that the condition can be fulfilled at any time. +Setting a timelock greater than 0 means that the condition can not be fulfilled until that number of blocks after the agreement is created are mined. +This would allow to create an agreement that can not fulfilled until certain period of time. + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[fulfillAccessTimelock](AssetAttributes.md#fulfillaccesstimelock) + +#### Defined in + +[src/models/AssetAttributes.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L67) + +--- + +### fulfillAccessTimeout + +• `Optional` **fulfillAccessTimeout**: `number` + +An asset can offer different services. Each service can have different conditions that need to be fulfilled +to provide that service. These conditions can expire if they are not fulfilled in a certain period of time. +This attribute allows to specify the timeouts for the access condition associated to the service. +Setting up a timeout of 0 means that the condition will never expire. +Setting a timeout greater than 0 means that the condition will expire after that number of blocks after the agreement is created. +This would allow to create an agreement that is not fulfilled after a certain period of time, the user can claim back funds locked if the condition is any. + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[fulfillAccessTimeout](AssetAttributes.md#fulfillaccesstimeout) + +#### Defined in + +[src/models/AssetAttributes.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L57) + +--- + +### metadata + +• **metadata**: [`MetaData`](../interfaces/MetaData.md) + +Metadata describing the asset + +**`See`** + +[MetaData](../interfaces/MetaData.md) + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[metadata](AssetAttributes.md#metadata) + +#### Defined in + +[src/models/AssetAttributes.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L13) + +--- + +### nftContractAddress + +• **nftContractAddress**: `string` + +The address of the deployed NFT Contract + +#### Defined in + +[src/models/NFTAttributes.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L67) + +--- + +### nftMetadataUrl + +• `Optional` **nftMetadataUrl**: `string` + +URL to the metadata definition of the NFT contract + +#### Defined in + +[src/models/NFTAttributes.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L82) + +--- + +### nftType + +• **nftType**: [`NeverminedNFTType`](../code-reference.md#neverminednfttype) + +The Nevermined implementation of the NFT used. +A part of what type of ERC is based, Nevermined provides different NFT implementations to fit in different scenarios. +This attribute allow to specify between the different Nevermined NFT types + +#### Defined in + +[src/models/NFTAttributes.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L62) + +--- + +### preMint + +• `Optional` **preMint**: `boolean` + +If the asset is pre-minted + +#### Defined in + +[src/models/NFTAttributes.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L77) + +--- + +### predefinedAssetServices + +• `Optional` **predefinedAssetServices**: [`ServiceCommon`](../interfaces/ServiceCommon.md)[] + +List of additional asset services to be included as part of an asset + +**`See`** + +[Service](../code-reference.md#service) + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[predefinedAssetServices](AssetAttributes.md#predefinedassetservices) + +#### Defined in + +[src/models/AssetAttributes.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L32) + +--- + +### providers + +• `Optional` **providers**: `string`[] + +A provider of an asset identify the public address of an account with some privileges over that asset. +Typically these permissions are granted to Nevermined Nodes to allow them to give access to some services without +the direct interaction of the final user. +Here a user publishing an asset can define a list of all the addresses with these permissions. +Typically just the address of one Nevermined Node trusted by the user. + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[providers](AssetAttributes.md#providers) + +#### Defined in + +[src/models/AssetAttributes.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L41) + +--- + +### royaltyAttributes + +• `Optional` **royaltyAttributes**: [`RoyaltyAttributes`](../interfaces/RoyaltyAttributes.md) + +Attributes describing the royalties attached to the NFT in the secondary market + +#### Defined in + +[src/models/NFTAttributes.ts:72](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L72) + +--- + +### services + +• `Optional` **services**: [`ServiceAttributes`](../interfaces/ServiceAttributes.md)[] + +List of services and their attributes offered by an asset. + +**`See`** + +[ServiceAttributes](../interfaces/ServiceAttributes.md) + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[services](AssetAttributes.md#services) + +#### Defined in + +[src/models/AssetAttributes.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L26) + +--- + +### DEFAULT_ENCRYPTION_METHOD + +▪ `Static` **DEFAULT_ENCRYPTION_METHOD**: [`EncryptionMethod`](../code-reference.md#encryptionmethod) + +#### Inherited from + +[AssetAttributes](AssetAttributes.md).[DEFAULT_ENCRYPTION_METHOD](AssetAttributes.md#default_encryption_method) + +#### Defined in + +[src/models/AssetAttributes.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/AssetAttributes.ts#L7) + +--- + +### defaultValues + +▪ `Static` **defaultValues**: `Object` + +#### Type declaration + +| Name | Type | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `appId` | `string` | +| `cap` | `bigint` | +| `encryptionMethod` | [`EncryptionMethod`](../code-reference.md#encryptionmethod) | +| `fulfillAccessTimelock` | `number` | +| `fulfillAccessTimeout` | `number` | +| `nft` | { `amount`: `bigint` ; `duration`: `number` = 0; `isSubscription`: `boolean` = false; `nftTransfer`: `boolean` = true; `serviceType`: [`ServiceType`](../code-reference.md#servicetype) ; `tokenId`: `string` = '' } | +| `nft.amount` | `bigint` | +| `nft.duration` | `number` | +| `nft.isSubscription` | `boolean` | +| `nft.nftTransfer` | `boolean` | +| `nft.serviceType` | [`ServiceType`](../code-reference.md#servicetype) | +| `nft.tokenId` | `string` | +| `nftMetadataUrl` | `string` | +| `preMint` | `boolean` | +| `predefinedAssetServices` | [`ServiceCommon`](../interfaces/ServiceCommon.md)[] | +| `providers` | `any`[] | +| `royaltyAttributes` | `any` | +| `services` | { `price`: [`AssetPrice`](AssetPrice.md) ; `serviceType`: [`ServiceType`](../code-reference.md#servicetype) }[] | + +#### Overrides + +[AssetAttributes](AssetAttributes.md).[defaultValues](AssetAttributes.md#defaultvalues) + +#### Defined in + +[src/models/NFTAttributes.ts:89](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L89) + +## Methods + +### getCreditsSubscriptionInstance + +▸ `Static` **getCreditsSubscriptionInstance**(`nftAttributes`): `Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `nftAttributes` | `Partial`<[`NFTAttributes`](NFTAttributes.md)\> | + +#### Returns + +`Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Defined in + +[src/models/NFTAttributes.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L116) + +--- + +### getInstance + +▸ `Static` **getInstance**(`nftAttributes`): `Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------- | +| `nftAttributes` | [`NFTAttributes`](NFTAttributes.md) | + +#### Returns + +`Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Overrides + +[AssetAttributes](AssetAttributes.md).[getInstance](AssetAttributes.md#getinstance) + +#### Defined in + +[src/models/NFTAttributes.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L98) + +--- + +### getNFT1155Instance + +▸ `Static` **getNFT1155Instance**(`nftAttributes`): `Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `nftAttributes` | `Partial`<[`NFTAttributes`](NFTAttributes.md)\> | + +#### Returns + +`Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Defined in + +[src/models/NFTAttributes.ts:105](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L105) + +--- + +### getNFT721Instance + +▸ `Static` **getNFT721Instance**(`nftAttributes`): `Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `nftAttributes` | `Partial`<[`NFTAttributes`](NFTAttributes.md)\> | + +#### Returns + +`Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Defined in + +[src/models/NFTAttributes.ts:134](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L134) + +--- + +### getPOAPInstance + +▸ `Static` **getPOAPInstance**(`nftAttributes`): `Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `nftAttributes` | `Partial`<[`NFTAttributes`](NFTAttributes.md)\> | + +#### Returns + +`Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Defined in + +[src/models/NFTAttributes.ts:161](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L161) + +--- + +### getSoulBoundInstance + +▸ `Static` **getSoulBoundInstance**(`nftAttributes`): `Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `nftAttributes` | `Partial`<[`NFTAttributes`](NFTAttributes.md)\> | + +#### Returns + +`Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Defined in + +[src/models/NFTAttributes.ts:173](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L173) + +--- + +### getSubscriptionInstance + +▸ `Static` **getSubscriptionInstance**(`nftAttributes`): `Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `nftAttributes` | `Partial`<[`NFTAttributes`](NFTAttributes.md)\> | + +#### Returns + +`Required`<[`NFTAttributes`](NFTAttributes.md)\> + +#### Defined in + +[src/models/NFTAttributes.ts:145](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L145) diff --git a/docs/api-reference/classes/NFTContractsBase.md b/docs/api-reference/classes/NFTContractsBase.md new file mode 100644 index 000000000..786901e86 --- /dev/null +++ b/docs/api-reference/classes/NFTContractsBase.md @@ -0,0 +1,725 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTContractsBase + +# Class: NFTContractsBase + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`NFTContractsBase`** + + ↳↳ [`Nft721Contract`](Nft721Contract.md) + + ↳↳ [`Nft1155Contract`](Nft1155Contract.md) + +## Table of contents + +### Constructors + +- [constructor](NFTContractsBase.md#constructor) + +### Properties + +- [address](NFTContractsBase.md#address) +- [contract](NFTContractsBase.md#contract) +- [contractName](NFTContractsBase.md#contractname) +- [events](NFTContractsBase.md#events) +- [version](NFTContractsBase.md#version) + +### Accessors + +- [artifactsFolder](NFTContractsBase.md#artifactsfolder) +- [circuitsFolder](NFTContractsBase.md#circuitsfolder) +- [config](NFTContractsBase.md#config) +- [instanceConfig](NFTContractsBase.md#instanceconfig) +- [instantiableConfig](NFTContractsBase.md#instantiableconfig) +- [logger](NFTContractsBase.md#logger) +- [nevermined](NFTContractsBase.md#nevermined) +- [web3](NFTContractsBase.md#web3) + +### Methods + +- [\_createClone](NFTContractsBase.md#_createclone) +- [call](NFTContractsBase.md#call) +- [getFromAddress](NFTContractsBase.md#getfromaddress) +- [getInputsOfMethod](NFTContractsBase.md#getinputsofmethod) +- [getMintedEntries](NFTContractsBase.md#getmintedentries) +- [getNFTAttributes](NFTContractsBase.md#getnftattributes) +- [getSignatureOfMethod](NFTContractsBase.md#getsignatureofmethod) +- [grantOperatorRole](NFTContractsBase.md#grantoperatorrole) +- [init](NFTContractsBase.md#init) +- [isOperator](NFTContractsBase.md#isoperator) +- [owner](NFTContractsBase.md#owner) +- [revokeOperatorRole](NFTContractsBase.md#revokeoperatorrole) +- [send](NFTContractsBase.md#send) +- [sendFrom](NFTContractsBase.md#sendfrom) +- [setInstanceConfig](NFTContractsBase.md#setinstanceconfig) +- [getInstance](NFTContractsBase.md#getinstance) +- [setInstanceConfig](NFTContractsBase.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFTContractsBase**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_createClone + +▸ `Protected` **\_createClone**(`ercType`, `name`, `symbol`, `uri`, `cap`, `operators?`, `from?`, `txParams?`): `Promise`<`any`\> + +Creates a contract clone of an existing contract instance + +#### Parameters + +| Name | Type | Default value | Description | +| :---------- | :---------------------------------------------- | :------------ | :------------------------------------------------------ | +| `ercType` | `721` \| `1155` | `undefined` | - | +| `name` | `string` | `undefined` | NFT Contract name | +| `symbol` | `string` | `undefined` | NFT Contract symbol | +| `uri` | `string` | `undefined` | NFT Contract metadata uri | +| `cap` | `bigint` | `undefined` | NFT cap (just for ERC-721) | +| `operators` | `string`[] | `[]` | Array of account addresses to be added as NFT operators | +| `from?` | [`Account`](Account.md) | `undefined` | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | - | + +#### Returns + +`Promise`<`any`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L34) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getMintedEntries + +▸ **getMintedEntries**(`owner`, `did?`): `Promise`<[`MintedEntry`](../interfaces/MintedEntry.md)[]\> + +It gets all the `MintedEntries` events from the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :------ | :------- | :---------------------- | +| `owner` | `string` | the user owning the NFT | +| `did?` | `string` | the tokenId of the NFT | + +#### Returns + +`Promise`<[`MintedEntry`](../interfaces/MintedEntry.md)[]\> + +An array of `MintedEntry` objects + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L125) + +--- + +### getNFTAttributes + +▸ **getNFTAttributes**(`did`): `Promise`<{ `mintCap`: `bigint` ; `nftInitialized`: `boolean` ; `nftSupply`: `bigint` ; `nftURI`: `string` }\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<{ `mintCap`: `bigint` ; `nftInitialized`: `boolean` ; `nftSupply`: `bigint` ; `nftURI`: `string` }\> + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L82) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### grantOperatorRole + +▸ **grantOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Add an address as operator in the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------- | +| `operatorAddress` | `string` | New minter address | +| `from?` | [`Account`](Account.md) | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L69) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### isOperator + +▸ **isOperator**(`address`): `Promise`<`boolean`\> + +Checks if an account is an operator in the NFT contract + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :----------------------------------------- | +| `address` | `string` | Account address to check if is an operator | + +#### Returns + +`Promise`<`boolean`\> + +true if is an operator + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L78) + +--- + +### owner + +▸ **owner**(): `Promise`<`string`\> + +Gets the contract owner + +#### Returns + +`Promise`<`string`\> + +Address of the contract owner + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L19) + +--- + +### revokeOperatorRole + +▸ **revokeOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Revoke an address as operator in the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------- | +| `operatorAddress` | `string` | Minter address to revoke | +| `from?` | [`Account`](Account.md) | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L115) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTError.md b/docs/api-reference/classes/NFTError.md new file mode 100644 index 000000000..023f30b11 --- /dev/null +++ b/docs/api-reference/classes/NFTError.md @@ -0,0 +1,165 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTError + +# Class: NFTError + +## Hierarchy + +- `Error` + + ↳ **`NFTError`** + +## Table of contents + +### Constructors + +- [constructor](NFTError.md#constructor) + +### Properties + +- [message](NFTError.md#message) +- [name](NFTError.md#name) +- [stack](NFTError.md#stack) +- [prepareStackTrace](NFTError.md#preparestacktrace) +- [stackTraceLimit](NFTError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](NFTError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new NFTError**(`message`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/NFTError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/NFTError.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/NFTHolderCondition.md b/docs/api-reference/classes/NFTHolderCondition.md new file mode 100644 index 000000000..3f6787078 --- /dev/null +++ b/docs/api-reference/classes/NFTHolderCondition.md @@ -0,0 +1,999 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTHolderCondition + +# Class: NFTHolderCondition + +Allows to fulfill a condition to users holding some amount of NFTs for a specific DID. + +## Hierarchy + +- [`ConsumerCondition`](ConsumerCondition.md)<`NFTHolderConditionContext`\> + + ↳ **`NFTHolderCondition`** + +## Table of contents + +### Constructors + +- [constructor](NFTHolderCondition.md#constructor) + +### Properties + +- [address](NFTHolderCondition.md#address) +- [contract](NFTHolderCondition.md#contract) +- [contractName](NFTHolderCondition.md#contractname) +- [events](NFTHolderCondition.md#events) +- [version](NFTHolderCondition.md#version) + +### Accessors + +- [artifactsFolder](NFTHolderCondition.md#artifactsfolder) +- [circuitsFolder](NFTHolderCondition.md#circuitsfolder) +- [config](NFTHolderCondition.md#config) +- [instanceConfig](NFTHolderCondition.md#instanceconfig) +- [instantiableConfig](NFTHolderCondition.md#instantiableconfig) +- [logger](NFTHolderCondition.md#logger) +- [nevermined](NFTHolderCondition.md#nevermined) +- [web3](NFTHolderCondition.md#web3) + +### Methods + +- [abortByTimeOut](NFTHolderCondition.md#abortbytimeout) +- [amountFromService](NFTHolderCondition.md#amountfromservice) +- [call](NFTHolderCondition.md#call) +- [fulfill](NFTHolderCondition.md#fulfill) +- [fulfillInstance](NFTHolderCondition.md#fulfillinstance) +- [fulfillPlain](NFTHolderCondition.md#fulfillplain) +- [fulfillWithNode](NFTHolderCondition.md#fulfillwithnode) +- [generateId](NFTHolderCondition.md#generateid) +- [generateIdHash](NFTHolderCondition.md#generateidhash) +- [generateIdWithSeed](NFTHolderCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](NFTHolderCondition.md#getconditionfulfilledevent) +- [getFromAddress](NFTHolderCondition.md#getfromaddress) +- [getInputsOfMethod](NFTHolderCondition.md#getinputsofmethod) +- [getSignatureOfMethod](NFTHolderCondition.md#getsignatureofmethod) +- [hashValues](NFTHolderCondition.md#hashvalues) +- [hashValuesPlain](NFTHolderCondition.md#hashvaluesplain) +- [init](NFTHolderCondition.md#init) +- [instance](NFTHolderCondition.md#instance) +- [instanceFromDDO](NFTHolderCondition.md#instancefromddo) +- [nftContractFromService](NFTHolderCondition.md#nftcontractfromservice) +- [params](NFTHolderCondition.md#params) +- [paramsFromDDO](NFTHolderCondition.md#paramsfromddo) +- [send](NFTHolderCondition.md#send) +- [sendFrom](NFTHolderCondition.md#sendfrom) +- [setInstanceConfig](NFTHolderCondition.md#setinstanceconfig) +- [getInstance](NFTHolderCondition.md#getinstance) +- [setInstanceConfig](NFTHolderCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFTHolderCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[constructor](ConsumerCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[address](ConsumerCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contract](ConsumerCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contractName](ConsumerCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[events](ConsumerCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[version](ConsumerCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ConsumerCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ConsumerCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ConsumerCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ConsumerCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[abortByTimeOut](ConsumerCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### amountFromService + +▸ **amountFromService**(`service`): `bigint` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`bigint` + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L39) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[call](ConsumerCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `holderAddress`, `amount`, `nftContractAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill requires a validation that holder as enough NFTs for a specific DID. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :---------------------------------------------- | :----------------------------------------------- | +| `agreementId` | `string` | SEA agreement identifier. | +| `did` | `string` | The Decentralized Identifier of the asset. | +| `holderAddress` | `string` | The contract address where the reward is locked. | +| `amount` | `bigint` | The amount of NFT to be hold | +| `nftContractAddress` | `string` | Address of the nft contract | +| `from?` | [`Account`](Account.md) | Account sending the transaction | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transacion parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +condition state + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[fulfill](ConsumerCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L74) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillInstance](ConsumerCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillPlain](ConsumerCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`_cond`, `_additionalParams`, `_from?`, `_txParams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------------ | :----------------------------------------------------------------------------------------- | +| `_cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `_additionalParams` | `Record`<`string`, `unknown`\> | +| `_from?` | [`Account`](Account.md) | +| `_txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillWithNode](ConsumerCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:217](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L217) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateId](ConsumerCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdHash](ConsumerCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdWithSeed](ConsumerCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getConditionFulfilledEvent](ConsumerCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getFromAddress](ConsumerCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getInputsOfMethod](ConsumerCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getSignatureOfMethod](ConsumerCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValues](ConsumerCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValuesPlain](ConsumerCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[init](ConsumerCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instance](ConsumerCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `NFTHolderConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instanceFromDDO](ConsumerCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nftContractFromService + +▸ **nftContractFromService**(`service`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`string` + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L45) + +--- + +### params + +▸ **params**(`did`, `holderAddress`, `amount`, `nftContractAddress?`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generate the hash of condition inputs with the following parameters. + +#### Parameters + +| Name | Type | Description | +| :-------------------- | :------- | :---------------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the asset. | +| `holderAddress` | `string` | The address of the NFT holder . | +| `amount` | `bigint` | The amount of NFTs that need to be hold by the holder | +| `nftContractAddress?` | `string` | The address of the NFT token to use. | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +hash of all the values + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[params](ConsumerCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L30) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :-------------------------- | +| `«destructured»` | `NFTHolderConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[paramsFromDDO](ConsumerCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L52) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[send](ConsumerCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[sendFrom](ConsumerCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFTHolderCondition`](NFTHolderCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFTHolderCondition`](NFTHolderCondition.md)\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[getInstance](ConsumerCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L17) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTLockCondition.md b/docs/api-reference/classes/NFTLockCondition.md new file mode 100644 index 000000000..33cbefca7 --- /dev/null +++ b/docs/api-reference/classes/NFTLockCondition.md @@ -0,0 +1,955 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTLockCondition + +# Class: NFTLockCondition + +Implementation of the NFT Lock Condition + +## Hierarchy + +- [`ConsumerCondition`](ConsumerCondition.md)<`NFTLockConditionContext`\> + + ↳ **`NFTLockCondition`** + +## Table of contents + +### Constructors + +- [constructor](NFTLockCondition.md#constructor) + +### Properties + +- [address](NFTLockCondition.md#address) +- [contract](NFTLockCondition.md#contract) +- [contractName](NFTLockCondition.md#contractname) +- [events](NFTLockCondition.md#events) +- [version](NFTLockCondition.md#version) + +### Accessors + +- [artifactsFolder](NFTLockCondition.md#artifactsfolder) +- [circuitsFolder](NFTLockCondition.md#circuitsfolder) +- [config](NFTLockCondition.md#config) +- [instanceConfig](NFTLockCondition.md#instanceconfig) +- [instantiableConfig](NFTLockCondition.md#instantiableconfig) +- [logger](NFTLockCondition.md#logger) +- [nevermined](NFTLockCondition.md#nevermined) +- [web3](NFTLockCondition.md#web3) + +### Methods + +- [abortByTimeOut](NFTLockCondition.md#abortbytimeout) +- [call](NFTLockCondition.md#call) +- [fulfill](NFTLockCondition.md#fulfill) +- [fulfillInstance](NFTLockCondition.md#fulfillinstance) +- [fulfillPlain](NFTLockCondition.md#fulfillplain) +- [fulfillWithNode](NFTLockCondition.md#fulfillwithnode) +- [generateId](NFTLockCondition.md#generateid) +- [generateIdHash](NFTLockCondition.md#generateidhash) +- [generateIdWithSeed](NFTLockCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](NFTLockCondition.md#getconditionfulfilledevent) +- [getFromAddress](NFTLockCondition.md#getfromaddress) +- [getInputsOfMethod](NFTLockCondition.md#getinputsofmethod) +- [getSignatureOfMethod](NFTLockCondition.md#getsignatureofmethod) +- [hashValues](NFTLockCondition.md#hashvalues) +- [hashValuesPlain](NFTLockCondition.md#hashvaluesplain) +- [init](NFTLockCondition.md#init) +- [instance](NFTLockCondition.md#instance) +- [instanceFromDDO](NFTLockCondition.md#instancefromddo) +- [params](NFTLockCondition.md#params) +- [paramsFromDDO](NFTLockCondition.md#paramsfromddo) +- [send](NFTLockCondition.md#send) +- [sendFrom](NFTLockCondition.md#sendfrom) +- [setInstanceConfig](NFTLockCondition.md#setinstanceconfig) +- [getInstance](NFTLockCondition.md#getinstance) +- [setInstanceConfig](NFTLockCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFTLockCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[constructor](ConsumerCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[address](ConsumerCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contract](ConsumerCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[contractName](ConsumerCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[events](ConsumerCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[version](ConsumerCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ConsumerCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ConsumerCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ConsumerCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ConsumerCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ConsumerCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[abortByTimeOut](ConsumerCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[call](ConsumerCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `rewardAddress`, `amount`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill requires valid NFT transfer in order to lock the amount of DID NFTs based on SEA. + +#### Parameters + +| Name | Type | Description | +| :-------------- | :---------------------------------------------- | :----------------------------------------------- | +| `agreementId` | `string` | SEA agreement identifier. | +| `did` | `string` | Asset Decentralized identifier. | +| `rewardAddress` | `string` | The contract address where the reward is locked. | +| `amount` | `bigint` | The amount of tokens to be transferred. | +| `from?` | [`Account`](Account.md) | Account sending the transaction | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Condition state. + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[fulfill](ConsumerCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L45) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillInstance](ConsumerCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillPlain](ConsumerCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`_cond`, `_additionalParams`, `_from?`, `_txParams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------------ | :----------------------------------------------------------------------------------------- | +| `_cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `_additionalParams` | `Record`<`string`, `unknown`\> | +| `_from?` | [`Account`](Account.md) | +| `_txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[fulfillWithNode](ConsumerCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:217](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L217) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateId](ConsumerCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdHash](ConsumerCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[generateIdWithSeed](ConsumerCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getConditionFulfilledEvent](ConsumerCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getFromAddress](ConsumerCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getInputsOfMethod](ConsumerCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[getSignatureOfMethod](ConsumerCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValues](ConsumerCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[hashValuesPlain](ConsumerCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[init](ConsumerCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instance](ConsumerCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `NFTLockConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[instanceFromDDO](ConsumerCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### params + +▸ **params**(`did`, `rewardAddress`, `amount`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generates the hash of condition inputs. + +#### Parameters + +| Name | Type | Description | +| :-------------- | :------- | :----------------------------------------------- | +| `did` | `string` | The DID of the asset with NFTs attached to lock. | +| `rewardAddress` | `string` | The final address to receive the NFTs. | +| `amount` | `number` | The amount of locked tokens. | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Hash of all the values. + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[params](ConsumerCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L27) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :------------------------ | +| `«destructured»` | `NFTLockConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[paramsFromDDO](ConsumerCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L31) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[send](ConsumerCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[sendFrom](ConsumerCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFTLockCondition`](NFTLockCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFTLockCondition`](NFTLockCondition.md)\> + +#### Overrides + +[ConsumerCondition](ConsumerCondition.md).[getInstance](ConsumerCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L16) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerCondition](ConsumerCondition.md).[setInstanceConfig](ConsumerCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTSalesService.md b/docs/api-reference/classes/NFTSalesService.md new file mode 100644 index 000000000..17507bcb2 --- /dev/null +++ b/docs/api-reference/classes/NFTSalesService.md @@ -0,0 +1,433 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTSalesService + +# Class: NFTSalesService + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`NFTSalesService`** + +## Implements + +- [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceNFTSales`](../interfaces/ServiceNFTSales.md)\> + +## Table of contents + +### Constructors + +- [constructor](NFTSalesService.md#constructor) + +### Properties + +- [normal](NFTSalesService.md#normal) +- [normal721](NFTSalesService.md#normal721) + +### Accessors + +- [artifactsFolder](NFTSalesService.md#artifactsfolder) +- [circuitsFolder](NFTSalesService.md#circuitsfolder) +- [config](NFTSalesService.md#config) +- [instanceConfig](NFTSalesService.md#instanceconfig) +- [instantiableConfig](NFTSalesService.md#instantiableconfig) +- [logger](NFTSalesService.md#logger) +- [nevermined](NFTSalesService.md#nevermined) +- [web3](NFTSalesService.md#web3) + +### Methods + +- [accept](NFTSalesService.md#accept) +- [createService](NFTSalesService.md#createservice) +- [process](NFTSalesService.md#process) +- [select](NFTSalesService.md#select) +- [setInstanceConfig](NFTSalesService.md#setinstanceconfig) +- [track](NFTSalesService.md#track) +- [getInstance](NFTSalesService.md#getinstance) +- [setInstanceConfig](NFTSalesService.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFTSalesService**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/AccessService.ts:135](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L135) + +## Properties + +### normal + +• **normal**: [`NFTSalesTemplate`](NFTSalesTemplate.md) + +#### Defined in + +[src/nevermined/AccessService.ts:132](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L132) + +--- + +### normal721 + +• **normal721**: [`NFT721SalesTemplate`](NFT721SalesTemplate.md) + +#### Defined in + +[src/nevermined/AccessService.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L133) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[accept](../interfaces/ServicePlugin.md#accept) + +#### Defined in + +[src/nevermined/AccessService.ts:172](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L172) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `pricedData?`): [`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `pricedData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[createService](../interfaces/ServicePlugin.md#createservice) + +#### Defined in + +[src/nevermined/AccessService.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L142) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[process](../interfaces/ServicePlugin.md#process) + +#### Defined in + +[src/nevermined/AccessService.ts:163](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L163) + +--- + +### select + +▸ **select**(`main`): [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceNFTSales`](../interfaces/ServiceNFTSales.md)\> + +#### Parameters + +| Name | Type | +| :----- | :---------------------------------------------- | +| `main` | [`MetaDataMain`](../interfaces/MetaDataMain.md) | + +#### Returns + +[`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceNFTSales`](../interfaces/ServiceNFTSales.md)\> + +#### Defined in + +[src/nevermined/AccessService.ts:159](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L159) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### track + +▸ **track**(`params`, `from`, `txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Implementation of + +[ServicePlugin](../interfaces/ServicePlugin.md).[track](../interfaces/ServicePlugin.md#track) + +#### Defined in + +[src/nevermined/AccessService.ts:177](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L177) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTSalesTemplate.md b/docs/api-reference/classes/NFTSalesTemplate.md new file mode 100644 index 000000000..3a31092b6 --- /dev/null +++ b/docs/api-reference/classes/NFTSalesTemplate.md @@ -0,0 +1,1467 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTSalesTemplate + +# Class: NFTSalesTemplate + +## Hierarchy + +- [`BaseTemplate`](BaseTemplate.md)<`NFTSalesTemplateParams`, [`ServiceNFTSales`](../interfaces/ServiceNFTSales.md)\> + + ↳ **`NFTSalesTemplate`** + +## Table of contents + +### Constructors + +- [constructor](NFTSalesTemplate.md#constructor) + +### Properties + +- [address](NFTSalesTemplate.md#address) +- [contract](NFTSalesTemplate.md#contract) +- [contractName](NFTSalesTemplate.md#contractname) +- [events](NFTSalesTemplate.md#events) +- [version](NFTSalesTemplate.md#version) + +### Accessors + +- [artifactsFolder](NFTSalesTemplate.md#artifactsfolder) +- [circuitsFolder](NFTSalesTemplate.md#circuitsfolder) +- [config](NFTSalesTemplate.md#config) +- [instanceConfig](NFTSalesTemplate.md#instanceconfig) +- [instantiableConfig](NFTSalesTemplate.md#instantiableconfig) +- [logger](NFTSalesTemplate.md#logger) +- [nevermined](NFTSalesTemplate.md#nevermined) +- [web3](NFTSalesTemplate.md#web3) + +### Methods + +- [accept](NFTSalesTemplate.md#accept) +- [agreementId](NFTSalesTemplate.md#agreementid) +- [call](NFTSalesTemplate.md#call) +- [conditions](NFTSalesTemplate.md#conditions) +- [createAgreement](NFTSalesTemplate.md#createagreement) +- [createAgreementAndPay](NFTSalesTemplate.md#createagreementandpay) +- [createAgreementFromDDO](NFTSalesTemplate.md#createagreementfromddo) +- [createAgreementWithPaymentFromDDO](NFTSalesTemplate.md#createagreementwithpaymentfromddo) +- [createService](NFTSalesTemplate.md#createservice) +- [description](NFTSalesTemplate.md#description) +- [extraGen](NFTSalesTemplate.md#extragen) +- [getAgreementCreatedEvent](NFTSalesTemplate.md#getagreementcreatedevent) +- [getAgreementData](NFTSalesTemplate.md#getagreementdata) +- [getAgreementIdsFromDDO](NFTSalesTemplate.md#getagreementidsfromddo) +- [getAgreementStatus](NFTSalesTemplate.md#getagreementstatus) +- [getAgreementsForDID](NFTSalesTemplate.md#getagreementsfordid) +- [getConditionTypes](NFTSalesTemplate.md#getconditiontypes) +- [getConditions](NFTSalesTemplate.md#getconditions) +- [getFromAddress](NFTSalesTemplate.md#getfromaddress) +- [getInputsOfMethod](NFTSalesTemplate.md#getinputsofmethod) +- [getParamsFromService](NFTSalesTemplate.md#getparamsfromservice) +- [getServiceAgreementTemplate](NFTSalesTemplate.md#getserviceagreementtemplate) +- [getServiceAgreementTemplateConditionByRef](NFTSalesTemplate.md#getserviceagreementtemplateconditionbyref) +- [getServiceAgreementTemplateConditions](NFTSalesTemplate.md#getserviceagreementtemplateconditions) +- [getServiceAgreementTemplateDependencies](NFTSalesTemplate.md#getserviceagreementtemplatedependencies) +- [getSignatureOfMethod](NFTSalesTemplate.md#getsignatureofmethod) +- [init](NFTSalesTemplate.md#init) +- [instanceFromDDO](NFTSalesTemplate.md#instancefromddo) +- [lockConditionIndex](NFTSalesTemplate.md#lockconditionindex) +- [lockTokens](NFTSalesTemplate.md#locktokens) +- [name](NFTSalesTemplate.md#name) +- [params](NFTSalesTemplate.md#params) +- [paramsGen](NFTSalesTemplate.md#paramsgen) +- [paymentData](NFTSalesTemplate.md#paymentdata) +- [printAgreementStatus](NFTSalesTemplate.md#printagreementstatus) +- [process](NFTSalesTemplate.md#process) +- [send](NFTSalesTemplate.md#send) +- [sendFrom](NFTSalesTemplate.md#sendfrom) +- [service](NFTSalesTemplate.md#service) +- [serviceEndpoint](NFTSalesTemplate.md#serviceendpoint) +- [setInstanceConfig](NFTSalesTemplate.md#setinstanceconfig) +- [standardContext](NFTSalesTemplate.md#standardcontext) +- [track](NFTSalesTemplate.md#track) +- [validateAgreement](NFTSalesTemplate.md#validateagreement) +- [getInstance](NFTSalesTemplate.md#getinstance) +- [setInstanceConfig](NFTSalesTemplate.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new NFTSalesTemplate**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[constructor](BaseTemplate.md#constructor) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L68) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[address](BaseTemplate.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contract](BaseTemplate.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[contractName](BaseTemplate.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[events](BaseTemplate.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[version](BaseTemplate.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +BaseTemplate.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +BaseTemplate.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +BaseTemplate.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +BaseTemplate.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +BaseTemplate.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +BaseTemplate.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### accept + +▸ **accept**(`_params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[accept](BaseTemplate.md#accept) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:98](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L98) + +--- + +### agreementId + +▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `agreementIdSeed` | `string` | +| `creator` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[agreementId](BaseTemplate.md#agreementid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[call](BaseTemplate.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### conditions + +▸ **conditions**(): [[`LockPaymentCondition`](LockPaymentCondition.md), [`TransferNFTCondition`](TransferNFTCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Returns + +[[`LockPaymentCondition`](LockPaymentCondition.md), [`TransferNFTCondition`](TransferNFTCondition.md), [`EscrowPaymentCondition`](EscrowPaymentCondition.md)] + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[conditions](BaseTemplate.md#conditions) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:85](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L85) + +--- + +### createAgreement + +▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `extraArgs` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreement](BaseTemplate.md#createagreement) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L90) + +--- + +### createAgreementAndPay + +▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `conditionIds` | `string`[] | +| `timeLocks` | `number`[] | +| `timeOuts` | `number`[] | +| `accessConsumer` | `string` | +| `condIdx` | `number` | +| `rewardAddress` | `string` | +| `tokenAddress` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementAndPay](BaseTemplate.md#createagreementandpay) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L115) + +--- + +### createAgreementFromDDO + +▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`): `Promise`<`string`\> + +Create a new agreement using the data of a DDO. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------- | +| `agreementIdSeed` | `string` | - | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `parameters` | `NFTSalesTemplateParams` | | +| `consumer` | [`Account`](Account.md) | - | +| `from` | [`Account`](Account.md) | - | +| `timeOuts?` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`string`\> + +true if the call was successful. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementFromDDO](BaseTemplate.md#createagreementfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:222](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L222) + +--- + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `NFTSalesTemplateParams` | +| `consumer` | [`Account`](Account.md) | +| `from` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createAgreementWithPaymentFromDDO](BaseTemplate.md#createagreementwithpaymentfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L252) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes?`, `priceData?`): [`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](Account.md) | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](../interfaces/ServiceAttributes.md) | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | +| `priceData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +[`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[createService](BaseTemplate.md#createservice) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) + +--- + +### description + +▸ **description**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[description](BaseTemplate.md#description) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L39) + +--- + +### extraGen + +▸ **extraGen**(`_params`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[extraGen](BaseTemplate.md#extragen) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:94](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L94) + +--- + +### getAgreementCreatedEvent + +▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> + +Generates and returns the agreement creation event. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`any`[]\> + +Agreement created event. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementCreatedEvent](BaseTemplate.md#getagreementcreatedevent) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:459](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L459) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementData](BaseTemplate.md#getagreementdata) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) + +--- + +### getAgreementIdsFromDDO + +▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> + +Get agreement conditions IDs. + +#### Parameters + +| Name | Type | Description | +| :------------ | :----------------------- | :------------ | +| `agreementId` | `string` | Agreement ID. | +| `ddo` | [`DDO`](DDO.md) | DDO. | +| `creator` | `string` | - | +| `params` | `NFTSalesTemplateParams` | - | + +#### Returns + +`Promise`<`string`[]\> + +The condition IDs. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementIdsFromDDO](BaseTemplate.md#getagreementidsfromddo) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L180) + +--- + +### getAgreementStatus + +▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +Returns the status of the conditions. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/AgreementConditionsStatus.md)\> + +The conditions status. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementStatus](BaseTemplate.md#getagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:346](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L346) + +--- + +### getAgreementsForDID + +▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getAgreementsForDID](BaseTemplate.md#getagreementsfordid) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L485) + +--- + +### getConditionTypes + +▸ **getConditionTypes**(): `Promise`<`string`[]\> + +Conditions address list. + +#### Returns + +`Promise`<`string`[]\> + +A list of condition addresses. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditionTypes](BaseTemplate.md#getconditiontypes) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L154) + +--- + +### getConditions + +▸ **getConditions**(): `Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +List of condition contracts. + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)[]\> + +A list of condition contracts. + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getConditions](BaseTemplate.md#getconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L165) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getFromAddress](BaseTemplate.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getInputsOfMethod](BaseTemplate.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getParamsFromService + +▸ **getParamsFromService**(`consumerId`, `nftAmount`, `service`): `Promise`<`NFTSalesTemplateParams`\> + +#### Parameters + +| Name | Type | +| :----------- | :---------------------------------------------------- | +| `consumerId` | `string` | +| `nftAmount` | `bigint` | +| `service` | [`ServiceNFTSales`](../interfaces/ServiceNFTSales.md) | + +#### Returns + +`Promise`<`NFTSalesTemplateParams`\> + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L54) + +--- + +### getServiceAgreementTemplate + +▸ **getServiceAgreementTemplate**(): [`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Returns + +[`ServiceAgreementTemplate`](../interfaces/ServiceAgreementTemplate.md) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplate](BaseTemplate.md#getserviceagreementtemplate) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:136](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L136) + +--- + +### getServiceAgreementTemplateConditionByRef + +▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `ref` | `string` | + +#### Returns + +`Promise`<[`ConditionSmall`](ConditionSmall.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](BaseTemplate.md#getserviceagreementtemplateconditionbyref) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:329](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L329) + +--- + +### getServiceAgreementTemplateConditions + +▸ **getServiceAgreementTemplateConditions**(): [`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Returns + +[`ServiceAgreementTemplateCondition`](../interfaces/ServiceAgreementTemplateCondition.md)[] + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateConditions](BaseTemplate.md#getserviceagreementtemplateconditions) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) + +--- + +### getServiceAgreementTemplateDependencies + +▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Returns + +`Promise`<{ `[condition: string]`: `string`[]; }\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getServiceAgreementTemplateDependencies](BaseTemplate.md#getserviceagreementtemplatedependencies) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:336](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L336) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[getSignatureOfMethod](BaseTemplate.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[init](BaseTemplate.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`, `serviceIndex?`): `Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFTSalesTemplateParams`\>\> + +#### Parameters + +| Name | Type | +| :---------------- | :----------------------- | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `parameters` | `NFTSalesTemplateParams` | +| `serviceIndex?` | `number` | + +#### Returns + +`Promise`<[`AgreementInstance`](../interfaces/AgreementInstance.md)<`NFTSalesTemplateParams`\>\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[instanceFromDDO](BaseTemplate.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:91](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L91) + +--- + +### lockConditionIndex + +▸ **lockConditionIndex**(): `number` + +#### Returns + +`number` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[lockConditionIndex](BaseTemplate.md#lockconditionindex) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L81) + +--- + +### lockTokens + +▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `tokenAddress` | `any` | +| `amounts` | `any` | +| `from` | [`Account`](Account.md) | +| `txParams` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[lockTokens](BaseTemplate.md#locktokens) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:393](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L393) + +--- + +### name + +▸ **name**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[name](BaseTemplate.md#name) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L36) + +--- + +### params + +▸ **params**(`consumerId`, `nftAmount`, `duration?`, `expiration?`, `providerId?`, `nftTransfer?`): `NFTSalesTemplateParams` + +#### Parameters + +| Name | Type | +| :------------- | :-------- | +| `consumerId` | `string` | +| `nftAmount` | `bigint` | +| `duration?` | `number` | +| `expiration?` | `number` | +| `providerId?` | `string` | +| `nftTransfer?` | `boolean` | + +#### Returns + +`NFTSalesTemplateParams` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[params](BaseTemplate.md#params) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L43) + +--- + +### paramsGen + +▸ **paramsGen**(`«destructured»`): `Promise`<`NFTSalesTemplateParams`\> + +Specialize params + +#### Parameters + +| Name | Type | Description | +| :--------------- | :------------------------------------------------------ | :----------------- | +| `«destructured»` | [`ValidationParams`](../interfaces/ValidationParams.md) | Generic parameters | + +#### Returns + +`Promise`<`NFTSalesTemplateParams`\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[paramsGen](BaseTemplate.md#paramsgen) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:72](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L72) + +--- + +### paymentData + +▸ **paymentData**(`service`): `Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`Promise`<[`PaymentData`](../interfaces/PaymentData.md)\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[paymentData](BaseTemplate.md#paymentdata) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L78) + +--- + +### printAgreementStatus + +▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> + +Prints the agreement status. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------ | +| `agreementId` | `string` | Agreement ID. | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[printAgreementStatus](BaseTemplate.md#printagreementstatus) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:429](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L429) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------ | +| `params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `from` | [`Account`](Account.md) | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[process](BaseTemplate.md#process) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L110) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[send](BaseTemplate.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[sendFrom](BaseTemplate.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### service + +▸ **service**(): [`ServiceType`](../code-reference.md#servicetype) + +#### Returns + +[`ServiceType`](../code-reference.md#servicetype) + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[service](BaseTemplate.md#service) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L28) + +--- + +### serviceEndpoint + +▸ **serviceEndpoint**(): `string` + +#### Returns + +`string` + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[serviceEndpoint](BaseTemplate.md#serviceendpoint) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L32) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### standardContext + +▸ **standardContext**(`ddo`, `creator`, `serviceIndex?`): [`ConditionContext`](../interfaces/ConditionContext.md) + +#### Parameters + +| Name | Type | +| :-------------- | :-------------- | +| `ddo` | [`DDO`](DDO.md) | +| `creator` | `string` | +| `serviceIndex?` | `number` | + +#### Returns + +[`ConditionContext`](../interfaces/ConditionContext.md) + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[standardContext](BaseTemplate.md#standardcontext) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L200) + +--- + +### track + +▸ **track**(`_params`, `_from`, `_txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `_params` | [`ValidationParams`](../interfaces/ValidationParams.md) | +| `_from` | [`Account`](Account.md) | +| `_txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[track](BaseTemplate.md#track) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:102](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L102) + +--- + +### validateAgreement + +▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `agreement_id` | `string` | +| `did` | `string` | +| `params` | `NFTSalesTemplateParams` | +| `from` | [`Account`](Account.md) | +| `extra` | `any` | +| `txparams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[validateAgreement](BaseTemplate.md#validateagreement) + +#### Defined in + +[src/keeper/contracts/templates/BaseTemplate.abstract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`NFTSalesTemplate`](NFTSalesTemplate.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`NFTSalesTemplate`](NFTSalesTemplate.md)\> + +#### Overrides + +[BaseTemplate](BaseTemplate.md).[getInstance](BaseTemplate.md#getinstance) + +#### Defined in + +[src/keeper/contracts/templates/NFTSalesTemplate.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/NFTSalesTemplate.ts#L24) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[BaseTemplate](BaseTemplate.md).[setInstanceConfig](BaseTemplate.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NFTServiceAttributes.md b/docs/api-reference/classes/NFTServiceAttributes.md new file mode 100644 index 000000000..9d08be67b --- /dev/null +++ b/docs/api-reference/classes/NFTServiceAttributes.md @@ -0,0 +1,124 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTServiceAttributes + +# Class: NFTServiceAttributes + +## Table of contents + +### Constructors + +- [constructor](NFTServiceAttributes.md#constructor) + +### Properties + +- [amount](NFTServiceAttributes.md#amount) +- [duration](NFTServiceAttributes.md#duration) +- [isSubscription](NFTServiceAttributes.md#issubscription) +- [nftTransfer](NFTServiceAttributes.md#nfttransfer) +- [tokenId](NFTServiceAttributes.md#tokenid) +- [defaultValues](NFTServiceAttributes.md#defaultvalues) + +### Methods + +- [getDefaultNFTServiceAttributes](NFTServiceAttributes.md#getdefaultnftserviceattributes) + +## Constructors + +### constructor + +• **new NFTServiceAttributes**() + +## Properties + +### amount + +• `Optional` **amount**: `bigint` + +Number of editions + +#### Defined in + +[src/models/NFTAttributes.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L25) + +--- + +### duration + +• `Optional` **duration**: `number` + +If is a subscription this means the number of blocks the subscription last. If 0 means unlimited + +#### Defined in + +[src/models/NFTAttributes.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L20) + +--- + +### isSubscription + +• `Optional` **isSubscription**: `boolean` + +If true means the NFT works as a subscription + +#### Defined in + +[src/models/NFTAttributes.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L15) + +--- + +### nftTransfer + +• `Optional` **nftTransfer**: `boolean` + +The asset is transferred (true) or minted (false) with Nevermined contracts + +#### Defined in + +[src/models/NFTAttributes.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L10) + +--- + +### tokenId + +• `Optional` **tokenId**: `string` + +The tokenId of the NFT related with the Service. +For example if is a NFT Access service requiring holding a NFT, this is the tokenId of the NFT + +#### Defined in + +[src/models/NFTAttributes.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L31) + +--- + +### defaultValues + +▪ `Static` **defaultValues**: `Object` + +#### Type declaration + +| Name | Type | +| :--------------- | :------------------------------------------------ | +| `amount` | `bigint` | +| `duration` | `number` | +| `isSubscription` | `boolean` | +| `nftTransfer` | `boolean` | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | +| `tokenId` | `string` | + +#### Defined in + +[src/models/NFTAttributes.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L33) + +## Methods + +### getDefaultNFTServiceAttributes + +▸ `Static` **getDefaultNFTServiceAttributes**(): `Required`<[`NFTServiceAttributes`](NFTServiceAttributes.md)\> + +#### Returns + +`Required`<[`NFTServiceAttributes`](NFTServiceAttributes.md)\> + +#### Defined in + +[src/models/NFTAttributes.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NFTAttributes.ts#L42) diff --git a/docs/api-reference/classes/NFTsBaseApi.md b/docs/api-reference/classes/NFTsBaseApi.md new file mode 100644 index 000000000..39fd16101 --- /dev/null +++ b/docs/api-reference/classes/NFTsBaseApi.md @@ -0,0 +1,881 @@ +[@nevermined-io/sdk](../code-reference.md) / NFTsBaseApi + +# Class: NFTsBaseApi + +Abstract class providing common NFT methods for different ERC implementations. + +## Hierarchy + +- [`RegistryBaseApi`](RegistryBaseApi.md) + + ↳ **`NFTsBaseApi`** + + ↳↳ [`NFT721Api`](NFT721Api.md) + + ↳↳ [`NFT1155Api`](NFT1155Api.md) + +## Table of contents + +### Constructors + +- [constructor](NFTsBaseApi.md#constructor) + +### Properties + +- [servicePlugin](NFTsBaseApi.md#serviceplugin) + +### Accessors + +- [artifactsFolder](NFTsBaseApi.md#artifactsfolder) +- [circuitsFolder](NFTsBaseApi.md#circuitsfolder) +- [config](NFTsBaseApi.md#config) +- [instanceConfig](NFTsBaseApi.md#instanceconfig) +- [instantiableConfig](NFTsBaseApi.md#instantiableconfig) +- [logger](NFTsBaseApi.md#logger) +- [nevermined](NFTsBaseApi.md#nevermined) +- [web3](NFTsBaseApi.md#web3) + +### Methods + +- [\_details](NFTsBaseApi.md#_details) +- [access](NFTsBaseApi.md#access) +- [addRating](NFTsBaseApi.md#addrating) +- [buySecondaryMarketNft](NFTsBaseApi.md#buysecondarymarketnft) +- [claimNFT](NFTsBaseApi.md#claimnft) +- [getSubscriptionToken](NFTsBaseApi.md#getsubscriptiontoken) +- [isOperator](NFTsBaseApi.md#isoperator) +- [isOperatorOfDID](NFTsBaseApi.md#isoperatorofdid) +- [list](NFTsBaseApi.md#list) +- [listOnSecondaryMarkets](NFTsBaseApi.md#listonsecondarymarkets) +- [orderAsset](NFTsBaseApi.md#orderasset) +- [registerNeverminedAsset](NFTsBaseApi.md#registerneverminedasset) +- [resolveAsset](NFTsBaseApi.md#resolveasset) +- [setInstanceConfig](NFTsBaseApi.md#setinstanceconfig) +- [updateAsset](NFTsBaseApi.md#updateasset) +- [getInstance](NFTsBaseApi.md#getinstance) +- [getNFTContractAddress](NFTsBaseApi.md#getnftcontractaddress) +- [getServicePlugin](NFTsBaseApi.md#getserviceplugin) +- [setInstanceConfig](NFTsBaseApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NFTsBaseApi**() + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[constructor](RegistryBaseApi.md#constructor) + +## Properties + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[servicePlugin](RegistryBaseApi.md#serviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RegistryBaseApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RegistryBaseApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +RegistryBaseApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RegistryBaseApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RegistryBaseApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +RegistryBaseApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +RegistryBaseApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +RegistryBaseApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_details + +▸ `Protected` **\_details**(`did`, `ercType`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `ercType` | [`ERCType`](../enums/ERCType.md) | The type of NFT used | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L150) + +--- + +### access + +▸ **access**(`did`, `consumer`, `destination?`, `fileIndex?`, `agreementId?`, `buyer?`, `babysig?`, `serviceReference?`): `Promise`<`boolean`\> + +Access the files associated with an NFT. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `consumer` | [`Account`](Account.md) | `undefined` | The NFT holder account. | +| `destination?` | `string` | `undefined` | The download destination for the files. | +| `fileIndex?` | `number` | `undefined` | The index of the file. If unset will download all the files in the asset. | +| `agreementId` | `string` | `'0x'` | The NFT sales agreement id. | +| `buyer?` | `string` | `undefined` | Key which represent the buyer | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | - | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service reference to use. By default is nft-access. | + +#### Returns + +`Promise`<`boolean`\> + +true if the access was successful or file if isToDownload is false. + +**`Remarks`** + +This function will call the Node that will check if all the access conditions where fulfilled +before providing the files. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.access(ddo.id, collector, '/tmp/') +``` + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:419](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L419) + +--- + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[addRating](RegistryBaseApi.md#addrating) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### buySecondaryMarketNft + +▸ **buySecondaryMarketNft**(`consumer`, `nftAmount?`, `agreementIdSeed`, `conditionsTimeout?`, `txParams?`): `Promise`<`boolean`\> + +Buys a number of listed NFTs on secondary markets. + +#### Parameters + +| Name | Type | Description | +| :------------------ | :---------------------------------------------- | :----------------------------------------- | +| `consumer` | [`Account`](Account.md) | The account of the buyer/consumer. | +| `nftAmount` | `bigint` | The number of assets to buy. 1 by default. | +| `agreementIdSeed` | `string` | - | +| `conditionsTimeout` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`boolean`\> + +true if the buy was successful. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.buySecondaryMarketNft(collector, 1n, agreementId) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error buying the NFT. + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:341](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L341) + +--- + +### claimNFT + +▸ `Protected` **claimNFT**(`agreementId`, `nftHolder`, `nftReceiver`, `numberEditions?`, `ercType?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------- | :------------------------------- | :------------ | :--------------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `nftHolder` | `string` | `undefined` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | `undefined` | The address where the NFT should be transferred. | +| `numberEditions` | `bigint` | `undefined` | The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The Type of the NFT ERC (1155 or 721). | +| `did?` | `string` | `undefined` | The DID of the asset. | +| `serviceIndex?` | `number` | `undefined` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim( + agreementId, + editor.getId(), + subscriber.getId(), + nftAmount, + 721, +) +``` + +**`Throws`** + +[NFTError](NFTError.md) if Nevermined is not an operator for this NFT + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L50) + +--- + +### getSubscriptionToken + +▸ **getSubscriptionToken**(`did`, `account`): `Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +Get a JWT token for an asset associated with a webService + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------- | :----------------------------------------------------------------------------- | +| `did` | `string` | The did of the asset with a webService resource and an associated subscription | +| `account` | [`Account`](Account.md) | Account of the user requesting the token | + +#### Returns + +`Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +[SubscriptionToken](../interfaces/SubscriptionToken.md) + +**`Example`** + +```ts +const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) + +assert.isDefined(response.accessToken) +assert.isDefined(response.neverminedProxyUri) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:478](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L478) + +--- + +### isOperator + +▸ **isOperator**(`nftContractAddress`, `operatorAddress`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of given a NFT address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------- | :------------------------------- | :------------ | :-------------------------------------- | +| `nftContractAddress` | `string` | `undefined` | The DID of the NFT to check | +| `operatorAddress` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L116) + +--- + +### isOperatorOfDID + +▸ **isOperatorOfDID**(`did`, `address`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of a DID. + +#### Parameters + +| Name | Type | Default value | Description | +| :-------- | :------------------------------- | :------------ | :-------------------------------------- | +| `did` | `string` | `undefined` | The DID of the NFT to check | +| `address` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:91](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L91) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[list](RegistryBaseApi.md#list) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### listOnSecondaryMarkets + +▸ **listOnSecondaryMarkets**(`ddo`, `assetPrice`, `nftAmount`, `nftTransfer`, `provider`, `token`, `owner`): `Promise`<`string`\> + +After purchase re-list an NFT to enable secondary market sales. + +#### Parameters + +| Name | Type | Description | +| :------------ | :---------------------------- | :----------------------------------------------------------- | +| `ddo` | [`DDO`](DDO.md) | The DDO of the asset. | +| `assetPrice` | [`AssetPrice`](AssetPrice.md) | The current setup of asset rewards. | +| `nftAmount` | `bigint` | The number of NFTs put up for secondary sale. | +| `nftTransfer` | `boolean` | - | +| `provider` | `string` | The address that will be the provider of the secondary sale. | +| `token` | [`Token`](Token.md) | - | +| `owner` | [`Account`](Account.md) | The account of the current owner. | + +#### Returns + +`Promise`<`string`\> + +the agreementId of the secondary sale. + +**`Example`** + +```ts +const agreementId = await nevermined.nfts1155.listOnSecondaryMarkets( + ddo, + assetPrice, + numberNFTs, + collector.getId(), + token, + collector.getId(), +) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error listing the NFT. + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:260](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L260) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[orderAsset](RegistryBaseApi.md#orderasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[registerNeverminedAsset](RegistryBaseApi.md#registerneverminedasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[resolveAsset](RegistryBaseApi.md#resolveasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[setInstanceConfig](RegistryBaseApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[updateAsset](RegistryBaseApi.md#updateasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[getInstance](RegistryBaseApi.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### getNFTContractAddress + +▸ `Static` **getNFTContractAddress**(`ddo`, `serviceReference?`): `any` + +Gets the NFT contract address associated with a Nevermined asset from the DDO. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------ | +| `ddo` | [`DDO`](DDO.md) | `undefined` | The DDO of the asset. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service type to look for the contract address | + +#### Returns + +`any` + +The NFT contract address. + +**`Example`** + +```ts +const nftContractAddress = NFT1155Api.getNFTContractAddress(ddo) +``` + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:219](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L219) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[getServicePlugin](RegistryBaseApi.md#getserviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RegistryBaseApi](RegistryBaseApi.md).[setInstanceConfig](RegistryBaseApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Nevermined.md b/docs/api-reference/classes/Nevermined.md index 74e40ca8c..89cb28caa 100644 --- a/docs/api-reference/classes/Nevermined.md +++ b/docs/api-reference/classes/Nevermined.md @@ -6,7 +6,7 @@ Main interface for Nevermined Protocol. ## Hierarchy -- `Instantiable` +- [`Instantiable`](Instantiable.md) ↳ **`Nevermined`** @@ -18,31 +18,24 @@ Main interface for Nevermined Protocol. ### Properties -- [aaveCredit](Nevermined.md#aavecredit) - [accounts](Nevermined.md#accounts) - [agreements](Nevermined.md#agreements) - [assets](Nevermined.md#assets) -- [auth](Nevermined.md#auth) -- [bookmarks](Nevermined.md#bookmarks) +- [compute](Nevermined.md#compute) - [contracts](Nevermined.md#contracts) -- [faucet](Nevermined.md#faucet) -- [files](Nevermined.md#files) -- [gateway](Nevermined.md#gateway) +- [isKeeperConnected](Nevermined.md#iskeeperconnected) - [keeper](Nevermined.md#keeper) -- [marketplace](Nevermined.md#marketplace) -- [metadata](Nevermined.md#metadata) -- [nfts](Nevermined.md#nfts) -- [permissions](Nevermined.md#permissions) -- [profiles](Nevermined.md#profiles) +- [nfts1155](Nevermined.md#nfts1155) +- [nfts721](Nevermined.md#nfts721) - [provenance](Nevermined.md#provenance) -- [provider](Nevermined.md#provider) -- [token](Nevermined.md#token) +- [search](Nevermined.md#search) +- [services](Nevermined.md#services) - [utils](Nevermined.md#utils) -- [versions](Nevermined.md#versions) ### Accessors - [artifactsFolder](Nevermined.md#artifactsfolder) +- [circuitsFolder](Nevermined.md#circuitsfolder) - [config](Nevermined.md#config) - [instanceConfig](Nevermined.md#instanceconfig) - [instantiableConfig](Nevermined.md#instantiableconfig) @@ -52,12 +45,7 @@ Main interface for Nevermined Protocol. ### Methods -- [addresses](Nevermined.md#addresses) -- [checkExists](Nevermined.md#checkexists) -- [findSigner](Nevermined.md#findsigner) - [setInstanceConfig](Nevermined.md#setinstanceconfig) -- [addressesStatic](Nevermined.md#addressesstatic) -- [findSignerStatic](Nevermined.md#findsignerstatic) - [getInstance](Nevermined.md#getinstance) - [setInstanceConfig](Nevermined.md#setinstanceconfig-1) @@ -69,83 +57,59 @@ Main interface for Nevermined Protocol. #### Overrides -Instantiable.constructor +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) #### Defined in -[src/nevermined.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L213) +[src/nevermined/Nevermined.ts:211](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L211) ## Properties -### aaveCredit - -• **aaveCredit**: `AaveCredit` - -AaveCredit allows taking loans from Aave protocol using NFT tokens as collateral. - -#### Defined in - -[src/nevermined.ts:196](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L196) - ---- - ### accounts -• **accounts**: [`Accounts`](Accounts.md) +• **accounts**: [`AccountsApi`](AccountsApi.md) Accounts submodule #### Defined in -[src/nevermined.ts:156](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L156) +[src/nevermined/Nevermined.ts:159](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L159) --- ### agreements -• **agreements**: `Agreements` +• **agreements**: [`AgreementsApi`](AgreementsApi.md) Agreements submodule #### Defined in -[src/nevermined.ts:181](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L181) +[src/nevermined/Nevermined.ts:164](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L164) --- ### assets -• **assets**: `Assets` +• **assets**: [`AssetsApi`](AssetsApi.md) -Assets submodule +Assets API #### Defined in -[src/nevermined.ts:166](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L166) +[src/nevermined/Nevermined.ts:169](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L169) --- -### auth +### compute -• **auth**: `Auth` +• **compute**: [`ComputeApi`](ComputeApi.md) -Auth submodule +Compute API #### Defined in -[src/nevermined.ts:161](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L161) - ---- - -### bookmarks - -• **bookmarks**: `Bookmarks` - -Bookmarks instance - -#### Defined in - -[src/nevermined.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L141) +[src/nevermined/Nevermined.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L174) --- @@ -153,54 +117,35 @@ Bookmarks instance • **contracts**: `Object` -Nevermind very own contract reflector. +Nevermined very own contract reflector. #### Type declaration -| Name | Type | -| :----------- | :--------------------------------------------------------- | -| `loadErc20` | (`address`: `string`) => `Promise`<`default`\> | -| `loadNft721` | (`address`: `string`) => `Promise`<[`Nft721`](Nft721.md)\> | +| Name | Type | +| :-------------------- | :---------------------------------------------------------------------------------- | +| `loadErc20` | (`address`: `string`) => `Promise`<[`CustomToken`](CustomToken.md)\> | +| `loadNft1155` | (`address`: `string`) => `Promise`<[`NFT1155Api`](NFT1155Api.md)\> | +| `loadNft1155Api` | (`api`: [`NFT1155Api`](NFT1155Api.md)) => `Promise`<[`NFT1155Api`](NFT1155Api.md)\> | +| `loadNft1155Contract` | (`address`: `string`) => `Promise`<[`Nft1155Contract`](Nft1155Contract.md)\> | +| `loadNft721` | (`address`: `string`) => `Promise`<[`NFT721Api`](NFT721Api.md)\> | +| `loadNft721Api` | (`api`: [`NFT721Api`](NFT721Api.md)) => `Promise`<[`NFT721Api`](NFT721Api.md)\> | +| `loadNft721Contract` | (`address`: `string`) => `Promise`<[`Nft721Contract`](Nft721Contract.md)\> | #### Defined in -[src/nevermined.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L97) +[src/nevermined/Nevermined.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L74) --- -### faucet +### isKeeperConnected -• **faucet**: `Faucet` +• **isKeeperConnected**: `boolean` -Metadata instance. +If keeper is connected #### Defined in -[src/nevermined.ts:151](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L151) - ---- - -### files - -• **files**: `Files` - -Files submodule - -#### Defined in - -[src/nevermined.ts:176](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L176) - ---- - -### gateway - -• **gateway**: `Gateway` - -Gateway instance. - -#### Defined in - -[src/nevermined.ts:121](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L121) +[src/nevermined/Nevermined.ts:209](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L209) --- @@ -212,133 +157,103 @@ Keeper instance. #### Defined in -[src/nevermined.ts:92](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L92) - ---- - -### marketplace - -• **marketplace**: `MarketplaceApi` - -Marketplace instance. - -#### Defined in - -[src/nevermined.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L131) +[src/nevermined/Nevermined.ts:154](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L154) --- -### metadata +### nfts1155 -• **metadata**: `Metadata` +• **nfts1155**: [`NFT1155Api`](NFT1155Api.md) -Metadata instance. +ERC-1155 Nfts API #### Defined in -[src/nevermined.ts:126](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L126) +[src/nevermined/Nevermined.ts:179](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L179) --- -### nfts +### nfts721 -• **nfts**: [`Nfts`](Nfts.md) +• **nfts721**: [`NFT721Api`](NFT721Api.md) -Nfts submodule +ERC-721 Nfts API #### Defined in -[src/nevermined.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L171) - ---- - -### permissions - -• **permissions**: `Permissions` - -Permissions instance - -#### Defined in - -[src/nevermined.ts:146](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L146) - ---- - -### profiles - -• **profiles**: `Profiles` - -Profiles instance - -#### Defined in - -[src/nevermined.ts:136](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L136) +[src/nevermined/Nevermined.ts:184](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L184) --- ### provenance -• **provenance**: `Provenance` +• **provenance**: [`ProvenanceApi`](ProvenanceApi.md) Provenance submodule #### Defined in -[src/nevermined.ts:206](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L206) +[src/nevermined/Nevermined.ts:189](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L189) --- -### provider +### search -• **provider**: `Provider` +• **search**: [`SearchApi`](SearchApi.md) -Nevermined probiders submodule +SearchApi API #### Defined in -[src/nevermined.ts:186](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L186) +[src/nevermined/Nevermined.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L194) --- -### token +### services -• **token**: `Token` +• **services**: [`ServicesApi`](ServicesApi.md) -Nevermined tokens submodule +SearchApi API #### Defined in -[src/nevermined.ts:191](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L191) +[src/nevermined/Nevermined.ts:199](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L199) --- ### utils -• **utils**: `Utils` +• **utils**: [`UtilsApi`](UtilsApi.md) Utils submodule #### Defined in -[src/nevermined.ts:211](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L211) +[src/nevermined/Nevermined.ts:204](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L204) ---- +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` -### versions +#### Returns -• **versions**: `Versions` +`string` + +#### Inherited from -Versions submodule +Instantiable.artifactsFolder #### Defined in -[src/nevermined.ts:201](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L201) +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) -## Accessors +--- -### artifactsFolder +### circuitsFolder -• `Protected` `get` **artifactsFolder**(): `string` +• `Protected` `get` **circuitsFolder**(): `string` #### Returns @@ -346,21 +261,21 @@ Versions submodule #### Inherited from -Instantiable.artifactsFolder +Instantiable.circuitsFolder #### Defined in -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) --- ### config -• `Protected` `get` **config**(): [`Config`](Config.md) +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) #### Returns -[`Config`](Config.md) +[`NeverminedOptions`](NeverminedOptions.md) #### Inherited from @@ -368,17 +283,17 @@ Instantiable.config #### Defined in -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) --- ### instanceConfig -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -386,17 +301,17 @@ Instantiable.instanceConfig #### Defined in -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) --- ### instantiableConfig -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Returns -`InstantiableConfig` +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) #### Inherited from @@ -404,17 +319,17 @@ Instantiable.instantiableConfig #### Defined in -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) --- ### logger -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) +• `Protected` `get` **logger**(): `Logger` #### Returns -[`Logger`](utils.Logger.md) +`Logger` #### Inherited from @@ -422,7 +337,7 @@ Instantiable.logger #### Defined in -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) --- @@ -440,17 +355,17 @@ Instantiable.nevermined #### Defined in -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) --- ### web3 -• `Protected` `get` **web3**(): `JsonRpcProvider` +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` #### Returns -`JsonRpcProvider` +`JsonRpcProvider` \| `BrowserProvider` #### Inherited from @@ -458,89 +373,19 @@ Instantiable.web3 #### Defined in -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) ## Methods -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -Instantiable.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - ### setInstanceConfig ▸ `Protected` **setInstanceConfig**(`config`): `void` #### Parameters -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -548,99 +393,48 @@ Instantiable.findSigner #### Inherited from -Instantiable.setInstanceConfig +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) #### Defined in -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) --- -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- +### getInstance -### findSignerStatic +▸ `Static` **getInstance**(`config`): `Promise`<[`Nevermined`](Nevermined.md)\> -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> +Returns the instance of Nevermined. #### Parameters -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | +| Name | Type | Description | +| :------- | :------------------------------------------ | :--------------------------------- | +| `config` | [`NeverminedOptions`](NeverminedOptions.md) | Nevermined instance configuration. | #### Returns -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSignerStatic - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`Nevermined`](Nevermined.md)\> +`Promise`<[`Nevermined`](Nevermined.md)\> -Returns the instance of Nevermined. +A [Nevermined](Nevermined.md) instance **`Example`** ```ts -import { Nevermined, Config } from '@nevermined-io/nevermied-sdk-js' +import { Nevermined, Config } from '@nevermined-io/sdk' const config: Config = {...} const nevermined = await Nevermined.getInstance(config) ``` -#### Parameters - -| Name | Type | Description | -| :------- | :-------------------- | :--------------------------------- | -| `config` | [`Config`](Config.md) | Nevermined instance configuration. | - -#### Returns - -`Promise`<[`Nevermined`](Nevermined.md)\> - -A [Nevermined](Nevermined.md) instance - #### Overrides -Instantiable.getInstance +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) #### Defined in -[src/nevermined.ts:51](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined.ts#L51) +[src/nevermined/Nevermined.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Nevermined.ts#L34) --- @@ -650,16 +444,16 @@ Instantiable.getInstance #### Type parameters -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | #### Parameters -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | #### Returns @@ -667,8 +461,8 @@ Instantiable.getInstance #### Inherited from -Instantiable.setInstanceConfig +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) #### Defined in -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NeverminedEvent.md b/docs/api-reference/classes/NeverminedEvent.md new file mode 100644 index 000000000..23b237b9c --- /dev/null +++ b/docs/api-reference/classes/NeverminedEvent.md @@ -0,0 +1,412 @@ +[@nevermined-io/sdk](../code-reference.md) / NeverminedEvent + +# Class: NeverminedEvent + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`NeverminedEvent`** + + ↳↳ [`ContractEvent`](ContractEvent.md) + + ↳↳ [`SubgraphEvent`](SubgraphEvent.md) + +## Table of contents + +### Constructors + +- [constructor](NeverminedEvent.md#constructor) + +### Properties + +- [contract](NeverminedEvent.md#contract) +- [eventEmitter](NeverminedEvent.md#eventemitter) + +### Accessors + +- [artifactsFolder](NeverminedEvent.md#artifactsfolder) +- [circuitsFolder](NeverminedEvent.md#circuitsfolder) +- [config](NeverminedEvent.md#config) +- [instanceConfig](NeverminedEvent.md#instanceconfig) +- [instantiableConfig](NeverminedEvent.md#instantiableconfig) +- [logger](NeverminedEvent.md#logger) +- [nevermined](NeverminedEvent.md#nevermined) +- [web3](NeverminedEvent.md#web3) + +### Methods + +- [getBlockNumber](NeverminedEvent.md#getblocknumber) +- [getEventData](NeverminedEvent.md#geteventdata) +- [getPastEvents](NeverminedEvent.md#getpastevents) +- [once](NeverminedEvent.md#once) +- [setInstanceConfig](NeverminedEvent.md#setinstanceconfig) +- [subscribe](NeverminedEvent.md#subscribe) +- [getInstance](NeverminedEvent.md#getinstance) +- [setInstanceConfig](NeverminedEvent.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new NeverminedEvent**(`contract`, `eventEmitter`) + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `contract` | [`ContractBase`](ContractBase.md) | +| `eventEmitter` | [`EventEmitter`](../interfaces/EventEmitter.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/events/NeverminedEvent.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L34) + +## Properties + +### contract + +• `Protected` **contract**: [`ContractBase`](ContractBase.md) = `null` + +#### Defined in + +[src/events/NeverminedEvent.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L29) + +--- + +### eventEmitter + +• `Protected` **eventEmitter**: [`EventEmitter`](../interfaces/EventEmitter.md) + +#### Defined in + +[src/events/NeverminedEvent.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L28) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### getBlockNumber + +▸ `Abstract` **getBlockNumber**(`...args`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/events/NeverminedEvent.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L32) + +--- + +### getEventData + +▸ `Abstract` **getEventData**(`options`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Defined in + +[src/events/NeverminedEvent.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L30) + +--- + +### getPastEvents + +▸ `Abstract` **getPastEvents**(`options`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Defined in + +[src/events/NeverminedEvent.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L31) + +--- + +### once + +▸ **once**(`callback?`, `options?`): `Promise`<[`EventResult`](../code-reference.md#eventresult)\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------------------------ | +| `callback?` | (`events`: [`EventResult`](../code-reference.md#eventresult)[]) => `void` | +| `options?` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +`Promise`<[`EventResult`](../code-reference.md#eventresult)\> + +#### Defined in + +[src/events/NeverminedEvent.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L54) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### subscribe + +▸ **subscribe**(`callback`, `options`): [`ContractEventSubscription`](../interfaces/ContractEventSubscription.md) + +#### Parameters + +| Name | Type | +| :--------- | :------------------------------------------------------------------------ | +| `callback` | (`events`: [`EventResult`](../code-reference.md#eventresult)[]) => `void` | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`ContractEventSubscription`](../interfaces/ContractEventSubscription.md) + +#### Defined in + +[src/events/NeverminedEvent.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L40) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NeverminedNode.md b/docs/api-reference/classes/NeverminedNode.md new file mode 100644 index 000000000..e3600374b --- /dev/null +++ b/docs/api-reference/classes/NeverminedNode.md @@ -0,0 +1,986 @@ +[@nevermined-io/sdk](../code-reference.md) / NeverminedNode + +# Class: NeverminedNode + +Provides a interface with Nevermined Node. +The Nevermined Node is the technical component executed by the Publishers allowing to them to provide extended data services. + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`NeverminedNode`** + +## Table of contents + +### Constructors + +- [constructor](NeverminedNode.md#constructor) + +### Accessors + +- [artifactsFolder](NeverminedNode.md#artifactsfolder) +- [circuitsFolder](NeverminedNode.md#circuitsfolder) +- [config](NeverminedNode.md#config) +- [instanceConfig](NeverminedNode.md#instanceconfig) +- [instantiableConfig](NeverminedNode.md#instantiableconfig) +- [logger](NeverminedNode.md#logger) +- [nevermined](NeverminedNode.md#nevermined) +- [url](NeverminedNode.md#url) +- [web3](NeverminedNode.md#web3) + +### Methods + +- [claimNFT](NeverminedNode.md#claimnft) +- [computeLogs](NeverminedNode.md#computelogs) +- [computeStatus](NeverminedNode.md#computestatus) +- [consumeService](NeverminedNode.md#consumeservice) +- [downloadService](NeverminedNode.md#downloadservice) +- [encrypt](NeverminedNode.md#encrypt) +- [execute](NeverminedNode.md#execute) +- [fetchToken](NeverminedNode.md#fetchtoken) +- [getAccessEndpoint](NeverminedNode.md#getaccessendpoint) +- [getAccessProofEndpoint](NeverminedNode.md#getaccessproofendpoint) +- [getBabyjubPublicKey](NeverminedNode.md#getbabyjubpublickey) +- [getClaimNftEndpoint](NeverminedNode.md#getclaimnftendpoint) +- [getComputeLogsEndpoint](NeverminedNode.md#getcomputelogsendpoint) +- [getComputeStatusEndpoint](NeverminedNode.md#getcomputestatusendpoint) +- [getConsumeEndpoint](NeverminedNode.md#getconsumeendpoint) +- [getDownloadEndpoint](NeverminedNode.md#getdownloadendpoint) +- [getEcdsaPublicKey](NeverminedNode.md#getecdsapublickey) +- [getEncryptEndpoint](NeverminedNode.md#getencryptendpoint) +- [getExecuteEndpoint](NeverminedNode.md#getexecuteendpoint) +- [getFetchTokenEndpoint](NeverminedNode.md#getfetchtokenendpoint) +- [getNeverminedNodeInfo](NeverminedNode.md#getneverminednodeinfo) +- [getNft721Endpoint](NeverminedNode.md#getnft721endpoint) +- [getNftAccessEndpoint](NeverminedNode.md#getnftaccessendpoint) +- [getNftEndpoint](NeverminedNode.md#getnftendpoint) +- [getProviderAddress](NeverminedNode.md#getprovideraddress) +- [getPurchaseEndpoint](NeverminedNode.md#getpurchaseendpoint) +- [getRsaPublicKey](NeverminedNode.md#getrsapublickey) +- [getServiceEndpoint](NeverminedNode.md#getserviceendpoint) +- [getSubscriptionToken](NeverminedNode.md#getsubscriptiontoken) +- [getSubscriptionsEndpoint](NeverminedNode.md#getsubscriptionsendpoint) +- [getUploadFilecoinEndpoint](NeverminedNode.md#getuploadfilecoinendpoint) +- [getUploadIPFSEndpoint](NeverminedNode.md#getuploadipfsendpoint) +- [getUploadS3Endpoint](NeverminedNode.md#getuploads3endpoint) +- [getVersionInfo](NeverminedNode.md#getversioninfo) +- [initializeServiceAgreement](NeverminedNode.md#initializeserviceagreement) +- [publishImmutableContent](NeverminedNode.md#publishimmutablecontent) +- [setInstanceConfig](NeverminedNode.md#setinstanceconfig) +- [uploadContent](NeverminedNode.md#uploadcontent) +- [getInstance](NeverminedNode.md#getinstance) +- [setInstanceConfig](NeverminedNode.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new NeverminedNode**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/services/node/NeverminedNode.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L38) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### url + +• `Private` `get` **url**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L34) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### claimNFT + +▸ **claimNFT**(`agreementId`, `nftHolder`, `nftReceiver`, `nftAmount`, `ercType?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Default value | +| :-------------- | :------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `nftHolder` | `string` | `undefined` | +| `nftReceiver` | `string` | `undefined` | +| `nftAmount` | `bigint` | `undefined` | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | +| `did?` | `string` | `undefined` | +| `serviceIndex?` | `number` | `undefined` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:374](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L374) + +--- + +### computeLogs + +▸ **computeLogs**(`agreementId`, `executionId`, `account`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------- | +| `agreementId` | `string` | +| `executionId` | `string` | +| `account` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:304](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L304) + +--- + +### computeStatus + +▸ **computeStatus**(`agreementId`, `executionId`, `account`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------- | +| `agreementId` | `string` | +| `executionId` | `string` | +| `account` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:339](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L339) + +--- + +### consumeService + +▸ **consumeService**(`did`, `agreementId`, `serviceEndpoint`, `account`, `files`, `destination`, `index?`, `result?`, `buyer?`, `babysig?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :------------------------------------------------------------------------ | :----------------- | +| `did` | `string` | `undefined` | +| `agreementId` | `string` | `undefined` | +| `serviceEndpoint` | `string` | `undefined` | +| `account` | [`Account`](Account.md) | `undefined` | +| `files` | [`MetaDataExternalResource`](../interfaces/MetaDataExternalResource.md)[] | `undefined` | +| `destination` | `string` | `undefined` | +| `index` | `number` | `-1` | +| `result` | [`AssetResult`](../enums/AssetResult.md) | `AssetResult.DATA` | +| `buyer?` | `string` | `undefined` | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:172](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L172) + +--- + +### downloadService + +▸ **downloadService**(`files`, `destination`, `index?`, `headers?`, `result?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------------------------------------------------------------------------ | :----------------- | +| `files` | [`MetaDataExternalResource`](../interfaces/MetaDataExternalResource.md)[] | `undefined` | +| `destination` | `string` | `undefined` | +| `index` | `number` | `-1` | +| `headers?` | `Object` | `undefined` | +| `result` | [`AssetResult`](../enums/AssetResult.md) | `AssetResult.DATA` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:239](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L239) + +--- + +### encrypt + +▸ **encrypt**(`did`, `document`, `method`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `did` | `any` | +| `document` | `any` | +| `method` | `any` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:219](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L219) + +--- + +### execute + +▸ **execute**(`agreementId`, `workflowDid`, `account`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------- | +| `agreementId` | `string` | +| `workflowDid` | `string` | +| `account` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:268](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L268) + +--- + +### fetchToken + +▸ **fetchToken**(`grantToken`, `numberTries?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------- | :------------ | +| `grantToken` | `string` | `undefined` | +| `numberTries` | `number` | `3` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:419](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L419) + +--- + +### getAccessEndpoint + +▸ **getAccessEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L55) + +--- + +### getAccessProofEndpoint + +▸ **getAccessProofEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:59](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L59) + +--- + +### getBabyjubPublicKey + +▸ **getBabyjubPublicKey**(): `Promise`<`any`\> + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:138](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L138) + +--- + +### getClaimNftEndpoint + +▸ **getClaimNftEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:111](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L111) + +--- + +### getComputeLogsEndpoint + +▸ **getComputeLogsEndpoint**(`executionId`): `string` + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `executionId` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L67) + +--- + +### getComputeStatusEndpoint + +▸ **getComputeStatusEndpoint**(`executionId`): `string` + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `executionId` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:71](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L71) + +--- + +### getConsumeEndpoint + +▸ **getConsumeEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L51) + +--- + +### getDownloadEndpoint + +▸ **getDownloadEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:143](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L143) + +--- + +### getEcdsaPublicKey + +▸ **getEcdsaPublicKey**(): `Promise`<`any`\> + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L133) + +--- + +### getEncryptEndpoint + +▸ **getEncryptEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:79](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L79) + +--- + +### getExecuteEndpoint + +▸ **getExecuteEndpoint**(`serviceAgreementId`): `string` + +#### Parameters + +| Name | Type | +| :------------------- | :------- | +| `serviceAgreementId` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L75) + +--- + +### getFetchTokenEndpoint + +▸ **getFetchTokenEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:83](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L83) + +--- + +### getNeverminedNodeInfo + +▸ **getNeverminedNodeInfo**(): `Promise`<`any`\> + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:119](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L119) + +--- + +### getNft721Endpoint + +▸ **getNft721Endpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:103](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L103) + +--- + +### getNftAccessEndpoint + +▸ **getNftAccessEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:107](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L107) + +--- + +### getNftEndpoint + +▸ **getNftEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L99) + +--- + +### getProviderAddress + +▸ **getProviderAddress**(): `Promise`<`any`\> + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:123](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L123) + +--- + +### getPurchaseEndpoint + +▸ **getPurchaseEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L47) + +--- + +### getRsaPublicKey + +▸ **getRsaPublicKey**(): `Promise`<`any`\> + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:128](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L128) + +--- + +### getServiceEndpoint + +▸ **getServiceEndpoint**(`service`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `service` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L63) + +--- + +### getSubscriptionToken + +▸ **getSubscriptionToken**(`did`, `account`): `Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------- | +| `did` | `string` | +| `account` | [`Account`](Account.md) | + +#### Returns + +`Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:489](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L489) + +--- + +### getSubscriptionsEndpoint + +▸ **getSubscriptionsEndpoint**(`did`): `string` + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L115) + +--- + +### getUploadFilecoinEndpoint + +▸ **getUploadFilecoinEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:87](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L87) + +--- + +### getUploadIPFSEndpoint + +▸ **getUploadIPFSEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:91](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L91) + +--- + +### getUploadS3Endpoint + +▸ **getUploadS3Endpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:95](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L95) + +--- + +### getVersionInfo + +▸ **getVersionInfo**(): `Promise`<`any`\> + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L43) + +--- + +### initializeServiceAgreement + +▸ **initializeServiceAgreement**(`did`, `serviceAgreementId`, `serviceIndex`, `signature`, `consumerAddress`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :------------------- | :------- | +| `did` | `string` | +| `serviceAgreementId` | `string` | +| `serviceIndex` | `number` | +| `signature` | `string` | +| `consumerAddress` | `string` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:147](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L147) + +--- + +### publishImmutableContent + +▸ **publishImmutableContent**(`ddo`, `publishMetadata?`): `Promise`<{ `backend`: [`ImmutableBackends`](../enums/ImmutableBackends.md) ; `url`: `string` }\> + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :------------------------------------------------------------- | :---------------------------- | +| `ddo` | [`DDO`](DDO.md) | `undefined` | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.IPFS` | + +#### Returns + +`Promise`<{ `backend`: [`ImmutableBackends`](../enums/ImmutableBackends.md) ; `url`: `string` }\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:434](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L434) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### uploadContent + +▸ **uploadContent**(`data`, `encrypt?`, `backend?`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :----------------------------------------------------- | :---------------------------- | +| `data` | `string` \| `ReadStream` | `undefined` | +| `encrypt?` | `boolean` | `undefined` | +| `backend` | [`NodeUploadBackends`](../enums/NodeUploadBackends.md) | `NodeUploadBackends.Filecoin` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/services/node/NeverminedNode.ts:461](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L461) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/NeverminedNodeError.md b/docs/api-reference/classes/NeverminedNodeError.md new file mode 100644 index 000000000..f5244ce5c --- /dev/null +++ b/docs/api-reference/classes/NeverminedNodeError.md @@ -0,0 +1,165 @@ +[@nevermined-io/sdk](../code-reference.md) / NeverminedNodeError + +# Class: NeverminedNodeError + +## Hierarchy + +- `Error` + + ↳ **`NeverminedNodeError`** + +## Table of contents + +### Constructors + +- [constructor](NeverminedNodeError.md#constructor) + +### Properties + +- [message](NeverminedNodeError.md#message) +- [name](NeverminedNodeError.md#name) +- [stack](NeverminedNodeError.md#stack) +- [prepareStackTrace](NeverminedNodeError.md#preparestacktrace) +- [stackTraceLimit](NeverminedNodeError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](NeverminedNodeError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new NeverminedNodeError**(`message`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/NeverminedNodeError.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/NeverminedNodeError.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/NeverminedOptions.md b/docs/api-reference/classes/NeverminedOptions.md new file mode 100644 index 000000000..bc837a27e --- /dev/null +++ b/docs/api-reference/classes/NeverminedOptions.md @@ -0,0 +1,250 @@ +[@nevermined-io/sdk](../code-reference.md) / NeverminedOptions + +# Class: NeverminedOptions + +## Table of contents + +### Constructors + +- [constructor](NeverminedOptions.md#constructor) + +### Properties + +- [aaveConfig](NeverminedOptions.md#aaveconfig) +- [accounts](NeverminedOptions.md#accounts) +- [artifactsFolder](NeverminedOptions.md#artifactsfolder) +- [circuitsFolder](NeverminedOptions.md#circuitsfolder) +- [gasMultiplier](NeverminedOptions.md#gasmultiplier) +- [gasStationUri](NeverminedOptions.md#gasstationuri) +- [graphHttpUri](NeverminedOptions.md#graphhttpuri) +- [ipfsGateway](NeverminedOptions.md#ipfsgateway) +- [ipfsProjectId](NeverminedOptions.md#ipfsprojectid) +- [ipfsProjectSecret](NeverminedOptions.md#ipfsprojectsecret) +- [marketplaceAuthToken](NeverminedOptions.md#marketplaceauthtoken) +- [marketplaceUri](NeverminedOptions.md#marketplaceuri) +- [neverminedNodeAddress](NeverminedOptions.md#neverminednodeaddress) +- [neverminedNodeUri](NeverminedOptions.md#neverminednodeuri) +- [verbose](NeverminedOptions.md#verbose) +- [web3Provider](NeverminedOptions.md#web3provider) +- [web3ProviderUri](NeverminedOptions.md#web3provideruri) + +## Constructors + +### constructor + +• **new NeverminedOptions**() + +## Properties + +### aaveConfig + +• `Optional` **aaveConfig**: [`AaveConfig`](../interfaces/AaveConfig.md) + +#### Defined in + +[src/models/NeverminedOptions.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L58) + +--- + +### accounts + +• `Optional` **accounts**: `Signer`[] + +#### Defined in + +[src/models/NeverminedOptions.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L69) + +--- + +### artifactsFolder + +• `Optional` **artifactsFolder**: `string` + +The folder where the nevermined contract artifacts are located. + +#### Defined in + +[src/models/NeverminedOptions.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L63) + +--- + +### circuitsFolder + +• `Optional` **circuitsFolder**: `string` + +The folder where the nevermined contract circuits are located. + +#### Defined in + +[src/models/NeverminedOptions.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L67) + +--- + +### gasMultiplier + +• `Optional` **gasMultiplier**: `number` + +Gas multiplier for the fees. +Can be used to speed up the transactions. + +#### Defined in + +[src/models/NeverminedOptions.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L51) + +--- + +### gasStationUri + +• `Optional` **gasStationUri**: `string` + +Use a gas station to calculate transaction fees + +#### Defined in + +[src/models/NeverminedOptions.ts:85](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L85) + +--- + +### graphHttpUri + +• `Optional` **graphHttpUri**: `string` + +Enpoint for the graph-node http query + +#### Defined in + +[src/models/NeverminedOptions.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L56) + +--- + +### ipfsGateway + +• `Optional` **ipfsGateway**: `string` = `'https://ipfs.io'` + +IPFS variables enable the resolution of DDOs (via `assets.resolve`) from CID urls +INFO: For performance purposes, it is recommended to setup a IPFS Infura endpoint to accelerate +the asset resolution requests. + +#### Defined in + +[src/models/NeverminedOptions.ts:76](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L76) + +--- + +### ipfsProjectId + +• `Optional` **ipfsProjectId**: `string` + +#### Defined in + +[src/models/NeverminedOptions.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L78) + +--- + +### ipfsProjectSecret + +• `Optional` **ipfsProjectSecret**: `string` + +#### Defined in + +[src/models/NeverminedOptions.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L80) + +--- + +### marketplaceAuthToken + +• `Optional` **marketplaceAuthToken**: `string` + +Marketplace auth token. + +#### Defined in + +[src/models/NeverminedOptions.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L35) + +--- + +### marketplaceUri + +• **marketplaceUri**: `string` + +URL to the MarketPlace API use to record some Nevermined assets metadata. In a Nevermined network there could be +multiple Marketplace API instances. Each of them typically records the metadata of a specific domain/vertical deployed on a Nevermined network. + +**`See`** + +https://docs.nevermined.io/docs/architecture/marketplace-api/ + +#### Defined in + +[src/models/NeverminedOptions.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L17) + +--- + +### neverminedNodeAddress + +• `Optional` **neverminedNodeAddress**: `string` + +The public address of the Nevermined Node. + +**`See`** + +[neverminedNodeUri](NeverminedOptions.md#neverminednodeuri) + +#### Defined in + +[src/models/NeverminedOptions.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L30) + +--- + +### neverminedNodeUri + +• **neverminedNodeUri**: `string` + +URL to an existing Nevermined Node. A Nevermined network can have multiple running Nodes. +Each of them facilitate the access control and the data and infrastructure interaction with web2 elements. + +**`See`** + +https://docs.nevermined.io/docs/architecture/node/ + +#### Defined in + +[src/models/NeverminedOptions.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L24) + +--- + +### verbose + +• `Optional` **verbose**: `boolean` \| [`LogLevel`](../enums/LogLevel.md) + +Log level. + +#### Defined in + +[src/models/NeverminedOptions.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L45) + +--- + +### web3Provider + +• `Optional` **web3Provider**: `any` + +Web3 Provider. + +#### Defined in + +[src/models/NeverminedOptions.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L40) + +--- + +### web3ProviderUri + +• `Optional` **web3ProviderUri**: `string` + +Ethereum Web3 Provider URL. This Url allows the SDK to connect to a blockchain. +This provider depends on the network where you want to connect (Ethereum Mainnet, Rinkeby, Polygon Matic, etc). +It's possible to use a public available provider or a private/paid one like Infura, Alchemy, etc. + +#### Defined in + +[src/models/NeverminedOptions.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/NeverminedOptions.ts#L11) diff --git a/docs/api-reference/classes/Nft1155Contract.md b/docs/api-reference/classes/Nft1155Contract.md new file mode 100644 index 000000000..a15c8ff94 --- /dev/null +++ b/docs/api-reference/classes/Nft1155Contract.md @@ -0,0 +1,1026 @@ +[@nevermined-io/sdk](../code-reference.md) / Nft1155Contract + +# Class: Nft1155Contract + +NFTs contracts DTO allowing to manage Nevermined ERC-1155 NFTs + +## Hierarchy + +- [`NFTContractsBase`](NFTContractsBase.md) + + ↳ **`Nft1155Contract`** + +## Table of contents + +### Constructors + +- [constructor](Nft1155Contract.md#constructor) + +### Properties + +- [address](Nft1155Contract.md#address) +- [contract](Nft1155Contract.md#contract) +- [contractName](Nft1155Contract.md#contractname) +- [events](Nft1155Contract.md#events) +- [version](Nft1155Contract.md#version) + +### Accessors + +- [artifactsFolder](Nft1155Contract.md#artifactsfolder) +- [circuitsFolder](Nft1155Contract.md#circuitsfolder) +- [config](Nft1155Contract.md#config) +- [instanceConfig](Nft1155Contract.md#instanceconfig) +- [instantiableConfig](Nft1155Contract.md#instantiableconfig) +- [logger](Nft1155Contract.md#logger) +- [nevermined](Nft1155Contract.md#nevermined) +- [web3](Nft1155Contract.md#web3) + +### Methods + +- [\_createClone](Nft1155Contract.md#_createclone) +- [balance](Nft1155Contract.md#balance) +- [burn](Nft1155Contract.md#burn) +- [burnFromHolder](Nft1155Contract.md#burnfromholder) +- [call](Nft1155Contract.md#call) +- [createClone](Nft1155Contract.md#createclone) +- [getFromAddress](Nft1155Contract.md#getfromaddress) +- [getInputsOfMethod](Nft1155Contract.md#getinputsofmethod) +- [getMintedEntries](Nft1155Contract.md#getmintedentries) +- [getNFTAttributes](Nft1155Contract.md#getnftattributes) +- [getSignatureOfMethod](Nft1155Contract.md#getsignatureofmethod) +- [grantOperatorRole](Nft1155Contract.md#grantoperatorrole) +- [init](Nft1155Contract.md#init) +- [isApprovedForAll](Nft1155Contract.md#isapprovedforall) +- [isOperator](Nft1155Contract.md#isoperator) +- [mint](Nft1155Contract.md#mint) +- [owner](Nft1155Contract.md#owner) +- [revokeOperatorRole](Nft1155Contract.md#revokeoperatorrole) +- [send](Nft1155Contract.md#send) +- [sendFrom](Nft1155Contract.md#sendfrom) +- [setApprovalForAll](Nft1155Contract.md#setapprovalforall) +- [setInstanceConfig](Nft1155Contract.md#setinstanceconfig) +- [transferNft](Nft1155Contract.md#transfernft) +- [uri](Nft1155Contract.md#uri) +- [getInstance](Nft1155Contract.md#getinstance) +- [getInstanceUsingABI](Nft1155Contract.md#getinstanceusingabi) +- [setInstanceConfig](Nft1155Contract.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Nft1155Contract**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[constructor](NFTContractsBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[address](NFTContractsBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[contract](NFTContractsBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[contractName](NFTContractsBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[events](NFTContractsBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[version](NFTContractsBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTContractsBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTContractsBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NFTContractsBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTContractsBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTContractsBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NFTContractsBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NFTContractsBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NFTContractsBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_createClone + +▸ `Protected` **\_createClone**(`ercType`, `name`, `symbol`, `uri`, `cap`, `operators?`, `from?`, `txParams?`): `Promise`<`any`\> + +Creates a contract clone of an existing contract instance + +#### Parameters + +| Name | Type | Default value | Description | +| :---------- | :---------------------------------------------- | :------------ | :------------------------------------------------------ | +| `ercType` | `721` \| `1155` | `undefined` | - | +| `name` | `string` | `undefined` | NFT Contract name | +| `symbol` | `string` | `undefined` | NFT Contract symbol | +| `uri` | `string` | `undefined` | NFT Contract metadata uri | +| `cap` | `bigint` | `undefined` | NFT cap (just for ERC-721) | +| `operators` | `string`[] | `[]` | Array of account addresses to be added as NFT operators | +| `from?` | [`Account`](Account.md) | `undefined` | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | - | + +#### Returns + +`Promise`<`any`\> + +Contract Receipt + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[\_createClone](NFTContractsBase.md#_createclone) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L34) + +--- + +### balance + +▸ **balance**(`address`, `did`): `Promise`<`bigint`\> + +Get an address balance for a specific NFT with id `did` + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :----------------------------------- | +| `address` | `string` | Account address to check the balance | +| `did` | `string` | The NFT id | + +#### Returns + +`Promise`<`bigint`\> + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L116) + +--- + +### burn + +▸ **burn**(`from`, `tokenId`, `amount`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It burns some editions of a NFT (ERC-1155) + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------- | +| `from` | `string` | Account address burning the NFT editions | +| `tokenId` | `string` | The NFT id to burn | +| `amount` | `bigint` | Number of editions to burn | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:171](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L171) + +--- + +### burnFromHolder + +▸ **burnFromHolder**(`holder`, `tokenId`, `amount`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It burns some editions of a NFT (ERC-1155) + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :-------------------------------------------------------------------------- | +| `holder` | `string` | Address of the account holding the NFT editions that are going to be burned | +| `tokenId` | `string` | The NFT id to burn | +| `amount` | `bigint` | Number of editions to burn | +| `from` | `string` | Account address burning the NFT editions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:185](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L185) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[call](NFTContractsBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### createClone + +▸ **createClone**(`name`, `symbol`, `uri`, `operators?`, `from?`, `txParams?`): `Promise`<`any`\> + +Creates a contract clone of an existing contract instance + +#### Parameters + +| Name | Type | Default value | Description | +| :---------- | :---------------------------------------------- | :------------ | :------------------------------------------------------ | +| `name` | `string` | `undefined` | NFT Contract name | +| `symbol` | `string` | `undefined` | NFT Contract symbol | +| `uri` | `string` | `undefined` | NFT Contract metadata uri | +| `operators` | `string`[] | `[]` | Array of account addresses to be added as NFT operators | +| `from?` | [`Account`](Account.md) | `undefined` | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | - | + +#### Returns + +`Promise`<`any`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L69) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getFromAddress](NFTContractsBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getInputsOfMethod](NFTContractsBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getMintedEntries + +▸ **getMintedEntries**(`owner`, `did?`): `Promise`<[`MintedEntry`](../interfaces/MintedEntry.md)[]\> + +It gets all the `MintedEntries` events from the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :------ | :------- | :---------------------- | +| `owner` | `string` | the user owning the NFT | +| `did?` | `string` | the tokenId of the NFT | + +#### Returns + +`Promise`<[`MintedEntry`](../interfaces/MintedEntry.md)[]\> + +An array of `MintedEntry` objects + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getMintedEntries](NFTContractsBase.md#getmintedentries) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L125) + +--- + +### getNFTAttributes + +▸ **getNFTAttributes**(`did`): `Promise`<{ `mintCap`: `bigint` ; `nftInitialized`: `boolean` ; `nftSupply`: `bigint` ; `nftURI`: `string` }\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<{ `mintCap`: `bigint` ; `nftInitialized`: `boolean` ; `nftSupply`: `bigint` ; `nftURI`: `string` }\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getNFTAttributes](NFTContractsBase.md#getnftattributes) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L82) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getSignatureOfMethod](NFTContractsBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### grantOperatorRole + +▸ **grantOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Add an address as operator in the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------- | +| `operatorAddress` | `string` | New minter address | +| `from?` | [`Account`](Account.md) | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[grantOperatorRole](NFTContractsBase.md#grantoperatorrole) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L69) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[init](NFTContractsBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### isApprovedForAll + +▸ **isApprovedForAll**(`accountAddress`, `operatorAddress`): `Promise`<`unknown`\> + +Checks if the operator is approved for an account address + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------- | :--------------- | +| `accountAddress` | `string` | Account address | +| `operatorAddress` | `string` | Operator address | + +#### Returns + +`Promise`<`unknown`\> + +Boolean + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:87](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L87) + +--- + +### isOperator + +▸ **isOperator**(`address`): `Promise`<`boolean`\> + +Checks if an account is an operator in the NFT contract + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :----------------------------------------- | +| `address` | `string` | Account address to check if is an operator | + +#### Returns + +`Promise`<`boolean`\> + +true if is an operator + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[isOperator](NFTContractsBase.md#isoperator) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L78) + +--- + +### mint + +▸ **mint**(`to`, `did`, `amount`, `from`, `data?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It mints some editions of a NFT (ERC-1155) + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :---------------------------------- | +| `to` | `string` | Account address of the NFT receiver | +| `did` | `string` | The NFT id to mint | +| `amount` | `bigint` | Number of editions to mint | +| `from` | `string` | Account address minting the NFT | +| `data?` | `string` | Data | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:151](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L151) + +--- + +### owner + +▸ **owner**(): `Promise`<`string`\> + +Gets the contract owner + +#### Returns + +`Promise`<`string`\> + +Address of the contract owner + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[owner](NFTContractsBase.md#owner) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L19) + +--- + +### revokeOperatorRole + +▸ **revokeOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Revoke an address as operator in the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------- | +| `operatorAddress` | `string` | Minter address to revoke | +| `from?` | [`Account`](Account.md) | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[revokeOperatorRole](NFTContractsBase.md#revokeoperatorrole) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L115) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[send](NFTContractsBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[sendFrom](NFTContractsBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setApprovalForAll + +▸ **setApprovalForAll**(`operatorAddress`, `approved`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Configure approval for a specific operator address + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :-------------------------------- | +| `operatorAddress` | `string` | Operator address | +| `approved` | `boolean` | Is approved | +| `from?` | [`Account`](Account.md) | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:100](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L100) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[setInstanceConfig](NFTContractsBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transferNft + +▸ **transferNft**(`did`, `to`, `amount`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It transfers a NFT + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :----------------------------------------------- | +| `did` | `string` | The NFT id | +| `to` | `string` | Account address of the NFT receiver | +| `amount` | `bigint` | Number of editions to transfer. Typically just 1 | +| `from` | `string` | Account address transferring the NFT | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:130](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L130) + +--- + +### uri + +▸ **uri**(`did`): `Promise`<`string`\> + +It returns the NFT metadata uri + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :---------- | +| `did` | `string` | The NFT id | + +#### Returns + +`Promise`<`string`\> + +The NFT metadata url + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:201](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L201) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `address?`, `contractName?`, `artifactsFolder?`): `Promise`<[`Nft1155Contract`](Nft1155Contract.md)\> + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :---------------------------------------------------------- | :----------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `address?` | `string` | `undefined` | +| `contractName` | `string` | `'NFT1155Upgradeable'` | +| `artifactsFolder` | `string` | `config.artifactsFolder` | + +#### Returns + +`Promise`<[`Nft1155Contract`](Nft1155Contract.md)\> + +#### Overrides + +[NFTContractsBase](NFTContractsBase.md).[getInstance](NFTContractsBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L14) + +--- + +### getInstanceUsingABI + +▸ `Static` **getInstanceUsingABI**(`config`, `address`, `solidityABI`): `Promise`<[`Nft1155Contract`](Nft1155Contract.md)\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | +| `address` | `string` | +| `solidityABI` | `any` | + +#### Returns + +`Promise`<[`Nft1155Contract`](Nft1155Contract.md)\> + +#### Defined in + +[src/keeper/contracts/Nft1155Contract.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft1155Contract.ts#L39) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[setInstanceConfig](NFTContractsBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Nft721.md b/docs/api-reference/classes/Nft721.md deleted file mode 100644 index 6694b3bc5..000000000 --- a/docs/api-reference/classes/Nft721.md +++ /dev/null @@ -1,542 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / Nft721 - -# Class: Nft721 - -## Hierarchy - -- `Instantiable` - - ↳ **`Nft721`** - -## Table of contents - -### Constructors - -- [constructor](Nft721.md#constructor) - -### Properties - -- [contract](Nft721.md#contract) - -### Accessors - -- [address](Nft721.md#address) -- [artifactsFolder](Nft721.md#artifactsfolder) -- [config](Nft721.md#config) -- [instanceConfig](Nft721.md#instanceconfig) -- [instantiableConfig](Nft721.md#instantiableconfig) -- [logger](Nft721.md#logger) -- [nevermined](Nft721.md#nevermined) -- [web3](Nft721.md#web3) - -### Methods - -- [addresses](Nft721.md#addresses) -- [balanceOf](Nft721.md#balanceof) -- [checkExists](Nft721.md#checkexists) -- [findSigner](Nft721.md#findsigner) -- [isApprovedForAll](Nft721.md#isapprovedforall) -- [mint](Nft721.md#mint) -- [mintWithURL](Nft721.md#mintwithurl) -- [ownerOf](Nft721.md#ownerof) -- [setApprovalForAll](Nft721.md#setapprovalforall) -- [setInstanceConfig](Nft721.md#setinstanceconfig) -- [addressesStatic](Nft721.md#addressesstatic) -- [findSignerStatic](Nft721.md#findsignerstatic) -- [getInstance](Nft721.md#getinstance) -- [setInstanceConfig](Nft721.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new Nft721**() - -#### Inherited from - -Instantiable.constructor - -## Properties - -### contract - -• **contract**: `default` - -#### Defined in - -[src/nevermined/Nft721.ts:7](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L7) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Defined in - -[src/nevermined/Nft721.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L69) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Instantiable.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -Instantiable.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -Instantiable.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -Instantiable.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -Instantiable.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### balanceOf - -▸ **balanceOf**(`owner`): `Promise`<`default`\> - -#### Parameters - -| Name | Type | -| :------ | :---------------------- | -| `owner` | [`Account`](Account.md) | - -#### Returns - -`Promise`<`default`\> - -#### Defined in - -[src/nevermined/Nft721.ts:61](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L61) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -Instantiable.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### isApprovedForAll - -▸ **isApprovedForAll**(`accountAddress`, `operatorAddress`): `Promise`<`unknown`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `accountAddress` | `string` | -| `operatorAddress` | `string` | - -#### Returns - -`Promise`<`unknown`\> - -#### Defined in - -[src/nevermined/Nft721.ts:57](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L57) - ---- - -### mint - -▸ **mint**(`did`, `publisher`, `txParams?`): `Promise`<`ContractReceipt`\> - -Mint NFTs associated with an asset. - -This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. - -#### Parameters - -| Name | Type | Description | -| :---------- | :---------------------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the NFT asset. | -| `publisher` | [`Account`](Account.md) | The account of the publisher of the NFT. | -| `txParams?` | `TxParameters` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Defined in - -[src/nevermined/Nft721.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L29) - ---- - -### mintWithURL - -▸ **mintWithURL**(`to`, `did`, `url`, `from?`, `txParams?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `to` | `string` | -| `did` | `string` | -| `url` | `string` | -| `from?` | [`Account`](Account.md) | -| `txParams?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Defined in - -[src/nevermined/Nft721.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L33) - ---- - -### ownerOf - -▸ **ownerOf**(`did`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[src/nevermined/Nft721.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L65) - ---- - -### setApprovalForAll - -▸ **setApprovalForAll**(`target`, `state`, `publisher`, `txParams?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `target` | `string` | -| `state` | `boolean` | -| `publisher` | [`Account`](Account.md) | -| `txParams?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Defined in - -[src/nevermined/Nft721.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L43) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSignerStatic - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`, `address`): `Promise`<[`Nft721`](Nft721.md)\> - -#### Parameters - -| Name | Type | -| :-------- | :------------------- | -| `config` | `InstantiableConfig` | -| `address` | `string` | - -#### Returns - -`Promise`<[`Nft721`](Nft721.md)\> - -#### Overrides - -Instantiable.getInstance - -#### Defined in - -[src/nevermined/Nft721.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nft721.ts#L9) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/Nft721Contract.md b/docs/api-reference/classes/Nft721Contract.md new file mode 100644 index 000000000..30d370a38 --- /dev/null +++ b/docs/api-reference/classes/Nft721Contract.md @@ -0,0 +1,990 @@ +[@nevermined-io/sdk](../code-reference.md) / Nft721Contract + +# Class: Nft721Contract + +## Hierarchy + +- [`NFTContractsBase`](NFTContractsBase.md) + + ↳ **`Nft721Contract`** + +## Table of contents + +### Constructors + +- [constructor](Nft721Contract.md#constructor) + +### Properties + +- [address](Nft721Contract.md#address) +- [contract](Nft721Contract.md#contract) +- [contractName](Nft721Contract.md#contractname) +- [events](Nft721Contract.md#events) +- [version](Nft721Contract.md#version) + +### Accessors + +- [artifactsFolder](Nft721Contract.md#artifactsfolder) +- [circuitsFolder](Nft721Contract.md#circuitsfolder) +- [config](Nft721Contract.md#config) +- [instanceConfig](Nft721Contract.md#instanceconfig) +- [instantiableConfig](Nft721Contract.md#instantiableconfig) +- [logger](Nft721Contract.md#logger) +- [nevermined](Nft721Contract.md#nevermined) +- [web3](Nft721Contract.md#web3) + +### Methods + +- [\_createClone](Nft721Contract.md#_createclone) +- [balanceOf](Nft721Contract.md#balanceof) +- [burn](Nft721Contract.md#burn) +- [call](Nft721Contract.md#call) +- [createClone](Nft721Contract.md#createclone) +- [getFromAddress](Nft721Contract.md#getfromaddress) +- [getInputsOfMethod](Nft721Contract.md#getinputsofmethod) +- [getMintedEntries](Nft721Contract.md#getmintedentries) +- [getNFTAttributes](Nft721Contract.md#getnftattributes) +- [getSignatureOfMethod](Nft721Contract.md#getsignatureofmethod) +- [grantOperatorRole](Nft721Contract.md#grantoperatorrole) +- [init](Nft721Contract.md#init) +- [isApprovedForAll](Nft721Contract.md#isapprovedforall) +- [isOperator](Nft721Contract.md#isoperator) +- [mint](Nft721Contract.md#mint) +- [mintWithURL](Nft721Contract.md#mintwithurl) +- [owner](Nft721Contract.md#owner) +- [ownerOf](Nft721Contract.md#ownerof) +- [revokeOperatorRole](Nft721Contract.md#revokeoperatorrole) +- [send](Nft721Contract.md#send) +- [sendFrom](Nft721Contract.md#sendfrom) +- [setApprovalForAll](Nft721Contract.md#setapprovalforall) +- [setInstanceConfig](Nft721Contract.md#setinstanceconfig) +- [tokenURI](Nft721Contract.md#tokenuri) +- [getInstance](Nft721Contract.md#getinstance) +- [getInstanceUsingABI](Nft721Contract.md#getinstanceusingabi) +- [setInstanceConfig](Nft721Contract.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Nft721Contract**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[constructor](NFTContractsBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[address](NFTContractsBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[contract](NFTContractsBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[contractName](NFTContractsBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[events](NFTContractsBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[version](NFTContractsBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTContractsBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFTContractsBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NFTContractsBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTContractsBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFTContractsBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NFTContractsBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NFTContractsBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NFTContractsBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_createClone + +▸ `Protected` **\_createClone**(`ercType`, `name`, `symbol`, `uri`, `cap`, `operators?`, `from?`, `txParams?`): `Promise`<`any`\> + +Creates a contract clone of an existing contract instance + +#### Parameters + +| Name | Type | Default value | Description | +| :---------- | :---------------------------------------------- | :------------ | :------------------------------------------------------ | +| `ercType` | `721` \| `1155` | `undefined` | - | +| `name` | `string` | `undefined` | NFT Contract name | +| `symbol` | `string` | `undefined` | NFT Contract symbol | +| `uri` | `string` | `undefined` | NFT Contract metadata uri | +| `cap` | `bigint` | `undefined` | NFT cap (just for ERC-721) | +| `operators` | `string`[] | `[]` | Array of account addresses to be added as NFT operators | +| `from?` | [`Account`](Account.md) | `undefined` | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | - | + +#### Returns + +`Promise`<`any`\> + +Contract Receipt + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[\_createClone](NFTContractsBase.md#_createclone) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L34) + +--- + +### balanceOf + +▸ **balanceOf**(`owner`): `Promise`<`bigint`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `owner` | `string` | + +#### Returns + +`Promise`<`bigint`\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:117](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L117) + +--- + +### burn + +▸ **burn**(`tokenId`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +It burns some editions of a NFT (ERC-721) + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :-------------------------------- | +| `tokenId` | `string` | The NFT id to burn | +| `from?` | [`Account`](Account.md) | The account burning the NFT | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:100](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L100) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[call](NFTContractsBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### createClone + +▸ **createClone**(`name`, `symbol`, `uri`, `cap`, `operators?`, `from?`, `txParams?`): `Promise`<`any`\> + +Creates a contract clone of an existing contract instance + +#### Parameters + +| Name | Type | Default value | Description | +| :---------- | :---------------------------------------------- | :------------ | :------------------------------------------------------ | +| `name` | `string` | `undefined` | NFT Contract name | +| `symbol` | `string` | `undefined` | NFT Contract symbol | +| `uri` | `string` | `undefined` | NFT Contract metadata uri | +| `cap` | `bigint` | `undefined` | NFT cap | +| `operators` | `string`[] | `[]` | Array of account addresses to be added as NFT operators | +| `from?` | [`Account`](Account.md) | `undefined` | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | - | + +#### Returns + +`Promise`<`any`\> + +Contract Receipt + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:66](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L66) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getFromAddress](NFTContractsBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getInputsOfMethod](NFTContractsBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getMintedEntries + +▸ **getMintedEntries**(`owner`, `did?`): `Promise`<[`MintedEntry`](../interfaces/MintedEntry.md)[]\> + +It gets all the `MintedEntries` events from the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :------ | :------- | :---------------------- | +| `owner` | `string` | the user owning the NFT | +| `did?` | `string` | the tokenId of the NFT | + +#### Returns + +`Promise`<[`MintedEntry`](../interfaces/MintedEntry.md)[]\> + +An array of `MintedEntry` objects + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getMintedEntries](NFTContractsBase.md#getmintedentries) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L125) + +--- + +### getNFTAttributes + +▸ **getNFTAttributes**(`did`): `Promise`<{ `mintCap`: `bigint` ; `nftInitialized`: `boolean` ; `nftSupply`: `bigint` ; `nftURI`: `string` }\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<{ `mintCap`: `bigint` ; `nftInitialized`: `boolean` ; `nftSupply`: `bigint` ; `nftURI`: `string` }\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getNFTAttributes](NFTContractsBase.md#getnftattributes) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L82) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[getSignatureOfMethod](NFTContractsBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### grantOperatorRole + +▸ **grantOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Add an address as operator in the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------- | +| `operatorAddress` | `string` | New minter address | +| `from?` | [`Account`](Account.md) | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[grantOperatorRole](NFTContractsBase.md#grantoperatorrole) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L69) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[init](NFTContractsBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### isApprovedForAll + +▸ **isApprovedForAll**(`accountAddress`, `operatorAddress`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `accountAddress` | `string` | +| `operatorAddress` | `string` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:113](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L113) + +--- + +### isOperator + +▸ **isOperator**(`address`): `Promise`<`boolean`\> + +Checks if an account is an operator in the NFT contract + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :----------------------------------------- | +| `address` | `string` | Account address to check if is an operator | + +#### Returns + +`Promise`<`boolean`\> + +true if is an operator + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[isOperator](NFTContractsBase.md#isoperator) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L78) + +--- + +### mint + +▸ **mint**(`did`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `did` | `string` | +| `from` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L78) + +--- + +### mintWithURL + +▸ **mintWithURL**(`to`, `did`, `url`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `to` | `string` | +| `did` | `string` | +| `url` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L82) + +--- + +### owner + +▸ **owner**(): `Promise`<`string`\> + +Gets the contract owner + +#### Returns + +`Promise`<`string`\> + +Address of the contract owner + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[owner](NFTContractsBase.md#owner) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L19) + +--- + +### ownerOf + +▸ **ownerOf**(`did`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:121](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L121) + +--- + +### revokeOperatorRole + +▸ **revokeOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Revoke an address as operator in the NFT Contract + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------- | +| `operatorAddress` | `string` | Minter address to revoke | +| `from?` | [`Account`](Account.md) | Sender account | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Contract Receipt + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[revokeOperatorRole](NFTContractsBase.md#revokeoperatorrole) + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:115](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L115) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[send](NFTContractsBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[sendFrom](NFTContractsBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setApprovalForAll + +▸ **setApprovalForAll**(`target`, `state`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `target` | `string` | +| `state` | `boolean` | +| `from` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:104](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L104) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[setInstanceConfig](NFTContractsBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### tokenURI + +▸ **tokenURI**(`did`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:125](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L125) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `address`, `contractName?`, `artifactsFolder?`): `Promise`<[`Nft721Contract`](Nft721Contract.md)\> + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :---------------------------------------------------------- | :----------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `address` | `string` | `undefined` | +| `contractName` | `string` | `'NFT721Upgradeable'` | +| `artifactsFolder` | `string` | `config.artifactsFolder` | + +#### Returns + +`Promise`<[`Nft721Contract`](Nft721Contract.md)\> + +#### Overrides + +[NFTContractsBase](NFTContractsBase.md).[getInstance](NFTContractsBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L11) + +--- + +### getInstanceUsingABI + +▸ `Static` **getInstanceUsingABI**(`config`, `address`, `solidityABI`): `Promise`<[`Nft721Contract`](Nft721Contract.md)\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | +| `address` | `string` | +| `solidityABI` | `any` | + +#### Returns + +`Promise`<[`Nft721Contract`](Nft721Contract.md)\> + +#### Defined in + +[src/keeper/contracts/Nft721Contract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Nft721Contract.ts#L35) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFTContractsBase](NFTContractsBase.md).[setInstanceConfig](NFTContractsBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Nfts.md b/docs/api-reference/classes/Nfts.md deleted file mode 100644 index 3b7b00a53..000000000 --- a/docs/api-reference/classes/Nfts.md +++ /dev/null @@ -1,1219 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / Nfts - -# Class: Nfts - -Nevermined Nft module - -## Hierarchy - -- `Instantiable` - - ↳ **`Nfts`** - -## Table of contents - -### Constructors - -- [constructor](Nfts.md#constructor) - -### Accessors - -- [artifactsFolder](Nfts.md#artifactsfolder) -- [config](Nfts.md#config) -- [instanceConfig](Nfts.md#instanceconfig) -- [instantiableConfig](Nfts.md#instantiableconfig) -- [logger](Nfts.md#logger) -- [nevermined](Nfts.md#nevermined) -- [web3](Nfts.md#web3) - -### Methods - -- [access](Nfts.md#access) -- [addresses](Nfts.md#addresses) -- [balance](Nfts.md#balance) -- [burn](Nfts.md#burn) -- [buySecondaryMarketNft](Nfts.md#buysecondarymarketnft) -- [checkExists](Nfts.md#checkexists) -- [create](Nfts.md#create) -- [create721](Nfts.md#create721) -- [createWithRoyalties](Nfts.md#createwithroyalties) -- [details](Nfts.md#details) -- [downloadFiles](Nfts.md#downloadfiles) -- [findSigner](Nfts.md#findsigner) -- [getNftContractAddress](Nfts.md#getnftcontractaddress) -- [listOnSecondaryMarkets](Nfts.md#listonsecondarymarkets) -- [mint](Nfts.md#mint) -- [order](Nfts.md#order) -- [order721](Nfts.md#order721) -- [ownerOf](Nfts.md#ownerof) -- [release721Rewards](Nfts.md#release721rewards) -- [releaseRewards](Nfts.md#releaserewards) -- [releaseSecondaryMarketRewards](Nfts.md#releasesecondarymarketrewards) -- [setApprovalForAll](Nfts.md#setapprovalforall) -- [setInstanceConfig](Nfts.md#setinstanceconfig) -- [transfer](Nfts.md#transfer) -- [transfer721](Nfts.md#transfer721) -- [transferForDelegate](Nfts.md#transferfordelegate) -- [addressesStatic](Nfts.md#addressesstatic) -- [findSignerStatic](Nfts.md#findsignerstatic) -- [getInstance](Nfts.md#getinstance) -- [setInstanceConfig](Nfts.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new Nfts**() - -#### Inherited from - -Instantiable.constructor - -## Accessors - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Instantiable.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -Instantiable.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -Instantiable.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -Instantiable.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -Instantiable.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### access - -▸ **access**(`did`, `consumer`, `destination?`, `index?`, `agreementId?`): `Promise`<`boolean`\> - -Access the files associated with an NFT. - -**`Remarks`** - -This function will call the gateway that will check if all the access conditions where fulfilled -before providing the files. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Default value | Description | -| :------------- | :---------------------- | :------------ | :--------------------------------------------- | -| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | -| `consumer` | [`Account`](Account.md) | `undefined` | The NFT holder account. | -| `destination?` | `string` | `undefined` | The download destination for the files. | -| `index?` | `number` | `undefined` | - | -| `agreementId` | `string` | `'0x'` | - | - -#### Returns - -`Promise`<`boolean`\> - -true if the access was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:618](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L618) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### balance - -▸ **balance**(`did`, `account`): `Promise`<`default`\> - -Get the NFT balance for a particular did - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :-------- | :---------------------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the NFT asset. | -| `account` | [`Account`](Account.md) | The account to check the balance of. | - -#### Returns - -`Promise`<`default`\> - -The amount of NFTs owned by the account. - -#### Defined in - -[src/nevermined/Nfts.ts:645](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L645) - ---- - -### burn - -▸ **burn**(`did`, `nftAmount`, `publisher`, `params?`): `Promise`<`ContractReceipt`\> - -Burn NFTs associated with an asset. - -**`Remarks`** - -The publisher can only burn NFTs that it owns. NFTs that were already transferred cannot be burned by the publisher. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---------- | :---------------------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the NFT asset. | -| `nftAmount` | `default` | The amount of NFTs to burn. | -| `publisher` | [`Account`](Account.md) | The account of the publisher of the NFT. | -| `params?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -`Promise`<`ContractReceipt`\> - -The ethers.ContractReceipt - -#### Defined in - -[src/nevermined/Nfts.ts:256](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L256) - ---- - -### buySecondaryMarketNft - -▸ **buySecondaryMarketNft**(`consumer`, `nftAmount?`, `agreementIdSeed`, `params?`): `Promise`<`boolean`\> - -Buys a number of listed NFTs on secondary markets. - -**`Example`** - -```ts -// TODO -``` - -**`Throws`** - -NFTError -Thrown if there is an error buying the NFT. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------- | :----------------------------------------- | -| `consumer` | [`Account`](Account.md) | The account of the buyer/consumer. | -| `nftAmount` | `default` | The number of assets to buy. 1 by default. | -| `agreementIdSeed` | `string` | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`boolean`\> - -true if the buy was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:934](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L934) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -Instantiable.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### create - -▸ **create**(`metadata`, `publisher`, `cap`, `royaltyAttributes`, `assetPrice`, `nftAmount?`, `erc20TokenAddress?`, `preMint?`, `nftMetadata?`, `appId?`, `txParams?`): [`SubscribablePromise`](utils.SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> - -Create a new NFT Nevermined NFT. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :------------------- | :-------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------- | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | The metadata associated with the NFT. | -| `publisher` | [`Account`](Account.md) | The account of the creator od the NFT. | -| `cap` | `default` | The max number of nfts. | -| `royaltyAttributes` | `RoyaltyAttributes` | The royalties associated with the NFT. | -| `assetPrice` | `default` | The sales reward distribution. | -| `nftAmount` | `default` | The amount of NFTs that an address needs to hold in order to access the DID's protected assets. Leave it undefined and it will default to 1. | -| `erc20TokenAddress?` | `string` | The ERC-20 Token used to price the NFT. | -| `preMint?` | `boolean` | Set to true to mint _nftAmount_ during creation. | -| `nftMetadata?` | `string` | Url to the NFT metadata. | -| `appId?` | `string` | The id of the application creating the NFT. | -| `txParams?` | `TxParameters` | Optional transaction parameters | - -#### Returns - -[`SubscribablePromise`](utils.SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> - -The newly registered [DDO](DDO.md). - -#### Defined in - -[src/nevermined/Nfts.ts:64](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L64) - ---- - -### create721 - -▸ **create721**(`metadata`, `publisher`, `assetPrice`, `nftTokenAddress`, `erc20TokenAddress?`, `royaltyAttributes?`, `nftMetadata?`, `nftTransfer?`, `duration?`, `appId?`, `txParams?`): [`SubscribablePromise`](utils.SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> - -Create a new Nevermined NFT-721. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Default value | Description | -| :------------------- | :-------------------------------------- | :------------ | :--------------------------------------- | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | The metadata associated with the NFT. | -| `publisher` | [`Account`](Account.md) | `undefined` | The account of the creator od the NFT. | -| `assetPrice` | `default` | `undefined` | The sales reward distribution. | -| `nftTokenAddress` | `string` | `undefined` | The address of the ERC-721 contract | -| `erc20TokenAddress?` | `string` | `undefined` | The ERC-20 Token used to price the NFT. | -| `royaltyAttributes?` | `RoyaltyAttributes` | `undefined` | The royalties associated with the NFT. | -| `nftMetadata?` | `string` | `undefined` | Url to the NFT metadata. | -| `nftTransfer` | `boolean` | `true` | TODO | -| `duration` | `number` | `0` | TODO | -| `appId?` | `string` | `undefined` | Id of the application creating this NFT. | -| `txParams?` | `TxParameters` | `undefined` | Optional transaction parameters | - -#### Returns - -[`SubscribablePromise`](utils.SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> - -The newly registered [DDO](DDO.md). - -#### Defined in - -[src/nevermined/Nfts.ts:173](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L173) - ---- - -### createWithRoyalties - -▸ **createWithRoyalties**(`metadata`, `publisher`, `cap`, `royaltyAttributes`, `assetPrice`, `nftAmount?`, `erc20TokenAddress?`, `preMint?`, `nftMetadata?`, `nftType?`, `appId?`, `txParams?`): [`SubscribablePromise`](utils.SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> - -Create a new Nevermined NFT with royalties. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Default value | Description | -| :------------------- | :-------------------------------------- | :------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------- | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | The metadata associated with the NFT. | -| `publisher` | [`Account`](Account.md) | `undefined` | The account of the creator od the NFT. | -| `cap` | `default` | `undefined` | The max number of nfts. | -| `royaltyAttributes` | `RoyaltyAttributes` | `undefined` | The royalties associated with the NFT. | -| `assetPrice` | `default` | `undefined` | The sales reward distribution. | -| `nftAmount` | `default` | `undefined` | The amount of NFTs that an address needs to hold in order to access the DID's protected assets. Leave it undefined and it will default to 1. | -| `erc20TokenAddress?` | `string` | `undefined` | The ERC-20 Token used to price the NFT. | -| `preMint?` | `boolean` | `undefined` | Set to true to mint _nftAmount_ during creation. | -| `nftMetadata?` | `string` | `undefined` | Url to the NFT metadata. | -| `nftType` | `NeverminedNFTType` | `NeverminedNFT1155Type.nft1155` | - | -| `appId?` | `string` | `undefined` | The id of the application creating the NFT. | -| `txParams?` | `TxParameters` | `undefined` | Optional transaction parameters | - -#### Returns - -[`SubscribablePromise`](utils.SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> - -The newly registered [DDO](DDO.md). - -#### Defined in - -[src/nevermined/Nfts.ts:119](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L119) - ---- - -### details - -▸ **details**(`did`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `number` ; `nftSupply`: `number` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: `RoyaltyKind` ; `url`: `any` }\> - -Get the details of an NFT - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---- | :------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the NFT asset. | - -#### Returns - -`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `number` ; `nftSupply`: `number` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: `RoyaltyKind` ; `url`: `any` }\> - -The details of the NFT. - -#### Defined in - -[src/nevermined/Nfts.ts:693](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L693) - ---- - -### downloadFiles - -▸ `Private` **downloadFiles**(`agreementId`, `ddo`, `consumer`, `destination?`, `index?`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `consumer` | [`Account`](Account.md) | -| `destination?` | `string` | -| `index?` | `number` | - -#### Returns - -`Promise`<`boolean`\> - -#### Defined in - -[src/nevermined/Nfts.ts:752](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L752) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getNftContractAddress - -▸ **getNftContractAddress**(`ddo`): `string` \| `number` \| `string`[] - -Get the NFT contract address associated with a Nevermined asset. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---- | :-------------- | :-------------------- | -| `ddo` | [`DDO`](DDO.md) | The DDO of the asset. | - -#### Returns - -`string` \| `number` \| `string`[] - -The NFT contract address. - -#### Defined in - -[src/nevermined/Nfts.ts:739](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L739) - ---- - -### listOnSecondaryMarkets - -▸ **listOnSecondaryMarkets**(`ddo`, `assetPrice`, `nftAmount`, `provider`, `token`, `owner`): `Promise`<`string`\> - -After purchase re-list an NFT to enable secondary market sales. - -**`Example`** - -```ts -// TODO -``` - -**`Throws`** - -NFTError -Thrown if there is an error listing the NFT. - -#### Parameters - -| Name | Type | Description | -| :----------- | :-------------- | :----------------------------------------------------------- | -| `ddo` | [`DDO`](DDO.md) | The DDO of the asset. | -| `assetPrice` | `default` | The current setup of asset rewards. | -| `nftAmount` | `default` | The number of NFTs put up for secondary sale. | -| `provider` | `string` | The address that will be the provider of the secondary sale. | -| `token` | `default` | - | -| `owner` | `string` | The account of the current owner. | - -#### Returns - -`Promise`<`string`\> - -the agreementId of the secondary sale. - -#### Defined in - -[src/nevermined/Nfts.ts:859](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L859) - ---- - -### mint - -▸ **mint**(`did`, `nftAmount`, `publisher`, `params?`): `Promise`<`ContractReceipt`\> - -Mint NFTs associated with an asset. - -**`Remarks`** - -This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---------- | :---------------------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the NFT asset. | -| `nftAmount` | `default` | The amount of NFTs to mint. | -| `publisher` | [`Account`](Account.md) | The account of the publisher of the NFT. | -| `params?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -`Promise`<`ContractReceipt`\> - -The ethers.ContractReceipt - -#### Defined in - -[src/nevermined/Nfts.ts:224](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L224) - ---- - -### order - -▸ **order**(`did`, `nftAmount`, `consumer`, `txParams?`): [`SubscribablePromise`](utils.SubscribablePromise.md)<[`OrderProgressStep`](../enums/utils.OrderProgressStep.md), `string`\> - -Buy NFTs. - -**`Remarks`** - -This will lock the funds of the consumer in escrow pending the transfer of the NFTs -from the publisher. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---------- | :---------------------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the NFT asset. | -| `nftAmount` | `default` | The amount of NFTs to buy. | -| `consumer` | [`Account`](Account.md) | The account of the NFT buyer. | -| `txParams?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -[`SubscribablePromise`](utils.SubscribablePromise.md)<[`OrderProgressStep`](../enums/utils.OrderProgressStep.md), `string`\> - -The agreement ID. - -#### Defined in - -[src/nevermined/Nfts.ts:291](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L291) - ---- - -### order721 - -▸ **order721**(`did`, `consumer`, `txParams?`): [`SubscribablePromise`](utils.SubscribablePromise.md)<[`OrderProgressStep`](../enums/utils.OrderProgressStep.md), `string`\> - -Buy NFT-721. - -**`Remarks`** - -This will lock the funds of the consumer in escrow pending the transfer of the NFTs -from the publisher. - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---------- | :---------------------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the NFT asset. | -| `consumer` | [`Account`](Account.md) | The account of the NFT buyer. | -| `txParams?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -[`SubscribablePromise`](utils.SubscribablePromise.md)<[`OrderProgressStep`](../enums/utils.OrderProgressStep.md), `string`\> - -The agreement ID. - -#### Defined in - -[src/nevermined/Nfts.ts:340](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L340) - ---- - -### ownerOf - -▸ **ownerOf**(`did`, `nftTokenAddress`, `agreementId?`): `Promise`<`string`\> - -Get the owner of the NFT - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---------------- | :------- | :--------------------------------------------- | -| `did` | `string` | The Decentralized identifier of the NFT asset. | -| `nftTokenAddress` | `string` | The address of the ERC-721 contract. | -| `agreementId?` | `string` | The NFT sales agreement id. | - -#### Returns - -`Promise`<`string`\> - -The address of the NFT owner. - -#### Defined in - -[src/nevermined/Nfts.ts:663](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L663) - ---- - -### release721Rewards - -▸ **release721Rewards**(`agreementId`, `did`, `publisher`, `txParams?`): `Promise`<`boolean`\> - -Release the funds from escrow. - -**`Remarks`** - -A publisher is able to release the funds put on escrow by the consumer after transferring the NFTs. - -**`Example`** - -```ts -// TODO -``` - -**`Throws`** - -NFTError -Thrown if there is an error releasing the rewards. - -#### Parameters - -| Name | Type | Description | -| :------------ | :---------------------- | :--------------------------------------------- | -| `agreementId` | `string` | The NFT sales agreement id. | -| `did` | `string` | The Decentralized identifier of the NFT asset. | -| `publisher` | [`Account`](Account.md) | The current owner of the NFTs. | -| `txParams?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -`Promise`<`boolean`\> - -true if the funds release was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:574](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L574) - ---- - -### releaseRewards - -▸ **releaseRewards**(`agreementId`, `did`, `nftAmount`, `publisher`, `txParams?`): `Promise`<`boolean`\> - -Release the funds from escrow. - -**`Remarks`** - -A publisher is able to release the funds put on escrow by the consumer after transferring the NFTs. - -**`Example`** - -```ts -// TODO -``` - -**`Throws`** - -NFTError -Thrown if there is an error releasing the rewards - -#### Parameters - -| Name | Type | Description | -| :------------ | :---------------------- | :--------------------------------------------- | -| `agreementId` | `string` | The NFT sales agreement id. | -| `did` | `string` | The Decentralized identifier of the NFT asset. | -| `nftAmount` | `default` | The amount of NFTs to transfer. | -| `publisher` | [`Account`](Account.md) | The current owner of the NFTs. | -| `txParams?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -`Promise`<`boolean`\> - -true if the funds release was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:526](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L526) - ---- - -### releaseSecondaryMarketRewards - -▸ **releaseSecondaryMarketRewards**(`owner`, `consumer`, `agreementIdSeed`, `params?`): `Promise`<`boolean`\> - -Used to release the secondary market NFT & the locked rewards. - -**`Example`** - -```ts -// TODO -``` - -**`Throws`** - -NFTError -Thrown if there is an error releasing the rewards. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------- | :----------------- | -| `owner` | [`Account`](Account.md) | The owner account. | -| `consumer` | [`Account`](Account.md) | - | -| `agreementIdSeed` | `string` | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`boolean`\> - -true if the transaction was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:997](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L997) - ---- - -### setApprovalForAll - -▸ **setApprovalForAll**(`operatorAddress`, `approved`, `from`): `Promise`<`ContractReceipt`\> - -Enable or disable NFT transfer rights for an operator. - -**`See`** - -[transferForDelegate](Nfts.md#transferfordelegate) - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------- | :------------------------------------------------------------------- | -| `operatorAddress` | `string` | The address that of the operator we want to give transfer rights to. | -| `approved` | `boolean` | Give or remove transfer rights from the operator. | -| `from` | [`Account`](Account.md) | The account that wants to give transfer rights to the operator. | - -#### Returns - -`Promise`<`ContractReceipt`\> - -The ethers.ContractReceipt - -#### Defined in - -[src/nevermined/Nfts.ts:822](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L822) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### transfer - -▸ **transfer**(`agreementId`, `did`, `nftAmount`, `publisher`, `txParams?`): `Promise`<`boolean`\> - -Transfer NFTs to the consumer. - -**`Remarks`** - -A publisher/provider will check if the consumer put the funds in escrow and -execute the transfer in order to be able to release the rewards. - -**`Example`** - -```ts -// TODO -``` - -**`Throws`** - -NFTError -Thrown if there is an error transferring the NFT - -#### Parameters - -| Name | Type | Description | -| :------------ | :---------------------- | :--------------------------------------------- | -| `agreementId` | `string` | The NFT sales agreement id. | -| `did` | `string` | The Decentralized identifier of the NFT asset. | -| `nftAmount` | `default` | The number of NFTs to transfer. | -| `publisher` | [`Account`](Account.md) | The current owner of the NFTs. | -| `txParams?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -`Promise`<`boolean`\> - -true if the transfer was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:394](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L394) - ---- - -### transfer721 - -▸ **transfer721**(`agreementId`, `did`, `publisher`, `txParams?`): `Promise`<`boolean`\> - -Transfer NFT-721 to the consumer. - -**`Remarks`** - -A publisher/provider will check if the consumer put the funds in escrow and -execute the transfer in order to be able to release the rewards. - -**`Example`** - -```ts -// TODO -``` - -**`Throws`** - -NFTError -Thrown if there is an error transferring the NFT - -#### Parameters - -| Name | Type | Description | -| :------------ | :---------------------- | :--------------------------------------------- | -| `agreementId` | `string` | The NFT sales agreement id. | -| `did` | `string` | The Decentralized identifier of the NFT asset. | -| `publisher` | [`Account`](Account.md) | The current owner of the NFTs. | -| `txParams?` | `TxParameters` | Optional transaction parameters. | - -#### Returns - -`Promise`<`boolean`\> - -true if the transfer was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:481](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L481) - ---- - -### transferForDelegate - -▸ **transferForDelegate**(`agreementId`, `nftHolder`, `nftReceiver`, `nftAmount`, `ercType?`): `Promise`<`boolean`\> - -Asks the gateway to transfer the NFT on behalf of the publisher. - -**`Remarks`** - -This is useful when the consumer does not want to wait for the publisher -to transfer the NFT once the payment is made. Assuming the publisher delegated -transfer permissions to the gateway. - -One example would be a marketplace where the user wants to get access to the NFT -as soon as the payment is made - -**`Example`** - -```ts -// TODO -``` - -#### Parameters - -| Name | Type | Default value | Description | -| :------------ | :-------- | :------------ | :----------------------------------------------- | -| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | -| `nftHolder` | `string` | `undefined` | The address of the current owner of the NFT. | -| `nftReceiver` | `string` | `undefined` | The address where the NFT should be transferred. | -| `nftAmount` | `default` | `undefined` | The amount of NFTs to transfer. | -| `ercType` | `ERCType` | `1155` | The Type of the NFT ERC (1155 or 721). | - -#### Returns - -`Promise`<`boolean`\> - -true if the transfer was successful. - -#### Defined in - -[src/nevermined/Nfts.ts:443](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L443) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSignerStatic - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`Nfts`](Nfts.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`Nfts`](Nfts.md)\> - -#### Overrides - -Instantiable.getInstance - -#### Defined in - -[src/nevermined/Nfts.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Nfts.ts#L36) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/Permissions.md b/docs/api-reference/classes/Permissions.md new file mode 100644 index 000000000..77500cdfe --- /dev/null +++ b/docs/api-reference/classes/Permissions.md @@ -0,0 +1,486 @@ +[@nevermined-io/sdk](../code-reference.md) / Permissions + +# Class: Permissions + +## Hierarchy + +- [`MarketplaceApi`](MarketplaceApi.md) + + ↳ **`Permissions`** + +## Table of contents + +### Constructors + +- [constructor](Permissions.md#constructor) + +### Accessors + +- [artifactsFolder](Permissions.md#artifactsfolder) +- [circuitsFolder](Permissions.md#circuitsfolder) +- [config](Permissions.md#config) +- [instanceConfig](Permissions.md#instanceconfig) +- [instantiableConfig](Permissions.md#instantiableconfig) +- [logger](Permissions.md#logger) +- [nevermined](Permissions.md#nevermined) +- [url](Permissions.md#url) +- [web3](Permissions.md#web3) + +### Methods + +- [addNewAddress](Permissions.md#addnewaddress) +- [create](Permissions.md#create) +- [deleteOneById](Permissions.md#deleteonebyid) +- [findManyByUserId](Permissions.md#findmanybyuserid) +- [findManyByUserIdAndType](Permissions.md#findmanybyuseridandtype) +- [findOneById](Permissions.md#findonebyid) +- [login](Permissions.md#login) +- [setInstanceConfig](Permissions.md#setinstanceconfig) +- [updateOneById](Permissions.md#updateonebyid) +- [getInstance](Permissions.md#getinstance) +- [setInstanceConfig](Permissions.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Permissions**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[constructor](MarketplaceApi.md#constructor) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L7) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +MarketplaceApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +MarketplaceApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +MarketplaceApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### url + +• `Protected` `get` **url**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.url + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L12) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +MarketplaceApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addNewAddress + +▸ **addNewAddress**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[addNewAddress](MarketplaceApi.md#addnewaddress) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L36) + +--- + +### create + +▸ **create**(`newPermission`): `Promise`<[`Permission`](../interfaces/Permission.md)\> + +Create Permission + +#### Parameters + +| Name | Type | +| :-------------- | :------------------------------------------------ | +| `newPermission` | [`NewPermission`](../interfaces/NewPermission.md) | + +#### Returns + +`Promise`<[`Permission`](../interfaces/Permission.md)\> + +#### Defined in + +[src/services/metadata/Permissions.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Permissions.ts#L14) + +--- + +### deleteOneById + +▸ **deleteOneById**(`id`): `Promise`<`void`\> + +Delele a bookmark by id + +#### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/services/metadata/Permissions.ts:138](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Permissions.ts#L138) + +--- + +### findManyByUserId + +▸ **findManyByUserId**(`userId`, `query?`): `Promise`<[`MarketplaceResults`](../interfaces/MarketplaceResults.md)<[`Permission`](../interfaces/Permission.md)\>\> + +Get permissions by userId + +#### Parameters + +| Name | Type | +| :------- | :-------------------------------------------- | +| `userId` | `string` | +| `query?` | [`SearchQuery`](../interfaces/SearchQuery.md) | + +#### Returns + +`Promise`<[`MarketplaceResults`](../interfaces/MarketplaceResults.md)<[`Permission`](../interfaces/Permission.md)\>\> + +#### Defined in + +[src/services/metadata/Permissions.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Permissions.ts#L63) + +--- + +### findManyByUserIdAndType + +▸ **findManyByUserIdAndType**(`userId`, `type`, `query?`): `Promise`<[`MarketplaceResults`](../interfaces/MarketplaceResults.md)<[`Permission`](../interfaces/Permission.md)\>\> + +Get permissions by userId and specific type + +#### Parameters + +| Name | Type | +| :------- | :--------------------------------------------- | +| `userId` | `string` | +| `type` | [`PermissionType`](../enums/PermissionType.md) | +| `query?` | [`SearchQuery`](../interfaces/SearchQuery.md) | + +#### Returns + +`Promise`<[`MarketplaceResults`](../interfaces/MarketplaceResults.md)<[`Permission`](../interfaces/Permission.md)\>\> + +#### Defined in + +[src/services/metadata/Permissions.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Permissions.ts#L88) + +--- + +### findOneById + +▸ **findOneById**(`id`): `Promise`<[`Permission`](../interfaces/Permission.md)\> + +Get a permission by Id + +#### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +#### Returns + +`Promise`<[`Permission`](../interfaces/Permission.md)\> + +#### Defined in + +[src/services/metadata/Permissions.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Permissions.ts#L41) + +--- + +### login + +▸ **login**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[login](MarketplaceApi.md#login) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L16) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### updateOneById + +▸ **updateOneById**(`id`, `permission`): `Promise`<[`Permission`](../interfaces/Permission.md)\> + +Update a Permission by id + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------ | +| `id` | `string` | +| `permission` | `Partial`<[`Permission`](../interfaces/Permission.md)\> | + +#### Returns + +`Promise`<[`Permission`](../interfaces/Permission.md)\> + +#### Defined in + +[src/services/metadata/Permissions.ts:114](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Permissions.ts#L114) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[getInstance](MarketplaceApi.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Profiles.md b/docs/api-reference/classes/Profiles.md new file mode 100644 index 000000000..b18ef0a7c --- /dev/null +++ b/docs/api-reference/classes/Profiles.md @@ -0,0 +1,454 @@ +[@nevermined-io/sdk](../code-reference.md) / Profiles + +# Class: Profiles + +## Hierarchy + +- [`MarketplaceApi`](MarketplaceApi.md) + + ↳ **`Profiles`** + +## Table of contents + +### Constructors + +- [constructor](Profiles.md#constructor) + +### Accessors + +- [artifactsFolder](Profiles.md#artifactsfolder) +- [circuitsFolder](Profiles.md#circuitsfolder) +- [config](Profiles.md#config) +- [instanceConfig](Profiles.md#instanceconfig) +- [instantiableConfig](Profiles.md#instantiableconfig) +- [logger](Profiles.md#logger) +- [nevermined](Profiles.md#nevermined) +- [url](Profiles.md#url) +- [web3](Profiles.md#web3) + +### Methods + +- [addNewAddress](Profiles.md#addnewaddress) +- [create](Profiles.md#create) +- [disableOneByUserId](Profiles.md#disableonebyuserid) +- [findOneByAddress](Profiles.md#findonebyaddress) +- [findOneByUserId](Profiles.md#findonebyuserid) +- [login](Profiles.md#login) +- [setInstanceConfig](Profiles.md#setinstanceconfig) +- [update](Profiles.md#update) +- [getInstance](Profiles.md#getinstance) +- [setInstanceConfig](Profiles.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Profiles**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[constructor](MarketplaceApi.md#constructor) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L7) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +MarketplaceApi.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +MarketplaceApi.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +MarketplaceApi.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +MarketplaceApi.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### url + +• `Protected` `get` **url**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MarketplaceApi.url + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L12) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +MarketplaceApi.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addNewAddress + +▸ **addNewAddress**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[addNewAddress](MarketplaceApi.md#addnewaddress) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L36) + +--- + +### create + +▸ **create**(`newProfile`): `Promise`<[`Profile`](../interfaces/Profile.md)\> + +Create user profile + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------ | +| `newProfile` | [`NewProfile`](../interfaces/NewProfile.md) | + +#### Returns + +`Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Defined in + +[src/services/metadata/Profiles.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Profiles.ts#L11) + +--- + +### disableOneByUserId + +▸ **disableOneByUserId**(`userId`): `Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Parameters + +| Name | Type | +| :------- | :------- | +| `userId` | `string` | + +#### Returns + +`Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Defined in + +[src/services/metadata/Profiles.ts:93](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Profiles.ts#L93) + +--- + +### findOneByAddress + +▸ **findOneByAddress**(`address`): `Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Defined in + +[src/services/metadata/Profiles.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Profiles.ts#L74) + +--- + +### findOneByUserId + +▸ **findOneByUserId**(`userId`): `Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Parameters + +| Name | Type | +| :------- | :------- | +| `userId` | `string` | + +#### Returns + +`Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Defined in + +[src/services/metadata/Profiles.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Profiles.ts#L55) + +--- + +### login + +▸ **login**(`clientAssertion`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------------- | :------- | +| `clientAssertion` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[login](MarketplaceApi.md#login) + +#### Defined in + +[src/services/metadata/MarketplaceAPI.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MarketplaceAPI.ts#L16) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### update + +▸ **update**(`userId`, `profile`): `Promise`<[`Profile`](../interfaces/Profile.md)\> + +Update user profile + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `userId` | `string` | +| `profile` | `Partial`<[`NewProfile`](../interfaces/NewProfile.md)\> | + +#### Returns + +`Promise`<[`Profile`](../interfaces/Profile.md)\> + +#### Defined in + +[src/services/metadata/Profiles.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/Profiles.ts#L34) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[getInstance](MarketplaceApi.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[MarketplaceApi](MarketplaceApi.md).[setInstanceConfig](MarketplaceApi.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ProvenanceApi.md b/docs/api-reference/classes/ProvenanceApi.md new file mode 100644 index 000000000..7d6610995 --- /dev/null +++ b/docs/api-reference/classes/ProvenanceApi.md @@ -0,0 +1,592 @@ +[@nevermined-io/sdk](../code-reference.md) / ProvenanceApi + +# Class: ProvenanceApi + +Nevermined Provenance API. It allows to register and search entries in the Nevermined W3C Provenance registry +You can find more information about Nevermined Provenance here: +[https://docs.nevermined.io/docs/architecture/specs/Spec-PROVENANCE](https://docs.nevermined.io/docs/architecture/specs/Spec-PROVENANCE) + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`ProvenanceApi`** + +## Table of contents + +### Constructors + +- [constructor](ProvenanceApi.md#constructor) + +### Accessors + +- [artifactsFolder](ProvenanceApi.md#artifactsfolder) +- [circuitsFolder](ProvenanceApi.md#circuitsfolder) +- [config](ProvenanceApi.md#config) +- [instanceConfig](ProvenanceApi.md#instanceconfig) +- [instantiableConfig](ProvenanceApi.md#instantiableconfig) +- [logger](ProvenanceApi.md#logger) +- [nevermined](ProvenanceApi.md#nevermined) +- [web3](ProvenanceApi.md#web3) + +### Methods + +- [actedOnBehalf](ProvenanceApi.md#actedonbehalf) +- [addDidProvenanceDelegate](ProvenanceApi.md#adddidprovenancedelegate) +- [getDIDProvenanceEvents](ProvenanceApi.md#getdidprovenanceevents) +- [getProvenanceEntry](ProvenanceApi.md#getprovenanceentry) +- [getProvenanceMethodEvents](ProvenanceApi.md#getprovenancemethodevents) +- [getProvenanceOwner](ProvenanceApi.md#getprovenanceowner) +- [isProvenanceDelegate](ProvenanceApi.md#isprovenancedelegate) +- [removeDidProvenanceDelegate](ProvenanceApi.md#removedidprovenancedelegate) +- [setInstanceConfig](ProvenanceApi.md#setinstanceconfig) +- [used](ProvenanceApi.md#used) +- [wasAssociatedWith](ProvenanceApi.md#wasassociatedwith) +- [wasDerivedFrom](ProvenanceApi.md#wasderivedfrom) +- [getInstance](ProvenanceApi.md#getinstance) +- [setInstanceConfig](ProvenanceApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ProvenanceApi**(`config`) + +Creates a new ProvenanceApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L18) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### actedOnBehalf + +▸ **actedOnBehalf**(`provenanceId`, `did`, `delegateAgentId`, `responsibleAgentId`, `activityId`, `signature`, `attributes`, `from`, `txParams?`): `Promise`<`boolean`\> + +Implements the W3C PROV Delegation action + +#### Parameters + +| Name | Type | Description | +| :------------------- | :---------------------------------------------- | :------------------------------------------------- | +| `provenanceId` | `string` | Provenance ID | +| `did` | `string` | Identifier of the entity created | +| `delegateAgentId` | `string` | Delegate Agent Identifier | +| `responsibleAgentId` | `string` | Responsible Agent Identifier | +| `activityId` | `string` | Identifier of the activity creating the new entity | +| `signature` | `string` | Signature provided by the delegated agent | +| `attributes` | `string` | Attributes associated with the action | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:147](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L147) + +--- + +### addDidProvenanceDelegate + +▸ **addDidProvenanceDelegate**(`did`, `delegated`, `from`, `txParams?`): `Promise`<`boolean`\> + +Add new DID provenance delegate. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :------------------------------- | +| `did` | `string` | Identifier of the entity created | +| `delegated` | `string` | Delegate Address | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:180](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L180) + +--- + +### getDIDProvenanceEvents + +▸ **getDIDProvenanceEvents**(`did`): `Promise`<{ `activityId`: `string` ; `agentId`: `string` ; `agentInvolvedId`: `string` ; `attributes?`: `string` ; `blockNumberUpdated`: `number` ; `did`: `string` ; `id`: `string` ; `method`: `number` ; `provId`: `string` ; `relatedDid`: `string` }[]\> + +Search for ProvenanceAttributeRegistered events related with a specific DID + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :------------------------------- | +| `did` | `string` | identifier of the entity created | + +#### Returns + +`Promise`<{ `activityId`: `string` ; `agentId`: `string` ; `agentInvolvedId`: `string` ; `attributes?`: `string` ; `blockNumberUpdated`: `number` ; `did`: `string` ; `id`: `string` ; `method`: `number` ; `provId`: `string` ; `relatedDid`: `string` }[]\> + +A list of provenance events. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:240](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L240) + +--- + +### getProvenanceEntry + +▸ **getProvenanceEntry**(`provenanceId`): `Promise`<[`ProvenanceRegistry`](../interfaces/ProvenanceRegistry.md)\> + +Given a provenance id it returns the provenance details + +#### Parameters + +| Name | Type | Description | +| :------------- | :------- | :-------------------------------------- | +| `provenanceId` | `string` | Unique identifier of a provenance entry | + +#### Returns + +`Promise`<[`ProvenanceRegistry`](../interfaces/ProvenanceRegistry.md)\> + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L28) + +--- + +### getProvenanceMethodEvents + +▸ **getProvenanceMethodEvents**<`T`\>(`method`, `did`): `Promise`<[`ProvenanceEvent`](../code-reference.md#provenanceevent)<`T`\>[]\> + +Search for ProvenanceAttributeRegistered events related with a specific DID + +#### Type parameters + +| Name | Type | +| :--- | :--------------------------------------------------------- | +| `T` | extends [`ProvenanceMethod`](../enums/ProvenanceMethod.md) | + +#### Parameters + +| Name | Type | Description | +| :------- | :------- | :------------------------------- | +| `method` | `T` | Method | +| `did` | `string` | Identifier of the entity created | + +#### Returns + +`Promise`<[`ProvenanceEvent`](../code-reference.md#provenanceevent)<`T`\>[]\> + +A list of provenance method events. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:250](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L250) + +--- + +### getProvenanceOwner + +▸ **getProvenanceOwner**(`did`): `Promise`<`unknown`\> + +Retrieve the owner of the provenance record. + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :------------------------------- | +| `did` | `string` | Identifier of the entity created | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:231](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L231) + +--- + +### isProvenanceDelegate + +▸ **isProvenanceDelegate**(`did`, `delegated`): `Promise`<`unknown`\> + +Check whether a given DID delegate exists + +#### Parameters + +| Name | Type | Description | +| :---------- | :------- | :------------------------------- | +| `did` | `string` | Identifier of the entity created | +| `delegated` | `string` | Delegate Address | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:223](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L223) + +--- + +### removeDidProvenanceDelegate + +▸ **removeDidProvenanceDelegate**(`did`, `delegated`, `from`, `txParams?`): `Promise`<`boolean`\> + +Remove an existing DID delegate. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :------------------------------- | +| `did` | `string` | Identifier of the entity created | +| `delegated` | `string` | Delegate Address | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:203](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L203) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### used + +▸ **used**(`provenanceId`, `did`, `agentId`, `activityId`, `signature`, `attributes`, `from`, `txParams?`): `Promise`<`boolean`\> + +Implements the W3C PROV Usage action + +#### Parameters + +| Name | Type | Description | +| :------------- | :---------------------------------------------- | :-------------------------------------------------- | +| `provenanceId` | `string` | Provenance ID | +| `did` | `string` | Identifier of the entity created | +| `agentId` | `string` | Agent Identifier | +| `activityId` | `string` | Identifier of the activity creating the new entity | +| `signature` | `string` | Signature (optional) provided by the agent involved | +| `attributes` | `string` | Attributes associated with the action | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L44) + +--- + +### wasAssociatedWith + +▸ **wasAssociatedWith**(`provenanceId`, `did`, `agentId`, `activityId`, `attributes`, `from`, `txParams?`): `Promise`<`boolean`\> + +Implements the W3C PROV Association action + +#### Parameters + +| Name | Type | Description | +| :------------- | :---------------------------------------------- | :------------------------------------------------- | +| `provenanceId` | `string` | Provenance ID | +| `did` | `string` | Identifier of the entity created | +| `agentId` | `string` | Agent Identifier | +| `activityId` | `string` | Identifier of the activity creating the new entity | +| `attributes` | `string` | Attributes associated with the action | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:113](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L113) + +--- + +### wasDerivedFrom + +▸ **wasDerivedFrom**(`provenanceId`, `newEntityDid`, `usedEntityDid`, `agentId`, `activityId`, `attributes`, `from`, `txParams?`): `Promise`<`boolean`\> + +Implements the W3C PROV Derivation action + +#### Parameters + +| Name | Type | Description | +| :-------------- | :---------------------------------------------- | :----------------------------------------------------- | +| `provenanceId` | `string` | Provenance ID | +| `newEntityDid` | `string` | Identifier of the new entity derived | +| `usedEntityDid` | `string` | Identifier of the entity used to derive the new entity | +| `agentId` | `string` | Agent Identifier | +| `activityId` | `string` | Identifier of the activity creating the new entity | +| `attributes` | `string` | Attributes associated with the action | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/api/ProvenanceApi.ts:79](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ProvenanceApi.ts#L79) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ProviderCondition.md b/docs/api-reference/classes/ProviderCondition.md new file mode 100644 index 000000000..7fc4bef3a --- /dev/null +++ b/docs/api-reference/classes/ProviderCondition.md @@ -0,0 +1,1005 @@ +[@nevermined-io/sdk](../code-reference.md) / ProviderCondition + +# Class: ProviderCondition + +## Type parameters + +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Record`<`string`, `unknown`\> | + +## Hierarchy + +- [`Condition`](Condition.md)<`Ctx`, `Extra`\> + + ↳ **`ProviderCondition`** + + ↳↳ [`AccessCondition`](AccessCondition.md) + + ↳↳ [`EscrowPaymentCondition`](EscrowPaymentCondition.md) + + ↳↳ [`ComputeExecutionCondition`](ComputeExecutionCondition.md) + + ↳↳ [`NFTAccessCondition`](NFTAccessCondition.md) + + ↳↳ [`TransferNFTCondition`](TransferNFTCondition.md) + + ↳↳ [`TransferNFT721Condition`](TransferNFT721Condition.md) + + ↳↳ [`TransferDIDOwnershipCondition`](TransferDIDOwnershipCondition.md) + + ↳↳ [`AaveBorrowCondition`](AaveBorrowCondition.md) + + ↳↳ [`AaveCollateralDepositCondition`](AaveCollateralDepositCondition.md) + + ↳↳ [`AaveCollateralWithdrawCondition`](AaveCollateralWithdrawCondition.md) + + ↳↳ [`AaveRepayCondition`](AaveRepayCondition.md) + + ↳↳ [`NFT721LockCondition`](NFT721LockCondition.md) + + ↳↳ [`DistributeNFTCollateralCondition`](DistributeNFTCollateralCondition.md) + +## Table of contents + +### Constructors + +- [constructor](ProviderCondition.md#constructor) + +### Properties + +- [address](ProviderCondition.md#address) +- [contract](ProviderCondition.md#contract) +- [contractName](ProviderCondition.md#contractname) +- [events](ProviderCondition.md#events) +- [version](ProviderCondition.md#version) + +### Accessors + +- [artifactsFolder](ProviderCondition.md#artifactsfolder) +- [circuitsFolder](ProviderCondition.md#circuitsfolder) +- [config](ProviderCondition.md#config) +- [instanceConfig](ProviderCondition.md#instanceconfig) +- [instantiableConfig](ProviderCondition.md#instantiableconfig) +- [logger](ProviderCondition.md#logger) +- [nevermined](ProviderCondition.md#nevermined) +- [web3](ProviderCondition.md#web3) + +### Methods + +- [abortByTimeOut](ProviderCondition.md#abortbytimeout) +- [call](ProviderCondition.md#call) +- [fulfill](ProviderCondition.md#fulfill) +- [fulfillInstance](ProviderCondition.md#fulfillinstance) +- [fulfillPlain](ProviderCondition.md#fulfillplain) +- [fulfillWithNode](ProviderCondition.md#fulfillwithnode) +- [generateId](ProviderCondition.md#generateid) +- [generateIdHash](ProviderCondition.md#generateidhash) +- [generateIdWithSeed](ProviderCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) +- [getFromAddress](ProviderCondition.md#getfromaddress) +- [getInputsOfMethod](ProviderCondition.md#getinputsofmethod) +- [getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) +- [hashValues](ProviderCondition.md#hashvalues) +- [hashValuesPlain](ProviderCondition.md#hashvaluesplain) +- [init](ProviderCondition.md#init) +- [instance](ProviderCondition.md#instance) +- [instanceFromDDO](ProviderCondition.md#instancefromddo) +- [nodeMethod](ProviderCondition.md#nodemethod) +- [params](ProviderCondition.md#params) +- [paramsFromDDO](ProviderCondition.md#paramsfromddo) +- [send](ProviderCondition.md#send) +- [sendFrom](ProviderCondition.md#sendfrom) +- [setInstanceConfig](ProviderCondition.md#setinstanceconfig) +- [getInstance](ProviderCondition.md#getinstance) +- [setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ProviderCondition**<`Ctx`, `Extra`\>(`contractName`) + +#### Type parameters + +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Record`<`string`, `unknown`\> | + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[Condition](Condition.md).[constructor](Condition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[Condition](Condition.md).[address](Condition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[Condition](Condition.md).[contract](Condition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[Condition](Condition.md).[contractName](Condition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[Condition](Condition.md).[events](Condition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[Condition](Condition.md).[version](Condition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Condition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Condition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Condition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Condition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Condition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Condition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Condition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Condition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[abortByTimeOut](Condition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[Condition](Condition.md).[call](Condition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ `Abstract` **fulfill**(`agreementId`, `...args`): `any` + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...args` | `any`[] | + +#### Returns + +`any` + +#### Inherited from + +[Condition](Condition.md).[fulfill](Condition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L61) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :------------------------------------------------------------------ | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\> | `undefined` | +| `additionalParams` | `Extra` | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[fulfillInstance](Condition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[fulfillPlain](Condition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\> | +| `additionalParams` | `Extra` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Overrides + +[Condition](Condition.md).[fulfillWithNode](Condition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[generateId](Condition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[generateIdHash](Condition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[Condition](Condition.md).[generateIdWithSeed](Condition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[Condition](Condition.md).[getConditionFulfilledEvent](Condition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[getFromAddress](Condition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[Condition](Condition.md).[getInputsOfMethod](Condition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[Condition](Condition.md).[getSignatureOfMethod](Condition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[hashValues](Condition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[Condition](Condition.md).[hashValuesPlain](Condition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[Condition](Condition.md).[init](Condition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Inherited from + +[Condition](Condition.md).[instance](Condition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `Ctx` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Extra`\>\> + +#### Inherited from + +[Condition](Condition.md).[instanceFromDDO](Condition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`...args`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\> + +#### Inherited from + +[Condition](Condition.md).[params](Condition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:122](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L122) + +--- + +### paramsFromDDO + +▸ `Abstract` **paramsFromDDO**(`ctx`, `...args`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\>\> + +#### Parameters + +| Name | Type | +| :-------- | :-------------------------------------------------------------------- | +| `ctx` | `Ctx` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Extra`\>\> + +#### Inherited from + +[Condition](Condition.md).[paramsFromDDO](Condition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:137](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L137) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[send](Condition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[Condition](Condition.md).[sendFrom](Condition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**<`Ctx`, `Extra`\>(`config`, `conditionName`, `conditionsClass`, `optional?`): `Promise`<`any`\> + +#### Type parameters + +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `Ctx` | extends [`ConditionContext`](../interfaces/ConditionContext.md) | +| `Extra` | `Extra` | + +#### Parameters + +| Name | Type | Default value | +| :---------------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `conditionName` | `string` | `undefined` | +| `conditionsClass` | `any` | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`any`\> + +#### Inherited from + +[Condition](Condition.md).[getInstance](Condition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:111](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L111) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Providers.md b/docs/api-reference/classes/Providers.md new file mode 100644 index 000000000..cfcf32426 --- /dev/null +++ b/docs/api-reference/classes/Providers.md @@ -0,0 +1,356 @@ +[@nevermined-io/sdk](../code-reference.md) / Providers + +# Class: Providers + +Providers API that allows the basic management of the provider accounts associated to an asset. + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`Providers`** + +## Table of contents + +### Constructors + +- [constructor](Providers.md#constructor) + +### Accessors + +- [artifactsFolder](Providers.md#artifactsfolder) +- [circuitsFolder](Providers.md#circuitsfolder) +- [config](Providers.md#config) +- [instanceConfig](Providers.md#instanceconfig) +- [instantiableConfig](Providers.md#instantiableconfig) +- [logger](Providers.md#logger) +- [nevermined](Providers.md#nevermined) +- [web3](Providers.md#web3) + +### Methods + +- [add](Providers.md#add) +- [list](Providers.md#list) +- [remove](Providers.md#remove) +- [setInstanceConfig](Providers.md#setinstanceconfig) +- [getInstance](Providers.md#getinstance) +- [setInstanceConfig](Providers.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Providers**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/Provider.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Provider.ts#L9) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### add + +▸ **add**(`did`, `address`, `from`, `txParams?`): `Promise`<`boolean`\> + +Add a new provider in the registry for a did. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `did` | `string` | Identifier of the entity created | +| `address` | `string` | New provider address in the list of providers. | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/Provider.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Provider.ts#L23) + +--- + +### list + +▸ **list**(`did`): `Promise`<`any`\> + +List the provider addresses for a did. + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :------------------------------- | +| `did` | `string` | Identifier of the entity created | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/nevermined/Provider.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Provider.ts#L55) + +--- + +### remove + +▸ **remove**(`did`, `address`, `from`, `txParams?`): `Promise`<`boolean`\> + +Remove a provider in the registry for a did. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `did` | `string` | Identifier of the entity created | +| `address` | `string` | New provider address in the list of providers. | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded. + +#### Defined in + +[src/nevermined/Provider.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Provider.ts#L41) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/RegistryBaseApi.md b/docs/api-reference/classes/RegistryBaseApi.md new file mode 100644 index 000000000..565ab2916 --- /dev/null +++ b/docs/api-reference/classes/RegistryBaseApi.md @@ -0,0 +1,523 @@ +[@nevermined-io/sdk](../code-reference.md) / RegistryBaseApi + +# Class: RegistryBaseApi + +Abstract class proving common functionality related with Assets registration. + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`RegistryBaseApi`** + + ↳↳ [`NFTsBaseApi`](NFTsBaseApi.md) + + ↳↳ [`AssetsApi`](AssetsApi.md) + + ↳↳ [`ComputeApi`](ComputeApi.md) + +## Table of contents + +### Constructors + +- [constructor](RegistryBaseApi.md#constructor) + +### Properties + +- [servicePlugin](RegistryBaseApi.md#serviceplugin) + +### Accessors + +- [artifactsFolder](RegistryBaseApi.md#artifactsfolder) +- [circuitsFolder](RegistryBaseApi.md#circuitsfolder) +- [config](RegistryBaseApi.md#config) +- [instanceConfig](RegistryBaseApi.md#instanceconfig) +- [instantiableConfig](RegistryBaseApi.md#instantiableconfig) +- [logger](RegistryBaseApi.md#logger) +- [nevermined](RegistryBaseApi.md#nevermined) +- [web3](RegistryBaseApi.md#web3) + +### Methods + +- [addRating](RegistryBaseApi.md#addrating) +- [getPriced](RegistryBaseApi.md#getpriced) +- [list](RegistryBaseApi.md#list) +- [orderAsset](RegistryBaseApi.md#orderasset) +- [registerNeverminedAsset](RegistryBaseApi.md#registerneverminedasset) +- [resolveAsset](RegistryBaseApi.md#resolveasset) +- [setInstanceConfig](RegistryBaseApi.md#setinstanceconfig) +- [updateAsset](RegistryBaseApi.md#updateasset) +- [getInstance](RegistryBaseApi.md#getinstance) +- [getServicePlugin](RegistryBaseApi.md#getserviceplugin) +- [setInstanceConfig](RegistryBaseApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new RegistryBaseApi**() + +#### Inherited from + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +## Properties + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### getPriced + +▸ `Private` **getPriced**(`assetPrice`): `Promise`<[`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation)\> + +#### Parameters + +| Name | Type | +| :----------- | :---------------------------- | +| `assetPrice` | [`AssetPrice`](AssetPrice.md) | + +#### Returns + +`Promise`<[`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation)\> + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:629](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L629) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/RewardsDistributor.md b/docs/api-reference/classes/RewardsDistributor.md new file mode 100644 index 000000000..39a823b03 --- /dev/null +++ b/docs/api-reference/classes/RewardsDistributor.md @@ -0,0 +1,599 @@ +[@nevermined-io/sdk](../code-reference.md) / RewardsDistributor + +# Class: RewardsDistributor + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`RewardsDistributor`** + +## Table of contents + +### Constructors + +- [constructor](RewardsDistributor.md#constructor) + +### Properties + +- [address](RewardsDistributor.md#address) +- [contract](RewardsDistributor.md#contract) +- [contractName](RewardsDistributor.md#contractname) +- [events](RewardsDistributor.md#events) +- [version](RewardsDistributor.md#version) + +### Accessors + +- [artifactsFolder](RewardsDistributor.md#artifactsfolder) +- [circuitsFolder](RewardsDistributor.md#circuitsfolder) +- [config](RewardsDistributor.md#config) +- [instanceConfig](RewardsDistributor.md#instanceconfig) +- [instantiableConfig](RewardsDistributor.md#instantiableconfig) +- [logger](RewardsDistributor.md#logger) +- [nevermined](RewardsDistributor.md#nevermined) +- [web3](RewardsDistributor.md#web3) + +### Methods + +- [call](RewardsDistributor.md#call) +- [claimReward](RewardsDistributor.md#claimreward) +- [getFromAddress](RewardsDistributor.md#getfromaddress) +- [getInputsOfMethod](RewardsDistributor.md#getinputsofmethod) +- [getSignatureOfMethod](RewardsDistributor.md#getsignatureofmethod) +- [init](RewardsDistributor.md#init) +- [send](RewardsDistributor.md#send) +- [sendFrom](RewardsDistributor.md#sendfrom) +- [setInstanceConfig](RewardsDistributor.md#setinstanceconfig) +- [setReceivers](RewardsDistributor.md#setreceivers) +- [getInstance](RewardsDistributor.md#getinstance) +- [setInstanceConfig](RewardsDistributor.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new RewardsDistributor**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### claimReward + +▸ **claimReward**(`agreementId`, `did`, `amounts`, `receivers`, `returnAddress`, `lockPaymentAddress`, `tokenAddress`, `lockCondition`, `releaseConditions`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------- | +| `agreementId` | `string` | +| `did` | `string` | +| `amounts` | `bigint`[] | +| `receivers` | `string`[] | +| `returnAddress` | `string` | +| `lockPaymentAddress` | `string` | +| `tokenAddress` | `string` | +| `lockCondition` | `string` | +| `releaseConditions` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/royalties/RewardsDistributor.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RewardsDistributor.ts#L19) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### setReceivers + +▸ **setReceivers**(`did`, `addr`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `did` | `string` | +| `addr` | `string`[] | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/royalties/RewardsDistributor.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RewardsDistributor.ts#L16) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`RewardsDistributor`](RewardsDistributor.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`RewardsDistributor`](RewardsDistributor.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/royalties/RewardsDistributor.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RewardsDistributor.ts#L7) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/RoyaltyScheme.md b/docs/api-reference/classes/RoyaltyScheme.md new file mode 100644 index 000000000..19df0d93e --- /dev/null +++ b/docs/api-reference/classes/RoyaltyScheme.md @@ -0,0 +1,596 @@ +[@nevermined-io/sdk](../code-reference.md) / RoyaltyScheme + +# Class: RoyaltyScheme + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`RoyaltyScheme`** + + ↳↳ [`StandardRoyalties`](StandardRoyalties.md) + + ↳↳ [`CurveRoyalties`](CurveRoyalties.md) + +## Table of contents + +### Constructors + +- [constructor](RoyaltyScheme.md#constructor) + +### Properties + +- [address](RoyaltyScheme.md#address) +- [contract](RoyaltyScheme.md#contract) +- [contractName](RoyaltyScheme.md#contractname) +- [events](RoyaltyScheme.md#events) +- [version](RoyaltyScheme.md#version) + +### Accessors + +- [artifactsFolder](RoyaltyScheme.md#artifactsfolder) +- [circuitsFolder](RoyaltyScheme.md#circuitsfolder) +- [config](RoyaltyScheme.md#config) +- [instanceConfig](RoyaltyScheme.md#instanceconfig) +- [instantiableConfig](RoyaltyScheme.md#instantiableconfig) +- [logger](RoyaltyScheme.md#logger) +- [nevermined](RoyaltyScheme.md#nevermined) +- [web3](RoyaltyScheme.md#web3) + +### Methods + +- [call](RoyaltyScheme.md#call) +- [getFromAddress](RoyaltyScheme.md#getfromaddress) +- [getInputsOfMethod](RoyaltyScheme.md#getinputsofmethod) +- [getRoyalty](RoyaltyScheme.md#getroyalty) +- [getSignatureOfMethod](RoyaltyScheme.md#getsignatureofmethod) +- [init](RoyaltyScheme.md#init) +- [send](RoyaltyScheme.md#send) +- [sendFrom](RoyaltyScheme.md#sendfrom) +- [setInstanceConfig](RoyaltyScheme.md#setinstanceconfig) +- [setRoyalty](RoyaltyScheme.md#setroyalty) +- [getInstance](RoyaltyScheme.md#getinstance) +- [setInstanceConfig](RoyaltyScheme.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new RoyaltyScheme**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getRoyalty + +▸ **getRoyalty**(`did`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts#L26) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### setRoyalty + +▸ **setRoyalty**(`did`, `amount`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `did` | `string` | +| `amount` | `number` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts#L22) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `schemeName`, `schemeClass`, `optional?`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `schemeName` | `string` | `undefined` | +| `schemeClass` | `any` | `undefined` | +| `optional` | `boolean` | `true` | + +#### Returns + +`Promise`<`any`\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts#L7) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/SearchApi.md b/docs/api-reference/classes/SearchApi.md new file mode 100644 index 000000000..58bb01954 --- /dev/null +++ b/docs/api-reference/classes/SearchApi.md @@ -0,0 +1,621 @@ +[@nevermined-io/sdk](../code-reference.md) / SearchApi + +# Class: SearchApi + +Nevermined Search API. It allows the search of assets registered in Nevermined ecosystems. +You can find more information about Nevermined Metadata here: +[https://docs.nevermined.io/docs/architecture/nevermined-data](https://docs.nevermined.io/docs/architecture/nevermined-data) + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`SearchApi`** + +## Table of contents + +### Constructors + +- [constructor](SearchApi.md#constructor) + +### Accessors + +- [artifactsFolder](SearchApi.md#artifactsfolder) +- [circuitsFolder](SearchApi.md#circuitsfolder) +- [config](SearchApi.md#config) +- [instanceConfig](SearchApi.md#instanceconfig) +- [instantiableConfig](SearchApi.md#instantiableconfig) +- [logger](SearchApi.md#logger) +- [nevermined](SearchApi.md#nevermined) +- [web3](SearchApi.md#web3) + +### Methods + +- [byDID](SearchApi.md#bydid) +- [byPrice](SearchApi.md#byprice) +- [bySubscriptionContractAddress](SearchApi.md#bysubscriptioncontractaddress) +- [byText](SearchApi.md#bytext) +- [datasetsByNftContract](SearchApi.md#datasetsbynftcontract) +- [datasetsBySubscription](SearchApi.md#datasetsbysubscription) +- [query](SearchApi.md#query) +- [servicesByNftContract](SearchApi.md#servicesbynftcontract) +- [servicesBySubscription](SearchApi.md#servicesbysubscription) +- [setInstanceConfig](SearchApi.md#setinstanceconfig) +- [subscriptionsCreated](SearchApi.md#subscriptionscreated) +- [subscriptionsPurchased](SearchApi.md#subscriptionspurchased) +- [getInstance](SearchApi.md#getinstance) +- [setInstanceConfig](SearchApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new SearchApi**(`config`) + +Creates a new SearchApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/api/SearchApi.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L32) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### byDID + +▸ **byDID**(`did?`, `metadataServiceEndpoint?`): `Promise`<[`DDO`](DDO.md)\> + +Search over the assets using a keyword. + +#### Parameters + +| Name | Type | Description | +| :------------------------- | :-------------------------- | :------------------------- | +| `did?` | `string` \| [`DID`](DID.md) | DID of the asset. | +| `metadataServiceEndpoint?` | `string` | Metadata service endpoint. | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +DDO of the asset. + +#### Defined in + +[src/nevermined/api/SearchApi.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L43) + +--- + +### byPrice + +▸ **byPrice**(`minPrice`, `maxPrice`, `serviceType?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Query for assets by price. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------- | :------------------------------------------------ | :------------ | :------------------------------------------------- | +| `minPrice` | `number` | `undefined` | The minimum price to search for. | +| `maxPrice` | `number` | `undefined` | The maximum price to search for. | +| `serviceType?` | [`ServiceType`](../code-reference.md#servicetype) | `undefined` | The name of the service. Defaults to all services. | +| `offset` | `number` | `100` | | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | | +| `appId?` | `string` | `undefined` | | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +**`Example`** + +```ts +const results = await nevermined.search.byPrice(1, 20) +``` + +#### Defined in + +[src/nevermined/api/SearchApi.ts:112](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L112) + +--- + +### bySubscriptionContractAddress + +▸ **bySubscriptionContractAddress**(`contractAddress`, `nftType`, `customNestedQueries?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search for all subscription DDOs with `contractAddress` + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :---------- | :------------ | :----------------------------------------- | +| `contractAddress` | `string` | `undefined` | The address of the subscription contract | +| `nftType` | `string` | `undefined` | The nftType | +| `customNestedQueries?` | `unknown`[] | `undefined` | Custom nested queries to add to the search | +| `offset` | `number` | `100` | The number of results to return | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | The sort order | +| `appId?` | `string` | `undefined` | The appId used to filter the results | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Promise + +#### Defined in + +[src/nevermined/api/SearchApi.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L165) + +--- + +### byText + +▸ **byText**(`text`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search over the assets using a keyword. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------- | :------------ | :------------------------- | +| `text` | `string` | `undefined` | Text to filter the assets. | +| `offset` | `number` | `100` | - | +| `page` | `number` | `1` | - | +| `sort` | `string` | `'desc'` | - | +| `appId?` | `string` | `undefined` | - | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +A list of [DDO](DDO.md)s. + +#### Defined in + +[src/nevermined/api/SearchApi.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L80) + +--- + +### datasetsByNftContract + +▸ **datasetsByNftContract**(`nftContractAddress`, `nftType?`, `tokenId?`, `customNestedQueries?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search of all datasets belonging to a subscription NFT contract + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------- | :------------ | :----------------------------------------- | +| `nftContractAddress` | `string` | `undefined` | The DID of the subscription. | +| `nftType?` | [`NeverminedNFT721Type`](../enums/NeverminedNFT721Type.md) \| [`NeverminedNFT1155Type`](../enums/NeverminedNFT1155Type.md) | `undefined` | - | +| `tokenId?` | `string` | `undefined` | - | +| `customNestedQueries?` | `unknown`[] | `undefined` | Custom nested queries to add to the search | +| `offset` | `number` | `100` | The number of results to return | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | The sort order | +| `appId?` | `string` | `undefined` | The appId used to filter the results | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Promise + +#### Defined in + +[src/nevermined/api/SearchApi.ts:634](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L634) + +--- + +### datasetsBySubscription + +▸ **datasetsBySubscription**(`subscriptionDid`, `nftType?`, `customNestedQueries?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search of all datasets belonging to a subscription + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------- | :------------ | :----------------------------------------- | +| `subscriptionDid` | `string` | `undefined` | The DID of the subscription. | +| `nftType?` | [`NeverminedNFT721Type`](../enums/NeverminedNFT721Type.md) \| [`NeverminedNFT1155Type`](../enums/NeverminedNFT1155Type.md) | `undefined` | - | +| `customNestedQueries?` | `unknown`[] | `undefined` | Custom nested queries to add to the search | +| `offset` | `number` | `100` | The number of results to return | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | The sort order | +| `appId?` | `string` | `undefined` | The appId used to filter the results | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Promise + +#### Defined in + +[src/nevermined/api/SearchApi.ts:744](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L744) + +--- + +### query + +▸ **query**(`query`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search over the assets using a query. + +#### Parameters + +| Name | Type | Description | +| :------ | :-------------------------------------------- | :-------------------------- | +| `query` | [`SearchQuery`](../interfaces/SearchQuery.md) | Query to filter the assets. | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +A list of [DDO](DDO.md)s matching the query + +**`Remarks`** + +If the `appId` is set in the search query results will be filtered +returning only DDOs for that appId + +#### Defined in + +[src/nevermined/api/SearchApi.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L57) + +--- + +### servicesByNftContract + +▸ **servicesByNftContract**(`nftContractAddress`, `nftType?`, `tokenId?`, `customNestedQueries?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search of all services belonging to a subscription nft contract + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------- | :------------ | :-------------------------------------------- | +| `nftContractAddress` | `string` | `undefined` | The NFT contract address of the subscription. | +| `nftType?` | [`NeverminedNFT721Type`](../enums/NeverminedNFT721Type.md) \| [`NeverminedNFT1155Type`](../enums/NeverminedNFT1155Type.md) | `undefined` | - | +| `tokenId?` | `string` | `undefined` | - | +| `customNestedQueries?` | `unknown`[] | `undefined` | Custom nested queries to add to the search | +| `offset` | `number` | `100` | The number of results to return | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | The sort order | +| `appId?` | `string` | `undefined` | The appId used to filter the results | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Promise + +#### Defined in + +[src/nevermined/api/SearchApi.ts:474](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L474) + +--- + +### servicesBySubscription + +▸ **servicesBySubscription**(`subscriptionDid`, `nftType?`, `customNestedQueries?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search of all services belonging to a subscription + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------- | :------------ | :----------------------------------------- | +| `subscriptionDid` | `string` | `undefined` | The DID of the subscription. | +| `nftType?` | [`NeverminedNFT721Type`](../enums/NeverminedNFT721Type.md) \| [`NeverminedNFT1155Type`](../enums/NeverminedNFT1155Type.md) | `undefined` | - | +| `customNestedQueries?` | `unknown`[] | `undefined` | Custom nested queries to add to the search | +| `offset` | `number` | `100` | The number of results to return | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | The sort order | +| `appId?` | `string` | `undefined` | The appId used to filter the results | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Promise + +#### Defined in + +[src/nevermined/api/SearchApi.ts:584](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L584) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### subscriptionsCreated + +▸ **subscriptionsCreated**(`account`, `nftType?`, `customNestedQueries?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search of all subscriptions created by `account` + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------- | :------------ | :------------------------------------------ | +| `account` | [`Account`](Account.md) | `undefined` | The account that created the subscriptions. | +| `nftType?` | [`NeverminedNFT721Type`](../enums/NeverminedNFT721Type.md) \| [`NeverminedNFT1155Type`](../enums/NeverminedNFT1155Type.md) | `undefined` | The nftType | +| `customNestedQueries?` | `unknown`[] | `undefined` | Custom nested queries to add to the search | +| `offset` | `number` | `100` | The number of results to return | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | The sort order | +| `appId?` | `string` | `undefined` | The appId used to filter the results | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Promise + +#### Defined in + +[src/nevermined/api/SearchApi.ts:264](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L264) + +--- + +### subscriptionsPurchased + +▸ **subscriptionsPurchased**(`account`, `nftType?`, `ercType?`, `customNestedQueries?`, `offset?`, `page?`, `sort?`, `appId?`): `Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Search of all subscriptions purchased by `account` + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------- | :------------ | :-------------------------------------------- | +| `account` | [`Account`](Account.md) | `undefined` | The account that purchased the subscriptions. | +| `nftType?` | [`NeverminedNFT721Type`](../enums/NeverminedNFT721Type.md) \| [`NeverminedNFT1155Type`](../enums/NeverminedNFT1155Type.md) | `undefined` | The nftType | +| `ercType?` | `721` \| `1155` | `undefined` | - | +| `customNestedQueries?` | `unknown`[] | `undefined` | Custom nested queries to add to the search | +| `offset` | `number` | `100` | The number of results to return | +| `page` | `number` | `1` | | +| `sort` | `string` | `'desc'` | The sort order | +| `appId?` | `string` | `undefined` | The appId used to filter the results | + +#### Returns + +`Promise`<[`QueryResult`](../interfaces/QueryResult.md)\> + +Promise + +#### Defined in + +[src/nevermined/api/SearchApi.ts:356](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/SearchApi.ts#L356) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ServiceAgreement.md b/docs/api-reference/classes/ServiceAgreement.md new file mode 100644 index 000000000..33ee9cd45 --- /dev/null +++ b/docs/api-reference/classes/ServiceAgreement.md @@ -0,0 +1,373 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAgreement + +# Class: ServiceAgreement + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`ServiceAgreement`** + +## Table of contents + +### Constructors + +- [constructor](ServiceAgreement.md#constructor) + +### Accessors + +- [artifactsFolder](ServiceAgreement.md#artifactsfolder) +- [circuitsFolder](ServiceAgreement.md#circuitsfolder) +- [config](ServiceAgreement.md#config) +- [instanceConfig](ServiceAgreement.md#instanceconfig) +- [instantiableConfig](ServiceAgreement.md#instantiableconfig) +- [logger](ServiceAgreement.md#logger) +- [nevermined](ServiceAgreement.md#nevermined) +- [web3](ServiceAgreement.md#web3) + +### Methods + +- [createHashSignature](ServiceAgreement.md#createhashsignature) +- [getTimeValuesFromService](ServiceAgreement.md#gettimevaluesfromservice) +- [hashServiceAgreement](ServiceAgreement.md#hashserviceagreement) +- [setInstanceConfig](ServiceAgreement.md#setinstanceconfig) +- [signServiceAgreement](ServiceAgreement.md#signserviceagreement) +- [getInstance](ServiceAgreement.md#getinstance) +- [setInstanceConfig](ServiceAgreement.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ServiceAgreement**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/utils/ServiceAgreement.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/ServiceAgreement.ts#L8) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### createHashSignature + +▸ **createHashSignature**(`templateId`, `serviceAgreementId`, `valueHashes`, `timelockValues`, `timeoutValues`, `consumer`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------- | +| `templateId` | `string` | +| `serviceAgreementId` | `string` | +| `valueHashes` | `string`[] | +| `timelockValues` | `number`[] | +| `timeoutValues` | `number`[] | +| `consumer` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/ServiceAgreement.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/ServiceAgreement.ts#L42) + +--- + +### getTimeValuesFromService + +▸ `Private` **getTimeValuesFromService**(`service`, `type`): `number`[] + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceAccess`](../interfaces/ServiceAccess.md) | +| `type` | `"timeout"` \| `"timelock"` | + +#### Returns + +`number`[] + +#### Defined in + +[src/nevermined/utils/ServiceAgreement.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/ServiceAgreement.ts#L86) + +--- + +### hashServiceAgreement + +▸ **hashServiceAgreement**(`serviceAgreementTemplateId`, `serviceAgreementId`, `valueHashes`, `timelocks`, `timeouts`): `string` + +#### Parameters + +| Name | Type | +| :--------------------------- | :--------- | +| `serviceAgreementTemplateId` | `string` | +| `serviceAgreementId` | `string` | +| `valueHashes` | `string`[] | +| `timelocks` | `number`[] | +| `timeouts` | `number`[] | + +#### Returns + +`string` + +#### Defined in + +[src/nevermined/utils/ServiceAgreement.ts:66](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/ServiceAgreement.ts#L66) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### signServiceAgreement + +▸ **signServiceAgreement**(`ddo`, `serviceType`, `serviceAgreementId`, `agreementConditionsIds`, `consumer`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------------- | :------------------------------------------------ | +| `ddo` | [`DDO`](DDO.md) | +| `serviceType` | [`ServiceType`](../code-reference.md#servicetype) | +| `serviceAgreementId` | `string` | +| `agreementConditionsIds` | `string`[] | +| `consumer` | [`Account`](Account.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/ServiceAgreement.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/ServiceAgreement.ts#L13) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/ServicesApi.md b/docs/api-reference/classes/ServicesApi.md new file mode 100644 index 000000000..84ad5b9da --- /dev/null +++ b/docs/api-reference/classes/ServicesApi.md @@ -0,0 +1,388 @@ +[@nevermined-io/sdk](../code-reference.md) / ServicesApi + +# Class: ServicesApi + +Utils internal submodule of Nevermined. + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`ServicesApi`** + +## Table of contents + +### Constructors + +- [constructor](ServicesApi.md#constructor) + +### Properties + +- [aave](ServicesApi.md#aave) +- [bookmarks](ServicesApi.md#bookmarks) +- [marketplace](ServicesApi.md#marketplace) +- [metadata](ServicesApi.md#metadata) +- [node](ServicesApi.md#node) +- [permissions](ServicesApi.md#permissions) +- [profiles](ServicesApi.md#profiles) + +### Accessors + +- [artifactsFolder](ServicesApi.md#artifactsfolder) +- [circuitsFolder](ServicesApi.md#circuitsfolder) +- [config](ServicesApi.md#config) +- [instanceConfig](ServicesApi.md#instanceconfig) +- [instantiableConfig](ServicesApi.md#instantiableconfig) +- [logger](ServicesApi.md#logger) +- [nevermined](ServicesApi.md#nevermined) +- [web3](ServicesApi.md#web3) + +### Methods + +- [initializeAave](ServicesApi.md#initializeaave) +- [setInstanceConfig](ServicesApi.md#setinstanceconfig) +- [getInstance](ServicesApi.md#getinstance) +- [setInstanceConfig](ServicesApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new ServicesApi**(`config`) + +Creates a new ServicesApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L56) + +## Properties + +### aave + +• **aave**: [`AaveCredit`](AaveCredit.md) + +Aave instance. + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L49) + +--- + +### bookmarks + +• **bookmarks**: [`Bookmarks`](Bookmarks.md) + +Bookmarks instance + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L44) + +--- + +### marketplace + +• **marketplace**: [`MarketplaceApi`](MarketplaceApi.md) + +Nevermined Node Service + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L24) + +--- + +### metadata + +• **metadata**: [`MetadataService`](MetadataService.md) + +Marketplace instance. + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L29) + +--- + +### node + +• **node**: [`NeverminedNode`](NeverminedNode.md) + +Nevermined Node Service + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L19) + +--- + +### permissions + +• **permissions**: [`Permissions`](Permissions.md) + +Permissions service + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L34) + +--- + +### profiles + +• **profiles**: [`Profiles`](Profiles.md) + +Profiles instance + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L39) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### initializeAave + +▸ **initializeAave**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/nevermined/api/ServicesApi.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/ServicesApi.ts#L68) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/SignatureUtils.md b/docs/api-reference/classes/SignatureUtils.md new file mode 100644 index 000000000..6cf618b09 --- /dev/null +++ b/docs/api-reference/classes/SignatureUtils.md @@ -0,0 +1,340 @@ +[@nevermined-io/sdk](../code-reference.md) / SignatureUtils + +# Class: SignatureUtils + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`SignatureUtils`** + +## Table of contents + +### Constructors + +- [constructor](SignatureUtils.md#constructor) + +### Accessors + +- [artifactsFolder](SignatureUtils.md#artifactsfolder) +- [circuitsFolder](SignatureUtils.md#circuitsfolder) +- [config](SignatureUtils.md#config) +- [instanceConfig](SignatureUtils.md#instanceconfig) +- [instantiableConfig](SignatureUtils.md#instantiableconfig) +- [logger](SignatureUtils.md#logger) +- [nevermined](SignatureUtils.md#nevermined) +- [web3](SignatureUtils.md#web3) + +### Methods + +- [setInstanceConfig](SignatureUtils.md#setinstanceconfig) +- [signText](SignatureUtils.md#signtext) +- [verifyText](SignatureUtils.md#verifytext) +- [getInstance](SignatureUtils.md#getinstance) +- [hash](SignatureUtils.md#hash) +- [setInstanceConfig](SignatureUtils.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new SignatureUtils**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/utils/SignatureUtils.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/SignatureUtils.ts#L5) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### signText + +▸ **signText**(`text`, `address`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :----------------------- | +| `text` | `string` \| `Uint8Array` | +| `address` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/SignatureUtils.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/SignatureUtils.ts#L10) + +--- + +### verifyText + +▸ **verifyText**(`text`, `signature`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `text` | `string` | +| `signature` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/SignatureUtils.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/SignatureUtils.ts#L22) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### hash + +▸ `Static` **hash**(`seed`): `string` + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `seed` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/nevermined/utils/SignatureUtils.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/SignatureUtils.ts#L26) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/StandardRoyalties.md b/docs/api-reference/classes/StandardRoyalties.md new file mode 100644 index 000000000..d9bed58fe --- /dev/null +++ b/docs/api-reference/classes/StandardRoyalties.md @@ -0,0 +1,597 @@ +[@nevermined-io/sdk](../code-reference.md) / StandardRoyalties + +# Class: StandardRoyalties + +## Hierarchy + +- [`RoyaltyScheme`](RoyaltyScheme.md) + + ↳ **`StandardRoyalties`** + +## Table of contents + +### Constructors + +- [constructor](StandardRoyalties.md#constructor) + +### Properties + +- [address](StandardRoyalties.md#address) +- [contract](StandardRoyalties.md#contract) +- [contractName](StandardRoyalties.md#contractname) +- [events](StandardRoyalties.md#events) +- [version](StandardRoyalties.md#version) + +### Accessors + +- [artifactsFolder](StandardRoyalties.md#artifactsfolder) +- [circuitsFolder](StandardRoyalties.md#circuitsfolder) +- [config](StandardRoyalties.md#config) +- [instanceConfig](StandardRoyalties.md#instanceconfig) +- [instantiableConfig](StandardRoyalties.md#instantiableconfig) +- [logger](StandardRoyalties.md#logger) +- [nevermined](StandardRoyalties.md#nevermined) +- [web3](StandardRoyalties.md#web3) + +### Methods + +- [call](StandardRoyalties.md#call) +- [getFromAddress](StandardRoyalties.md#getfromaddress) +- [getInputsOfMethod](StandardRoyalties.md#getinputsofmethod) +- [getRoyalty](StandardRoyalties.md#getroyalty) +- [getSignatureOfMethod](StandardRoyalties.md#getsignatureofmethod) +- [init](StandardRoyalties.md#init) +- [send](StandardRoyalties.md#send) +- [sendFrom](StandardRoyalties.md#sendfrom) +- [setInstanceConfig](StandardRoyalties.md#setinstanceconfig) +- [setRoyalty](StandardRoyalties.md#setroyalty) +- [getInstance](StandardRoyalties.md#getinstance) +- [setInstanceConfig](StandardRoyalties.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new StandardRoyalties**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[constructor](RoyaltyScheme.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[address](RoyaltyScheme.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[contract](RoyaltyScheme.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[contractName](RoyaltyScheme.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[events](RoyaltyScheme.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[version](RoyaltyScheme.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RoyaltyScheme.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RoyaltyScheme.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +RoyaltyScheme.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RoyaltyScheme.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +RoyaltyScheme.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +RoyaltyScheme.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +RoyaltyScheme.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +RoyaltyScheme.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[call](RoyaltyScheme.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getFromAddress](RoyaltyScheme.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getInputsOfMethod](RoyaltyScheme.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getRoyalty + +▸ **getRoyalty**(`did`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getRoyalty](RoyaltyScheme.md#getroyalty) + +#### Defined in + +[src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts#L26) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[getSignatureOfMethod](RoyaltyScheme.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[init](RoyaltyScheme.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[send](RoyaltyScheme.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[sendFrom](RoyaltyScheme.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[setInstanceConfig](RoyaltyScheme.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### setRoyalty + +▸ **setRoyalty**(`did`, `amount`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `did` | `string` | +| `amount` | `number` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[setRoyalty](RoyaltyScheme.md#setroyalty) + +#### Defined in + +[src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/RoyaltyScheme.abstract.ts#L22) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`StandardRoyalties`](StandardRoyalties.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`StandardRoyalties`](StandardRoyalties.md)\> + +#### Overrides + +[RoyaltyScheme](RoyaltyScheme.md).[getInstance](RoyaltyScheme.md#getinstance) + +#### Defined in + +[src/keeper/contracts/royalties/StandardRoyalties.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/royalties/StandardRoyalties.ts#L5) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[RoyaltyScheme](RoyaltyScheme.md).[setInstanceConfig](RoyaltyScheme.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/SubgraphEvent.md b/docs/api-reference/classes/SubgraphEvent.md new file mode 100644 index 000000000..6a01098b5 --- /dev/null +++ b/docs/api-reference/classes/SubgraphEvent.md @@ -0,0 +1,444 @@ +[@nevermined-io/sdk](../code-reference.md) / SubgraphEvent + +# Class: SubgraphEvent + +## Hierarchy + +- [`NeverminedEvent`](NeverminedEvent.md) + + ↳ **`SubgraphEvent`** + +## Table of contents + +### Constructors + +- [constructor](SubgraphEvent.md#constructor) + +### Properties + +- [contract](SubgraphEvent.md#contract) +- [eventEmitter](SubgraphEvent.md#eventemitter) +- [subgraph](SubgraphEvent.md#subgraph) + +### Accessors + +- [artifactsFolder](SubgraphEvent.md#artifactsfolder) +- [circuitsFolder](SubgraphEvent.md#circuitsfolder) +- [config](SubgraphEvent.md#config) +- [instanceConfig](SubgraphEvent.md#instanceconfig) +- [instantiableConfig](SubgraphEvent.md#instantiableconfig) +- [logger](SubgraphEvent.md#logger) +- [nevermined](SubgraphEvent.md#nevermined) +- [web3](SubgraphEvent.md#web3) + +### Methods + +- [getBlockNumber](SubgraphEvent.md#getblocknumber) +- [getEventData](SubgraphEvent.md#geteventdata) +- [getPastEvents](SubgraphEvent.md#getpastevents) +- [once](SubgraphEvent.md#once) +- [setInstanceConfig](SubgraphEvent.md#setinstanceconfig) +- [subscribe](SubgraphEvent.md#subscribe) +- [getInstance](SubgraphEvent.md#getinstance) +- [setInstanceConfig](SubgraphEvent.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• `Protected` **new SubgraphEvent**(`contract`, `eventEmitter`) + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `contract` | [`ContractBase`](ContractBase.md) | +| `eventEmitter` | [`EventEmitter`](../interfaces/EventEmitter.md) | + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[constructor](NeverminedEvent.md#constructor) + +#### Defined in + +[src/events/NeverminedEvent.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L34) + +## Properties + +### contract + +• `Protected` **contract**: [`ContractBase`](ContractBase.md) = `null` + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[contract](NeverminedEvent.md#contract) + +#### Defined in + +[src/events/NeverminedEvent.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L29) + +--- + +### eventEmitter + +• `Protected` **eventEmitter**: [`EventEmitter`](../interfaces/EventEmitter.md) + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[eventEmitter](NeverminedEvent.md#eventemitter) + +#### Defined in + +[src/events/NeverminedEvent.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L28) + +--- + +### subgraph + +• **subgraph**: `ApolloClient`<`NormalizedCacheObject`\> + +#### Defined in + +[src/events/SubgraphEvent.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/SubgraphEvent.ts#L16) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NeverminedEvent.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NeverminedEvent.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NeverminedEvent.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NeverminedEvent.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NeverminedEvent.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NeverminedEvent.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NeverminedEvent.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NeverminedEvent.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### getBlockNumber + +▸ **getBlockNumber**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getBlockNumber](NeverminedEvent.md#getblocknumber) + +#### Defined in + +[src/events/SubgraphEvent.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/SubgraphEvent.ts#L68) + +--- + +### getEventData + +▸ **getEventData**(`options`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getEventData](NeverminedEvent.md#geteventdata) + +#### Defined in + +[src/events/SubgraphEvent.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/SubgraphEvent.ts#L46) + +--- + +### getPastEvents + +▸ **getPastEvents**(`options`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------- | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getPastEvents](NeverminedEvent.md#getpastevents) + +#### Defined in + +[src/events/SubgraphEvent.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/SubgraphEvent.ts#L64) + +--- + +### once + +▸ **once**(`callback?`, `options?`): `Promise`<[`EventResult`](../code-reference.md#eventresult)\> + +#### Parameters + +| Name | Type | +| :---------- | :------------------------------------------------------------------------ | +| `callback?` | (`events`: [`EventResult`](../code-reference.md#eventresult)[]) => `void` | +| `options?` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +`Promise`<[`EventResult`](../code-reference.md#eventresult)\> + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[once](NeverminedEvent.md#once) + +#### Defined in + +[src/events/NeverminedEvent.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L54) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[setInstanceConfig](NeverminedEvent.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### subscribe + +▸ **subscribe**(`callback`, `options`): [`ContractEventSubscription`](../interfaces/ContractEventSubscription.md) + +#### Parameters + +| Name | Type | +| :--------- | :------------------------------------------------------------------------ | +| `callback` | (`events`: [`EventResult`](../code-reference.md#eventresult)[]) => `void` | +| `options` | [`EventOptions`](../interfaces/EventOptions.md) | + +#### Returns + +[`ContractEventSubscription`](../interfaces/ContractEventSubscription.md) + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[subscribe](NeverminedEvent.md#subscribe) + +#### Defined in + +[src/events/NeverminedEvent.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L40) + +--- + +### getInstance + +▸ `Static` **getInstance**(`contract`, `eventEmitter`, `graphHttpUri`, `networkName`): [`SubgraphEvent`](SubgraphEvent.md) + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------- | +| `contract` | [`ContractBase`](ContractBase.md) | +| `eventEmitter` | [`EventEmitter`](../interfaces/EventEmitter.md) | +| `graphHttpUri` | `string` | +| `networkName` | `string` | + +#### Returns + +[`SubgraphEvent`](SubgraphEvent.md) + +#### Overrides + +[NeverminedEvent](NeverminedEvent.md).[getInstance](NeverminedEvent.md#getinstance) + +#### Defined in + +[src/events/SubgraphEvent.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/SubgraphEvent.ts#L18) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NeverminedEvent](NeverminedEvent.md).[setInstanceConfig](NeverminedEvent.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/utils.SubscribableObserver.md b/docs/api-reference/classes/SubscribableObserver.md similarity index 69% rename from docs/api-reference/classes/utils.SubscribableObserver.md rename to docs/api-reference/classes/SubscribableObserver.md index 78ca38ddf..8e067fd3d 100644 --- a/docs/api-reference/classes/utils.SubscribableObserver.md +++ b/docs/api-reference/classes/SubscribableObserver.md @@ -1,9 +1,7 @@ -[@nevermined-io/sdk](../code-reference.md) / [utils](../modules/utils.md) / SubscribableObserver +[@nevermined-io/sdk](../code-reference.md) / SubscribableObserver # Class: SubscribableObserver -[utils](../modules/utils.md).SubscribableObserver - ## Type parameters | Name | @@ -15,21 +13,21 @@ ### Constructors -- [constructor](utils.SubscribableObserver.md#constructor) +- [constructor](SubscribableObserver.md#constructor) ### Properties -- [completed](utils.SubscribableObserver.md#completed) -- [subscriptions](utils.SubscribableObserver.md#subscriptions) +- [completed](SubscribableObserver.md#completed) +- [subscriptions](SubscribableObserver.md#subscriptions) ### Methods -- [complete](utils.SubscribableObserver.md#complete) -- [emit](utils.SubscribableObserver.md#emit) -- [error](utils.SubscribableObserver.md#error) -- [next](utils.SubscribableObserver.md#next) -- [subscribe](utils.SubscribableObserver.md#subscribe) -- [unsubscribe](utils.SubscribableObserver.md#unsubscribe) +- [complete](SubscribableObserver.md#complete) +- [emit](SubscribableObserver.md#emit) +- [error](SubscribableObserver.md#error) +- [next](SubscribableObserver.md#next) +- [subscribe](SubscribableObserver.md#subscribe) +- [unsubscribe](SubscribableObserver.md#unsubscribe) ## Constructors @@ -52,7 +50,7 @@ #### Defined in -[src/utils/SubscribableObserver.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L2) +[src/utils/SubscribableObserver.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L2) --- @@ -62,7 +60,7 @@ #### Defined in -[src/utils/SubscribableObserver.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L4) +[src/utils/SubscribableObserver.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L4) ## Methods @@ -82,7 +80,7 @@ #### Defined in -[src/utils/SubscribableObserver.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L30) +[src/utils/SubscribableObserver.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L30) --- @@ -103,7 +101,7 @@ #### Defined in -[src/utils/SubscribableObserver.ts:40](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L40) +[src/utils/SubscribableObserver.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L40) --- @@ -123,7 +121,7 @@ #### Defined in -[src/utils/SubscribableObserver.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L35) +[src/utils/SubscribableObserver.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L35) --- @@ -143,7 +141,7 @@ #### Defined in -[src/utils/SubscribableObserver.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L26) +[src/utils/SubscribableObserver.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L26) --- @@ -169,7 +167,7 @@ #### Defined in -[src/utils/SubscribableObserver.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L10) +[src/utils/SubscribableObserver.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L10) --- @@ -183,4 +181,4 @@ #### Defined in -[src/utils/SubscribableObserver.ts:47](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribableObserver.ts#L47) +[src/utils/SubscribableObserver.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribableObserver.ts#L47) diff --git a/docs/api-reference/classes/utils.SubscribablePromise.md b/docs/api-reference/classes/SubscribablePromise.md similarity index 54% rename from docs/api-reference/classes/utils.SubscribablePromise.md rename to docs/api-reference/classes/SubscribablePromise.md index cf62d4520..13eda781b 100644 --- a/docs/api-reference/classes/utils.SubscribablePromise.md +++ b/docs/api-reference/classes/SubscribablePromise.md @@ -1,9 +1,7 @@ -[@nevermined-io/sdk](../code-reference.md) / [utils](../modules/utils.md) / SubscribablePromise +[@nevermined-io/sdk](../code-reference.md) / SubscribablePromise # Class: SubscribablePromise -[utils](../modules/utils.md).SubscribablePromise - ## Type parameters | Name | @@ -15,21 +13,21 @@ ### Constructors -- [constructor](utils.SubscribablePromise.md#constructor) +- [constructor](SubscribablePromise.md#constructor) ### Properties -- [observer](utils.SubscribablePromise.md#observer) -- [promise](utils.SubscribablePromise.md#promise) +- [observer](SubscribablePromise.md#observer) +- [promise](SubscribablePromise.md#promise) ### Methods -- [catch](utils.SubscribablePromise.md#catch) -- [finally](utils.SubscribablePromise.md#finally) -- [init](utils.SubscribablePromise.md#init) -- [next](utils.SubscribablePromise.md#next) -- [subscribe](utils.SubscribablePromise.md#subscribe) -- [then](utils.SubscribablePromise.md#then) +- [catch](SubscribablePromise.md#catch) +- [finally](SubscribablePromise.md#finally) +- [init](SubscribablePromise.md#init) +- [next](SubscribablePromise.md#next) +- [subscribe](SubscribablePromise.md#subscribe) +- [then](SubscribablePromise.md#then) ## Constructors @@ -46,39 +44,39 @@ #### Parameters -| Name | Type | -| :--------- | :------------------------------------------------------------------------------------------------------------ | -| `executor` | (`observer`: [`SubscribableObserver`](utils.SubscribableObserver.md)<`T`, `P`\>) => `void` \| `Promise`<`P`\> | +| Name | Type | +| :--------- | :------------------------------------------------------------------------------------------------------ | +| `executor` | (`observer`: [`SubscribableObserver`](SubscribableObserver.md)<`T`, `P`\>) => `void` \| `Promise`<`P`\> | #### Defined in -[src/utils/SubscribablePromise.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L15) +[src/utils/SubscribablePromise.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L15) ## Properties ### observer -• `Private` **observer**: [`SubscribableObserver`](utils.SubscribableObserver.md)<`T`, `P`\> +• `Private` **observer**: [`SubscribableObserver`](SubscribableObserver.md)<`T`, `P`\> #### Defined in -[src/utils/SubscribablePromise.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L4) +[src/utils/SubscribablePromise.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L4) --- ### promise -• `Private` **promise**: `Promise`<`P`\> & [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +• `Private` **promise**: `Promise`<`P`\> & [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Defined in -[src/utils/SubscribablePromise.ts:6](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L6) +[src/utils/SubscribablePromise.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L6) ## Methods ### catch -▸ **catch**(`onrejected?`): `Promise`<`any`\> & [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +▸ **catch**(`onrejected?`): `Promise`<`any`\> & [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Parameters @@ -88,17 +86,17 @@ #### Returns -`Promise`<`any`\> & [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +`Promise`<`any`\> & [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Defined in -[src/utils/SubscribablePromise.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L33) +[src/utils/SubscribablePromise.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L33) --- ### finally -▸ **finally**(`onfinally?`): `Promise`<`P`\> & [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +▸ **finally**(`onfinally?`): `Promise`<`P`\> & [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Parameters @@ -108,11 +106,11 @@ #### Returns -`Promise`<`P`\> & [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +`Promise`<`P`\> & [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Defined in -[src/utils/SubscribablePromise.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L37) +[src/utils/SubscribablePromise.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L37) --- @@ -122,9 +120,9 @@ #### Parameters -| Name | Type | -| :--------- | :------------------------------------------------------------------------------------------------------------ | -| `executor` | (`observer`: [`SubscribableObserver`](utils.SubscribableObserver.md)<`T`, `P`\>) => `void` \| `Promise`<`P`\> | +| Name | Type | +| :--------- | :------------------------------------------------------------------------------------------------------ | +| `executor` | (`observer`: [`SubscribableObserver`](SubscribableObserver.md)<`T`, `P`\>) => `void` \| `Promise`<`P`\> | #### Returns @@ -132,13 +130,13 @@ #### Defined in -[src/utils/SubscribablePromise.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L41) +[src/utils/SubscribablePromise.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L41) --- ### next -▸ **next**(`onNext`): [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +▸ **next**(`onNext`): [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Parameters @@ -148,11 +146,11 @@ #### Returns -[`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +[`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Defined in -[src/utils/SubscribablePromise.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L24) +[src/utils/SubscribablePromise.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L24) --- @@ -176,13 +174,13 @@ #### Defined in -[src/utils/SubscribablePromise.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L20) +[src/utils/SubscribablePromise.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L20) --- ### then -▸ **then**(`onfulfilled?`, `onrejected?`): `Promise`<`any`\> & [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +▸ **then**(`onfulfilled?`, `onrejected?`): `Promise`<`any`\> & [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Parameters @@ -193,8 +191,8 @@ #### Returns -`Promise`<`any`\> & [`SubscribablePromise`](utils.SubscribablePromise.md)<`T`, `P`\> +`Promise`<`any`\> & [`SubscribablePromise`](SubscribablePromise.md)<`T`, `P`\> #### Defined in -[src/utils/SubscribablePromise.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/SubscribablePromise.ts#L29) +[src/utils/SubscribablePromise.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/SubscribablePromise.ts#L29) diff --git a/docs/api-reference/classes/SubscriptionCreditsNFTApi.md b/docs/api-reference/classes/SubscriptionCreditsNFTApi.md new file mode 100644 index 000000000..c7acd2ede --- /dev/null +++ b/docs/api-reference/classes/SubscriptionCreditsNFTApi.md @@ -0,0 +1,1719 @@ +[@nevermined-io/sdk](../code-reference.md) / SubscriptionCreditsNFTApi + +# Class: SubscriptionCreditsNFTApi + +Allows the interaction with external ERC-1155 NFT contracts built on top of the Nevermined NFT extra features. + +## Hierarchy + +- [`NFT1155Api`](NFT1155Api.md) + + ↳ **`SubscriptionCreditsNFTApi`** + +## Table of contents + +### Constructors + +- [constructor](SubscriptionCreditsNFTApi.md#constructor) + +### Properties + +- [nftContract](SubscriptionCreditsNFTApi.md#nftcontract) +- [servicePlugin](SubscriptionCreditsNFTApi.md#serviceplugin) + +### Accessors + +- [address](SubscriptionCreditsNFTApi.md#address) +- [artifactsFolder](SubscriptionCreditsNFTApi.md#artifactsfolder) +- [circuitsFolder](SubscriptionCreditsNFTApi.md#circuitsfolder) +- [config](SubscriptionCreditsNFTApi.md#config) +- [getContract](SubscriptionCreditsNFTApi.md#getcontract) +- [instanceConfig](SubscriptionCreditsNFTApi.md#instanceconfig) +- [instantiableConfig](SubscriptionCreditsNFTApi.md#instantiableconfig) +- [logger](SubscriptionCreditsNFTApi.md#logger) +- [nevermined](SubscriptionCreditsNFTApi.md#nevermined) +- [web3](SubscriptionCreditsNFTApi.md#web3) + +### Methods + +- [\_details](SubscriptionCreditsNFTApi.md#_details) +- [access](SubscriptionCreditsNFTApi.md#access) +- [addRating](SubscriptionCreditsNFTApi.md#addrating) +- [balance](SubscriptionCreditsNFTApi.md#balance) +- [burn](SubscriptionCreditsNFTApi.md#burn) +- [burnFromHolder](SubscriptionCreditsNFTApi.md#burnfromholder) +- [buySecondaryMarketNft](SubscriptionCreditsNFTApi.md#buysecondarymarketnft) +- [claim](SubscriptionCreditsNFTApi.md#claim) +- [claimNFT](SubscriptionCreditsNFTApi.md#claimnft) +- [create](SubscriptionCreditsNFTApi.md#create) +- [details](SubscriptionCreditsNFTApi.md#details) +- [getSubscriptionToken](SubscriptionCreditsNFTApi.md#getsubscriptiontoken) +- [grantOperatorRole](SubscriptionCreditsNFTApi.md#grantoperatorrole) +- [isApprovedForAll](SubscriptionCreditsNFTApi.md#isapprovedforall) +- [isOperator](SubscriptionCreditsNFTApi.md#isoperator) +- [isOperatorOfDID](SubscriptionCreditsNFTApi.md#isoperatorofdid) +- [list](SubscriptionCreditsNFTApi.md#list) +- [listOnSecondaryMarkets](SubscriptionCreditsNFTApi.md#listonsecondarymarkets) +- [mint](SubscriptionCreditsNFTApi.md#mint) +- [order](SubscriptionCreditsNFTApi.md#order) +- [orderAsset](SubscriptionCreditsNFTApi.md#orderasset) +- [owner](SubscriptionCreditsNFTApi.md#owner) +- [registerNeverminedAsset](SubscriptionCreditsNFTApi.md#registerneverminedasset) +- [releaseRewards](SubscriptionCreditsNFTApi.md#releaserewards) +- [releaseSecondaryMarketRewards](SubscriptionCreditsNFTApi.md#releasesecondarymarketrewards) +- [resolveAsset](SubscriptionCreditsNFTApi.md#resolveasset) +- [revokeOperatorRole](SubscriptionCreditsNFTApi.md#revokeoperatorrole) +- [setApprovalForAll](SubscriptionCreditsNFTApi.md#setapprovalforall) +- [setInstanceConfig](SubscriptionCreditsNFTApi.md#setinstanceconfig) +- [transfer](SubscriptionCreditsNFTApi.md#transfer) +- [updateAsset](SubscriptionCreditsNFTApi.md#updateasset) +- [deployInstance](SubscriptionCreditsNFTApi.md#deployinstance) +- [getInstance](SubscriptionCreditsNFTApi.md#getinstance) +- [getInstanceUsingABI](SubscriptionCreditsNFTApi.md#getinstanceusingabi) +- [getNFTContractAddress](SubscriptionCreditsNFTApi.md#getnftcontractaddress) +- [getServicePlugin](SubscriptionCreditsNFTApi.md#getserviceplugin) +- [setInstanceConfig](SubscriptionCreditsNFTApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new SubscriptionCreditsNFTApi**() + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[constructor](NFT1155Api.md#constructor) + +## Properties + +### nftContract + +• **nftContract**: [`Nft1155Contract`](Nft1155Contract.md) + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[nftContract](NFT1155Api.md#nftcontract) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L22) + +--- + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[servicePlugin](NFT1155Api.md#serviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### address + +• `get` **address**(): `string` + +Gets the ERC-721 NFT Contract address + +#### Returns + +`string` + +The NFT contract address + +#### Inherited from + +NFT1155Api.address + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:60](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L60) + +--- + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFT1155Api.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFT1155Api.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NFT1155Api.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### getContract + +• `get` **getContract**(): [`Nft1155Contract`](Nft1155Contract.md) + +Gets the instance of the ERC-1155 NFT Contract where the API is connected + +#### Returns + +[`Nft1155Contract`](Nft1155Contract.md) + +The `Nft1155Contract` instance + +#### Inherited from + +NFT1155Api.getContract + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L68) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFT1155Api.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFT1155Api.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NFT1155Api.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NFT1155Api.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NFT1155Api.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_details + +▸ `Protected` **\_details**(`did`, `ercType`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `ercType` | [`ERCType`](../enums/ERCType.md) | The type of NFT used | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[\_details](NFT1155Api.md#_details) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L150) + +--- + +### access + +▸ **access**(`did`, `consumer`, `destination?`, `fileIndex?`, `agreementId?`, `buyer?`, `babysig?`, `serviceReference?`): `Promise`<`boolean`\> + +Access the files associated with an NFT. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `consumer` | [`Account`](Account.md) | `undefined` | The NFT holder account. | +| `destination?` | `string` | `undefined` | The download destination for the files. | +| `fileIndex?` | `number` | `undefined` | The index of the file. If unset will download all the files in the asset. | +| `agreementId` | `string` | `'0x'` | The NFT sales agreement id. | +| `buyer?` | `string` | `undefined` | Key which represent the buyer | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | - | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service reference to use. By default is nft-access. | + +#### Returns + +`Promise`<`boolean`\> + +true if the access was successful or file if isToDownload is false. + +**`Remarks`** + +This function will call the Node that will check if all the access conditions where fulfilled +before providing the files. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.access(ddo.id, collector, '/tmp/') +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[access](NFT1155Api.md#access) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:419](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L419) + +--- + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[addRating](NFT1155Api.md#addrating) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### balance + +▸ **balance**(`did`, `account`): `Promise`<`bigint`\> + +Get the NFT balance for a particular did associated to an account/address + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `account` | `string` \| [`Account`](Account.md) | The account/address to check the balance of. | + +#### Returns + +`Promise`<`bigint`\> + +The number of editions of a NFT owned by the account/address. + +**`Example`** + +```ts +const balance = await nevermined.nfts1155.balance(ddo.id, artist) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[balance](NFT1155Api.md#balance) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:466](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L466) + +--- + +### burn + +▸ **burn**(`tokenId`, `nftAmount`, `account`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Burn NFTs associated with an asset. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `tokenId` | `string` | The Decentralized Identifier of the NFT asset. | +| `nftAmount` | `bigint` | The amount of NFTs to burn. | +| `account` | [`Account`](Account.md) | The account of the publisher of the NFT. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +The publisher can only burn NFTs that it owns. NFTs that were already transferred cannot be burned by the publisher. + +**`Example`** + +```ts +await nevermined.nfts1155.burn(did, 2n, artist) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[burn](NFT1155Api.md#burn) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:185](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L185) + +--- + +### burnFromHolder + +▸ **burnFromHolder**(`holder`, `tokenId`, `nftAmount`, `account`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Burn NFTs associated with an asset of a specific account. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :---------------------------------------------- | +| `holder` | `string` | The address of the account that holds the NFTs. | +| `tokenId` | `string` | The TokenId of the NFT | +| `nftAmount` | `bigint` | The amount of NFTs to burn. | +| `account` | `string` \| [`Account`](Account.md) | The account of the publisher of the NFT. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +The publisher can only burn NFTs of an account if is an operator. NFTs that were already transferred cannot be burned by the publisher. + +**`Example`** + +```ts +await nevermined.nfts1155.burnTo(holder, tokenId, 2n, artist) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[burnFromHolder](NFT1155Api.md#burnfromholder) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L213) + +--- + +### buySecondaryMarketNft + +▸ **buySecondaryMarketNft**(`consumer`, `nftAmount?`, `agreementIdSeed`, `conditionsTimeout?`, `txParams?`): `Promise`<`boolean`\> + +Buys a number of listed NFTs on secondary markets. + +#### Parameters + +| Name | Type | Description | +| :------------------ | :---------------------------------------------- | :----------------------------------------- | +| `consumer` | [`Account`](Account.md) | The account of the buyer/consumer. | +| `nftAmount` | `bigint` | The number of assets to buy. 1 by default. | +| `agreementIdSeed` | `string` | - | +| `conditionsTimeout` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`boolean`\> + +true if the buy was successful. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.buySecondaryMarketNft(collector, 1n, agreementId) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error buying the NFT. + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[buySecondaryMarketNft](NFT1155Api.md#buysecondarymarketnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:341](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L341) + +--- + +### claim + +▸ **claim**(`agreementId`, `nftHolder`, `nftReceiver`, `numberEditions?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Description | +| :--------------- | :------- | :--------------------------------------------------------------------------- | +| `agreementId` | `string` | The NFT sales agreement id. | +| `nftHolder` | `string` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | The address where the NFT should be transferred. | +| `numberEditions` | `bigint` | The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 | +| `did?` | `string` | The Decentralized Identifier of the asset. | +| `serviceIndex?` | `number` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim(agreementId, editor.getId(), subscriber.getId(), 1n) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[claim](NFT1155Api.md#claim) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:321](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L321) + +--- + +### claimNFT + +▸ `Protected` **claimNFT**(`agreementId`, `nftHolder`, `nftReceiver`, `numberEditions?`, `ercType?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------- | :------------------------------- | :------------ | :--------------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `nftHolder` | `string` | `undefined` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | `undefined` | The address where the NFT should be transferred. | +| `numberEditions` | `bigint` | `undefined` | The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The Type of the NFT ERC (1155 or 721). | +| `did?` | `string` | `undefined` | The DID of the asset. | +| `serviceIndex?` | `number` | `undefined` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim( + agreementId, + editor.getId(), + subscriber.getId(), + nftAmount, + 721, +) +``` + +**`Throws`** + +[NFTError](NFTError.md) if Nevermined is not an operator for this NFT + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[claimNFT](NFT1155Api.md#claimnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L50) + +--- + +### create + +▸ **create**(`nftAttributes`, `publisher`, `publicationOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +Creates a new Nevermined asset associated to a NFT (ERC-1155). + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `nftAttributes` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The newly registered [DDO](DDO.md). + +**`Example`** + +```ts +const assetAttributes = AssetAttributes.getInstance({ + metadata, + price: assetPrice, + serviceTypes: ['nft-sales', 'nft-access'], +}) +const nftAttributes = NFTAttributes.getNFT1155Instance({ + ...assetAttributes, + nftContractAddress: nftUpgradeable.address, + cap: cappedAmount, + amount: numberNFTs, + royaltyAttributes, + preMint, +}) +const ddo = await nevermined.nfts1155.create(nftAttributes, publisher) +``` + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[create](NFT1155Api.md#create) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:103](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L103) + +--- + +### details + +▸ **details**(`did`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[details](NFT1155Api.md#details) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:679](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L679) + +--- + +### getSubscriptionToken + +▸ **getSubscriptionToken**(`did`, `account`): `Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +Get a JWT token for an asset associated with a webService + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------- | :----------------------------------------------------------------------------- | +| `did` | `string` | The did of the asset with a webService resource and an associated subscription | +| `account` | [`Account`](Account.md) | Account of the user requesting the token | + +#### Returns + +`Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +[SubscriptionToken](../interfaces/SubscriptionToken.md) + +**`Example`** + +```ts +const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) + +assert.isDefined(response.accessToken) +assert.isDefined(response.neverminedProxyUri) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[getSubscriptionToken](NFT1155Api.md#getsubscriptiontoken) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:478](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L478) + +--- + +### grantOperatorRole + +▸ **grantOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Adds a minter (`minterAddress`) to the NFT Contract. +Granting and revoking minting permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :--------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be added as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account giving operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts1155.grantOperatorRole(someoneElse, artist) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[grantOperatorRole](NFT1155Api.md#grantoperatorrole) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:625](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L625) + +--- + +### isApprovedForAll + +▸ **isApprovedForAll**(`operatorAddress`, `from`): `Promise`<`unknown`\> + +Returns if the `operatorAddress` is approved + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------- | :--------------------------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address to check the permissions | +| `from` | `string` | The address of the account granting or revoking the permissions via `setApprovalForAll`. | + +#### Returns + +`Promise`<`unknown`\> + +Boolean saying if the `operatorAddress` is approved + +**`See`** + +[claim](NFT1155Api.md#claim) + +**`Example`** + +```ts +await nevermined.nfts1155.isApprovedForAll(someoneElse, artist.getId()) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[isApprovedForAll](NFT1155Api.md#isapprovedforall) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:540](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L540) + +--- + +### isOperator + +▸ **isOperator**(`nftContractAddress`, `operatorAddress`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of given a NFT address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------- | :------------------------------- | :------------ | :-------------------------------------- | +| `nftContractAddress` | `string` | `undefined` | The DID of the NFT to check | +| `operatorAddress` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[isOperator](NFT1155Api.md#isoperator) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L116) + +--- + +### isOperatorOfDID + +▸ **isOperatorOfDID**(`did`, `address`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of a DID. + +#### Parameters + +| Name | Type | Default value | Description | +| :-------- | :------------------------------- | :------------ | :-------------------------------------- | +| `did` | `string` | `undefined` | The DID of the NFT to check | +| `address` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[isOperatorOfDID](NFT1155Api.md#isoperatorofdid) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:91](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L91) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[list](NFT1155Api.md#list) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### listOnSecondaryMarkets + +▸ **listOnSecondaryMarkets**(`ddo`, `assetPrice`, `nftAmount`, `nftTransfer`, `provider`, `token`, `owner`): `Promise`<`string`\> + +After purchase re-list an NFT to enable secondary market sales. + +#### Parameters + +| Name | Type | Description | +| :------------ | :---------------------------- | :----------------------------------------------------------- | +| `ddo` | [`DDO`](DDO.md) | The DDO of the asset. | +| `assetPrice` | [`AssetPrice`](AssetPrice.md) | The current setup of asset rewards. | +| `nftAmount` | `bigint` | The number of NFTs put up for secondary sale. | +| `nftTransfer` | `boolean` | - | +| `provider` | `string` | The address that will be the provider of the secondary sale. | +| `token` | [`Token`](Token.md) | - | +| `owner` | [`Account`](Account.md) | The account of the current owner. | + +#### Returns + +`Promise`<`string`\> + +the agreementId of the secondary sale. + +**`Example`** + +```ts +const agreementId = await nevermined.nfts1155.listOnSecondaryMarkets( + ddo, + assetPrice, + numberNFTs, + collector.getId(), + token, + collector.getId(), +) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error listing the NFT. + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[listOnSecondaryMarkets](NFT1155Api.md#listonsecondarymarkets) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:260](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L260) + +--- + +### mint + +▸ **mint**(`did`, `nftAmount`, `receiver`, `account`, `data?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Mint NFTs associated with an asset. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :-------------------------------------------------------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `nftAmount` | `bigint` | The amount of NFTs to mint. | +| `receiver` | `string` | Account address of the NFT receiver, if `undefined` the minter account will receive the NFT/s | +| `account` | [`Account`](Account.md) | The account to mint the NFT. \* | +| `data?` | `string` | Data | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. + +**`Example`** + +```ts +await nevermined.nfts1155.mint(did, 10n, artist) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[mint](NFT1155Api.md#mint) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:145](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L145) + +--- + +### order + +▸ **order**(`did`, `numberEditions`, `consumer`, `serviceReference?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Buy NFTs. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :------------------------------------------------------------- | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `numberEditions` | `bigint` | `undefined` | The amount of NFTs to buy. | +| `consumer` | [`Account`](Account.md) | `undefined` | The account of the NFT buyer. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to order | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +**`Remarks`** + +This will lock the funds of the consumer in escrow pending the transfer of the NFTs +from the publisher. + +**`Example`** + +```ts +agreementId = await nevermined.nfts1155.order(ddo.id, numberNFTs, collector) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[order](NFT1155Api.md#order) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:252](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L252) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[orderAsset](NFT1155Api.md#orderasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### owner + +▸ **owner**(): `Promise`<`string`\> + +Gets the contract owner + +#### Returns + +`Promise`<`string`\> + +Address of the contract owner + +**`Example`** + +```ts +const nftContractOwner = new Account(await nevermined.nfts1155.owner()) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[owner](NFT1155Api.md#owner) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:485](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L485) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[registerNeverminedAsset](NFT1155Api.md#registerneverminedasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### releaseRewards + +▸ **releaseRewards**(`agreementId`, `did`, `serviceReference?`, `nftAmount`, `publisher`, `txParams?`): `Promise`<`boolean`\> + +Release the funds from escrow. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to release rewards | +| `nftAmount` | `bigint` | `undefined` | The amount of NFTs to transfer. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the funds release was successful. + +**`Remarks`** + +A publisher is able to release the funds put on escrow by the consumer after transferring the NFTs. + +**`Example`** + +```ts +const receipt = await nevermined.nfts1155.releaseRewards(agreementId, ddo.id, numberNFTs, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[releaseRewards](NFT1155Api.md#releaserewards) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:424](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L424) + +--- + +### releaseSecondaryMarketRewards + +▸ **releaseSecondaryMarketRewards**(`owner`, `consumer`, `agreementIdSeed`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Used to release the secondary market NFT & the locked rewards. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------- | +| `owner` | [`Account`](Account.md) | `undefined` | The owner account. | +| `consumer` | [`Account`](Account.md) | `undefined` | The consumer account. | +| `agreementIdSeed` | `string` | `undefined` | the Id of the underlying service agreement seed. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to release rewards | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the transaction was successful. + +**`Example`** + +```ts +// TODO +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards. + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[releaseSecondaryMarketRewards](NFT1155Api.md#releasesecondarymarketrewards) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:562](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L562) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[resolveAsset](NFT1155Api.md#resolveasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### revokeOperatorRole + +▸ **revokeOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Revokes an address (`operatorAddress`) of the NFT Contract as operator. +Granting and revoking minting permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be revoked as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account revoking operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts1155.revokeOperatorRole(someoneElse, artist) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[revokeOperatorRole](NFT1155Api.md#revokeoperatorrole) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:651](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L651) + +--- + +### setApprovalForAll + +▸ **setApprovalForAll**(`operatorAddress`, `approved`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Enable or disable NFT permissions for an operator. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address that of the operator we want to give transfer rights to. | +| `approved` | `boolean` | Give or remove transfer rights from the operator. | +| `from` | [`Account`](Account.md) | The account that wants to give transfer rights to the operator. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction additional parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceiptnReceiptnReceipt + +**`See`** + +[claim](NFT1155Api.md#claim) + +**`Example`** + +```ts +await nevermined.nfts1155.setApprovalForAll(someoneElse, true, artist) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[setApprovalForAll](NFT1155Api.md#setapprovalforall) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:510](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L510) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[setInstanceConfig](NFT1155Api.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transfer + +▸ **transfer**(`agreementId`, `did`, `nftAmount`, `publisher`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Transfer NFTs to the consumer. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :---------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `nftAmount` | `bigint` | `undefined` | The number of NFTs to transfer. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to transfer | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +A publisher/provider will check if the consumer put the funds in escrow and +execute the transfer in order to be able to release the rewards. + +**`Example`** + +```ts +const receipt = await nevermined.nfts1155.transfer(agreementId, ddo.id, numberNFTs, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error transferring the NFT + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[transfer](NFT1155Api.md#transfer) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:368](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L368) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[updateAsset](NFT1155Api.md#updateasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### deployInstance + +▸ `Static` **deployInstance**(`config`, `contractABI`, `from`, `args?`): `Promise`<[`SubscriptionCreditsNFTApi`](SubscriptionCreditsNFTApi.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------------------------------------------ | :------------ | +| `config` | [`NeverminedOptions`](NeverminedOptions.md) | `undefined` | +| `contractABI` | `any` | `undefined` | +| `from` | [`Account`](Account.md) | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`Promise`<[`SubscriptionCreditsNFTApi`](SubscriptionCreditsNFTApi.md)\> + +#### Defined in + +[src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts#L26) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `nftContractInstance?`, `nftContractAddress?`): `Promise`<[`NFT1155Api`](NFT1155Api.md)\> + +Create a new Nevermined NFTs (ERC-1155) instance allowing to interact with that kind of NFTs. + +#### Parameters + +| Name | Type | Description | +| :--------------------- | :---------------------------------------------------------- | :---------------------------------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | - | +| `nftContractInstance?` | [`Nft1155Contract`](Nft1155Contract.md) | If there is already deployed an instance of `Nft1155Contract` | +| `nftContractAddress?` | `string` | If the `Nft1155Contract` is deployed in an address it will connect to that contract | + +#### Returns + +`Promise`<[`NFT1155Api`](NFT1155Api.md)\> + +The NFTs 1155 API instance [NFT1155Api](NFT1155Api.md). + +**`Example`** + +```ts +nfts1155 = await Nft1155Api.getInstance(instanceConfig, nft1155Contract) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[getInstance](NFT1155Api.md#getinstance) + +#### Defined in + +[src/nevermined/api/nfts/NFT1155Api.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT1155Api.ts#L40) + +--- + +### getInstanceUsingABI + +▸ `Static` **getInstanceUsingABI**(`config`, `nftContractAddress`, `solidityABI`): `Promise`<[`SubscriptionCreditsNFTApi`](SubscriptionCreditsNFTApi.md)\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | +| `nftContractAddress` | `string` | +| `solidityABI` | `any` | + +#### Returns + +`Promise`<[`SubscriptionCreditsNFTApi`](SubscriptionCreditsNFTApi.md)\> + +#### Defined in + +[src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts#L9) + +--- + +### getNFTContractAddress + +▸ `Static` **getNFTContractAddress**(`ddo`, `serviceReference?`): `any` + +Gets the NFT contract address associated with a Nevermined asset from the DDO. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------ | +| `ddo` | [`DDO`](DDO.md) | `undefined` | The DDO of the asset. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service type to look for the contract address | + +#### Returns + +`any` + +The NFT contract address. + +**`Example`** + +```ts +const nftContractAddress = NFT1155Api.getNFTContractAddress(ddo) +``` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[getNFTContractAddress](NFT1155Api.md#getnftcontractaddress) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:219](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L219) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[getServicePlugin](NFT1155Api.md#getserviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFT1155Api](NFT1155Api.md).[setInstanceConfig](NFT1155Api.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/SubscriptionNFTApi.md b/docs/api-reference/classes/SubscriptionNFTApi.md new file mode 100644 index 000000000..7b535a31d --- /dev/null +++ b/docs/api-reference/classes/SubscriptionNFTApi.md @@ -0,0 +1,1809 @@ +[@nevermined-io/sdk](../code-reference.md) / SubscriptionNFTApi + +# Class: SubscriptionNFTApi + +Allows the interaction with external ERC-721 NFT contracts built on top of the Nevermined NFT extra features. + +## Hierarchy + +- [`NFT721Api`](NFT721Api.md) + + ↳ **`SubscriptionNFTApi`** + +## Table of contents + +### Constructors + +- [constructor](SubscriptionNFTApi.md#constructor) + +### Properties + +- [nftContract](SubscriptionNFTApi.md#nftcontract) +- [servicePlugin](SubscriptionNFTApi.md#serviceplugin) + +### Accessors + +- [address](SubscriptionNFTApi.md#address) +- [artifactsFolder](SubscriptionNFTApi.md#artifactsfolder) +- [circuitsFolder](SubscriptionNFTApi.md#circuitsfolder) +- [config](SubscriptionNFTApi.md#config) +- [getContract](SubscriptionNFTApi.md#getcontract) +- [instanceConfig](SubscriptionNFTApi.md#instanceconfig) +- [instantiableConfig](SubscriptionNFTApi.md#instantiableconfig) +- [logger](SubscriptionNFTApi.md#logger) +- [nevermined](SubscriptionNFTApi.md#nevermined) +- [web3](SubscriptionNFTApi.md#web3) + +### Methods + +- [\_details](SubscriptionNFTApi.md#_details) +- [access](SubscriptionNFTApi.md#access) +- [addRating](SubscriptionNFTApi.md#addrating) +- [balanceOf](SubscriptionNFTApi.md#balanceof) +- [burn](SubscriptionNFTApi.md#burn) +- [buySecondaryMarketNft](SubscriptionNFTApi.md#buysecondarymarketnft) +- [claim](SubscriptionNFTApi.md#claim) +- [claimNFT](SubscriptionNFTApi.md#claimnft) +- [create](SubscriptionNFTApi.md#create) +- [details](SubscriptionNFTApi.md#details) +- [getSubscriptionToken](SubscriptionNFTApi.md#getsubscriptiontoken) +- [grantOperatorRole](SubscriptionNFTApi.md#grantoperatorrole) +- [isApprovedForAll](SubscriptionNFTApi.md#isapprovedforall) +- [isOperator](SubscriptionNFTApi.md#isoperator) +- [isOperatorOfDID](SubscriptionNFTApi.md#isoperatorofdid) +- [list](SubscriptionNFTApi.md#list) +- [listOnSecondaryMarkets](SubscriptionNFTApi.md#listonsecondarymarkets) +- [mint](SubscriptionNFTApi.md#mint) +- [mintWithURL](SubscriptionNFTApi.md#mintwithurl) +- [order](SubscriptionNFTApi.md#order) +- [orderAsset](SubscriptionNFTApi.md#orderasset) +- [ownerOf](SubscriptionNFTApi.md#ownerof) +- [ownerOfAsset](SubscriptionNFTApi.md#ownerofasset) +- [ownerOfAssetByAgreement](SubscriptionNFTApi.md#ownerofassetbyagreement) +- [ownerOfTokenId](SubscriptionNFTApi.md#owneroftokenid) +- [registerNeverminedAsset](SubscriptionNFTApi.md#registerneverminedasset) +- [releaseRewards](SubscriptionNFTApi.md#releaserewards) +- [releaseSecondaryMarketRewards](SubscriptionNFTApi.md#releasesecondarymarketrewards) +- [resolveAsset](SubscriptionNFTApi.md#resolveasset) +- [revokeOperatorRole](SubscriptionNFTApi.md#revokeoperatorrole) +- [setApprovalForAll](SubscriptionNFTApi.md#setapprovalforall) +- [setInstanceConfig](SubscriptionNFTApi.md#setinstanceconfig) +- [transfer](SubscriptionNFTApi.md#transfer) +- [updateAsset](SubscriptionNFTApi.md#updateasset) +- [deployInstance](SubscriptionNFTApi.md#deployinstance) +- [getInstance](SubscriptionNFTApi.md#getinstance) +- [getInstanceUsingABI](SubscriptionNFTApi.md#getinstanceusingabi) +- [getNFTContractAddress](SubscriptionNFTApi.md#getnftcontractaddress) +- [getServicePlugin](SubscriptionNFTApi.md#getserviceplugin) +- [setInstanceConfig](SubscriptionNFTApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new SubscriptionNFTApi**() + +#### Inherited from + +[NFT721Api](NFT721Api.md).[constructor](NFT721Api.md#constructor) + +## Properties + +### nftContract + +• **nftContract**: [`Nft721Contract`](Nft721Contract.md) + +#### Inherited from + +[NFT721Api](NFT721Api.md).[nftContract](NFT721Api.md#nftcontract) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L22) + +--- + +### servicePlugin + +• **servicePlugin**: `Object` + +#### Index signature + +▪ [key: `string`]: [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`Service`](../code-reference.md#service)\> + +#### Inherited from + +[NFT721Api](NFT721Api.md).[servicePlugin](NFT721Api.md#serviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L29) + +## Accessors + +### address + +• `get` **address**(): `string` + +Gets the ERC-721 NFT Contract address + +#### Returns + +`string` + +The NFT contract address + +#### Inherited from + +NFT721Api.address + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L55) + +--- + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFT721Api.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NFT721Api.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +NFT721Api.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### getContract + +• `get` **getContract**(): [`Nft721Contract`](Nft721Contract.md) + +Gets the instance of the ERC-721 NFT Contract where the API is connected + +#### Returns + +[`Nft721Contract`](Nft721Contract.md) + +The `Nft721Contract` instance + +#### Inherited from + +NFT721Api.getContract + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L63) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFT721Api.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +NFT721Api.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +NFT721Api.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +NFT721Api.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +NFT721Api.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_details + +▸ `Protected` **\_details**(`did`, `ercType`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :-------- | :------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `ercType` | [`ERCType`](../enums/ERCType.md) | The type of NFT used | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[\_details](NFT721Api.md#_details) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L150) + +--- + +### access + +▸ **access**(`did`, `consumer`, `destination?`, `fileIndex?`, `agreementId?`, `buyer?`, `babysig?`, `serviceReference?`): `Promise`<`boolean`\> + +Access the files associated with an NFT. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------------------------------ | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `consumer` | [`Account`](Account.md) | `undefined` | The NFT holder account. | +| `destination?` | `string` | `undefined` | The download destination for the files. | +| `fileIndex?` | `number` | `undefined` | The index of the file. If unset will download all the files in the asset. | +| `agreementId` | `string` | `'0x'` | The NFT sales agreement id. | +| `buyer?` | `string` | `undefined` | Key which represent the buyer | +| `babysig?` | [`Babysig`](../interfaces/Babysig.md) | `undefined` | - | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service reference to use. By default is nft-access. | + +#### Returns + +`Promise`<`boolean`\> + +true if the access was successful or file if isToDownload is false. + +**`Remarks`** + +This function will call the Node that will check if all the access conditions where fulfilled +before providing the files. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.access(ddo.id, collector, '/tmp/') +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[access](NFT721Api.md#access) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:419](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L419) + +--- + +### addRating + +▸ **addRating**(`did`, `newRating`, `numVotesAdded?`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, it adds a vote to the asset curation information. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `newRating` | `number` | `undefined` | New average rating of the asset | +| `numVotesAdded` | `number` | `1` | Number of new votes added to the rating, typically just 1 | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFT721Api](NFT721Api.md).[addRating](NFT721Api.md#addrating) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:514](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L514) + +--- + +### balanceOf + +▸ **balanceOf**(`account`): `Promise`<`bigint`\> + +Get the NFT balance for a particular account/address + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------------------- | :------------------------------------------- | +| `account` | `string` \| [`Account`](Account.md) | The account/address to check the balance of. | + +#### Returns + +`Promise`<`bigint`\> + +The balance of NFTs owned by the account. + +**`Example`** + +```ts +const balance = await nevermined.nfts721.balance(artist) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[balanceOf](NFT721Api.md#balanceof) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:506](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L506) + +--- + +### burn + +▸ **burn**(`tokenId`, `account`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Burn NFTs associated with an asset. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------- | +| `tokenId` | `string` | The identifier of the token to burn | +| `account` | [`Account`](Account.md) | The account of the publisher of the NFT. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Remarks`** + +The publisher can only burn NFTs that it owns. NFTs that were already transferred cannot be burned by the publisher. + +**`Example`** + +```ts +await nevermined.nfts721.burn(tokenId, artist) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[burn](NFT721Api.md#burn) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:347](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L347) + +--- + +### buySecondaryMarketNft + +▸ **buySecondaryMarketNft**(`consumer`, `nftAmount?`, `agreementIdSeed`, `conditionsTimeout?`, `txParams?`): `Promise`<`boolean`\> + +Buys a number of listed NFTs on secondary markets. + +#### Parameters + +| Name | Type | Description | +| :------------------ | :---------------------------------------------- | :----------------------------------------- | +| `consumer` | [`Account`](Account.md) | The account of the buyer/consumer. | +| `nftAmount` | `bigint` | The number of assets to buy. 1 by default. | +| `agreementIdSeed` | `string` | - | +| `conditionsTimeout` | `number`[] | - | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`boolean`\> + +true if the buy was successful. + +**`Example`** + +```ts +const result = await nevermined.nfts1155.buySecondaryMarketNft(collector, 1n, agreementId) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error buying the NFT. + +#### Inherited from + +[NFT721Api](NFT721Api.md).[buySecondaryMarketNft](NFT721Api.md#buysecondarymarketnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:341](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L341) + +--- + +### claim + +▸ **claim**(`agreementId`, `nftHolder`, `nftReceiver`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Description | +| :-------------- | :------- | :------------------------------------------------------- | +| `agreementId` | `string` | The NFT sales agreement id. | +| `nftHolder` | `string` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | The address where the NFT should be transferred. | +| `did?` | `string` | The Decentralized Identifier of the asset. | +| `serviceIndex?` | `any` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim(agreementId, editor.getId(), subscriber.getId()) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[claim](NFT721Api.md#claim) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:193](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L193) + +--- + +### claimNFT + +▸ `Protected` **claimNFT**(`agreementId`, `nftHolder`, `nftReceiver`, `numberEditions?`, `ercType?`, `did?`, `serviceIndex?`): `Promise`<`boolean`\> + +Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------- | :------------------------------- | :------------ | :--------------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `nftHolder` | `string` | `undefined` | The address of the current owner of the NFT. | +| `nftReceiver` | `string` | `undefined` | The address where the NFT should be transferred. | +| `numberEditions` | `bigint` | `undefined` | The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The Type of the NFT ERC (1155 or 721). | +| `did?` | `string` | `undefined` | The DID of the asset. | +| `serviceIndex?` | `number` | `undefined` | The index of the service in the DDO that will be claimed | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +This is useful when the consumer does not want to wait for the publisher +to transfer the NFT once the payment is made. Assuming the publisher delegated +transfer permissions to the Node. + +One example would be a marketplace where the user wants to get access to the NFT +as soon as the payment is made + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.claim( + agreementId, + editor.getId(), + subscriber.getId(), + nftAmount, + 721, +) +``` + +**`Throws`** + +[NFTError](NFTError.md) if Nevermined is not an operator for this NFT + +#### Inherited from + +[NFT721Api](NFT721Api.md).[claimNFT](NFT721Api.md#claimnft) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L50) + +--- + +### create + +▸ **create**(`nftAttributes`, `publisher`, `publicationOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +Creates a new Nevermined asset associated to a NFT (ERC-721). + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `nftAttributes` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The newly registered [DDO](DDO.md). + +**`Example`** + +```ts + +// We define how the Asset is and the properties +// of the NFT attached to it +const nftAttributes = NFTAttributes.getNFT721Instance({ + metadata, + price: assetPrice1, + serviceTypes: ['nft-sales', 'nft-access'] + nftContractAddress: nftContract.address +}) + +// And register the asset +ddo = await nevermined.nfts721.create( + nftAttributes, + artist, + { metadata: PublishMetadata.IPFS } +) +``` + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[NFT721Api](NFT721Api.md).[create](NFT721Api.md#create) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:97](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L97) + +--- + +### details + +▸ **details**(`did`): `Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +Get the details of an NFT + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | + +#### Returns + +`Promise`<{ `blockNumberUpdated`: `number` ; `lastChecksum`: `any` ; `lastUpdatedBy`: `any` ; `mintCap`: `bigint` ; `nftContractAddress`: `any` ; `nftInitialized`: `any` ; `nftSupply`: `bigint` ; `nftURI`: `string` ; `owner`: `any` ; `providers`: `any` ; `royalties`: `number` ; `royaltyScheme`: [`RoyaltyKind`](../enums/RoyaltyKind.md) ; `url`: `any` }\> + +The details of the NFT. + +**`Example`** + +```ts +const details = await nevermined.nfts1155.details(ddo.id) + +// The `details` object includes the NFT information + +assert.equal(details.mintCap, 5) +assert.equal(details.nftSupply, 5) +assert.equal(details.royaltyScheme, RoyaltyKind.Standard) +assert.equal(details.royalties, 100000) +assert.equal(details.owner, artist.getId()) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[details](NFT721Api.md#details) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:639](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L639) + +--- + +### getSubscriptionToken + +▸ **getSubscriptionToken**(`did`, `account`): `Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +Get a JWT token for an asset associated with a webService + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------- | :----------------------------------------------------------------------------- | +| `did` | `string` | The did of the asset with a webService resource and an associated subscription | +| `account` | [`Account`](Account.md) | Account of the user requesting the token | + +#### Returns + +`Promise`<[`SubscriptionToken`](../interfaces/SubscriptionToken.md)\> + +[SubscriptionToken](../interfaces/SubscriptionToken.md) + +**`Example`** + +```ts +const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber) + +assert.isDefined(response.accessToken) +assert.isDefined(response.neverminedProxyUri) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[getSubscriptionToken](NFT721Api.md#getsubscriptiontoken) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:478](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L478) + +--- + +### grantOperatorRole + +▸ **grantOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Adds a operator (`operatorAddress`) to the NFT Contract. +Granting and revoking operator permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :--------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be added as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account giving operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.grantOperatorRole(someoneElse, artist) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[grantOperatorRole](NFT721Api.md#grantoperatorrole) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:585](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L585) + +--- + +### isApprovedForAll + +▸ **isApprovedForAll**(`operatorAddress`, `from`): `Promise`<`unknown`\> + +Returns if the `operatorAddress` is approved + +#### Parameters + +| Name | Type | Description | +| :---------------- | :------- | :--------------------------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address to check the permissions | +| `from` | `string` | The address of the account granting or revoking the permissions via `setApprovalForAll`. | + +#### Returns + +`Promise`<`unknown`\> + +Boolean saying if the `operatorAddress` is approved + +**`Example`** + +```ts +await nevermined.nfts721.isApprovedForAll(someoneElse, artist.getId()) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[isApprovedForAll](NFT721Api.md#isapprovedforall) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:490](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L490) + +--- + +### isOperator + +▸ **isOperator**(`nftContractAddress`, `operatorAddress`, `ercType?`): `Promise`<`boolean`\> + +Check if a particular address is the operator of given a NFT address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------- | :------------------------------- | :------------ | :-------------------------------------- | +| `nftContractAddress` | `string` | `undefined` | The DID of the NFT to check | +| `operatorAddress` | `string` | `undefined` | The address to check if operator status | +| `ercType` | [`ERCType`](../enums/ERCType.md) | `1155` | The erc type of the NFT. | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Inherited from + +[NFT721Api](NFT721Api.md).[isOperator](NFT721Api.md#isoperator) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:116](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L116) + +--- + +### isOperatorOfDID + +▸ **isOperatorOfDID**(`did`, `address`): `Promise`<`boolean`\> + +Check if a particular address is the operator of a DID. + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :-------------------------------------- | +| `did` | `string` | The DID of the NFT to check | +| `address` | `string` | The address to check if operator status | + +#### Returns + +`Promise`<`boolean`\> + +operator status of address as a boolean + +#### Inherited from + +[NFT721Api](NFT721Api.md).[isOperatorOfDID](NFT721Api.md#isoperatorofdid) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:643](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L643) + +--- + +### list + +▸ **list**(`did`, `list`, `publisher`, `publishMetadata?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset allowing to list or unlist it. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. +In a Nevermined environment, when an asset is unlisted, it is not possible to be found and accessed by any user. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `list` | `boolean` | `undefined` | Needs the asset to be listed or unlisted | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadata` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFT721Api](NFT721Api.md).[list](NFT721Api.md#list) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L462) + +--- + +### listOnSecondaryMarkets + +▸ **listOnSecondaryMarkets**(`ddo`, `assetPrice`, `nftAmount`, `nftTransfer`, `provider`, `token`, `owner`): `Promise`<`string`\> + +After purchase re-list an NFT to enable secondary market sales. + +#### Parameters + +| Name | Type | Description | +| :------------ | :---------------------------- | :----------------------------------------------------------- | +| `ddo` | [`DDO`](DDO.md) | The DDO of the asset. | +| `assetPrice` | [`AssetPrice`](AssetPrice.md) | The current setup of asset rewards. | +| `nftAmount` | `bigint` | The number of NFTs put up for secondary sale. | +| `nftTransfer` | `boolean` | - | +| `provider` | `string` | The address that will be the provider of the secondary sale. | +| `token` | [`Token`](Token.md) | - | +| `owner` | [`Account`](Account.md) | The account of the current owner. | + +#### Returns + +`Promise`<`string`\> + +the agreementId of the secondary sale. + +**`Example`** + +```ts +const agreementId = await nevermined.nfts1155.listOnSecondaryMarkets( + ddo, + assetPrice, + numberNFTs, + collector.getId(), + token, + collector.getId(), +) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error listing the NFT. + +#### Inherited from + +[NFT721Api](NFT721Api.md).[listOnSecondaryMarkets](NFT721Api.md#listonsecondarymarkets) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:260](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L260) + +--- + +### mint + +▸ **mint**(`did`, `publisher`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Mint NFTs associated with an asset. + +This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `publisher` | [`Account`](Account.md) | The account of the minter | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.mint(ddo.id, artist) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[mint](NFT721Api.md#mint) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:319](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L319) + +--- + +### mintWithURL + +▸ **mintWithURL**(`to`, `did`, `url`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Mint NFTs associated with an asset allowing to specify some metadata + +This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :--------------------------------------------- | +| `to` | `string` | The address receiving the NFT minted | +| `did` | `string` | The Decentralized Identifier of the NFT asset. | +| `url` | `string` | The URL with NFT metadata | +| `from?` | [`Account`](Account.md) | The account of the minter | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.mintWithURL(receiverAddress, ddo.id, nftMetadata, artist) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[mintWithURL](NFT721Api.md#mintwithurl) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:367](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L367) + +--- + +### order + +▸ **order**(`did`, `consumer`, `serviceReference?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Order a NFT-721. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :------------------------------------------------------------- | +| `did` | `string` | `undefined` | The Decentralized Identifier of the NFT asset. | +| `consumer` | [`Account`](Account.md) | `undefined` | The account of the NFT buyer. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to order | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +**`Remarks`** + +This will lock the funds of the consumer in escrow pending the transfer of the NFTs +from the publisher. + +**`Example`** + +```ts +const agreementId = await nevermined.nfts721.order(ddo.id, collector) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[order](NFT721Api.md#order) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:134](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L134) + +--- + +### orderAsset + +▸ **orderAsset**(`did`, `serviceReference`, `consumer`, `params?`): [`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +Start the purchase/order of an asset's service. Starts by signing the service agreement +then sends the request to the publisher via the service endpoint (Node http service). + +#### Parameters + +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------ | :---------------- | +| `did` | `string` | Decentralized ID. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | Service. | +| `consumer` | [`Account`](Account.md) | Consumer account. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`OrderProgressStep`](../enums/OrderProgressStep.md), `string`\> + +The agreement ID. + +#### Inherited from + +[NFT721Api](NFT721Api.md).[orderAsset](NFT721Api.md#orderasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:563](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L563) + +--- + +### ownerOf + +▸ **ownerOf**(`did`): `Promise`<`string`\> + +Gets the contract owner + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `did` | `string` | + +#### Returns + +`Promise`<`string`\> + +Address of the contract owner + +**`Example`** + +```ts +const nftContractOwner = new Account(await nevermined.nfts721.ownerOf()) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[ownerOf](NFT721Api.md#ownerof) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:416](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L416) + +--- + +### ownerOfAsset + +▸ **ownerOfAsset**(`did`): `Promise`<`string`\> + +Given a DID it gets the owner of the NFT if that DID is used as tokenId + +#### Parameters + +| Name | Type | Description | +| :---- | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized identifier of the NFT asset. | + +#### Returns + +`Promise`<`string`\> + +The address of the NFT owner. + +**`Example`** + +```ts +const owner = await nevermined.nfts721.ownerOfAsset(ddo.id, nftTokenAddress) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[ownerOfAsset](NFT721Api.md#ownerofasset) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:450](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L450) + +--- + +### ownerOfAssetByAgreement + +▸ **ownerOfAssetByAgreement**(`did`, `agreementId`): `Promise`<`string`\> + +Given a DID and an agreement id it gets the owner of the NFT + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :--------------------------------------------- | +| `did` | `string` | The Decentralized identifier of the NFT asset. | +| `agreementId` | `string` | The NFT sales agreement id. | + +#### Returns + +`Promise`<`string`\> + +The address of the NFT owner. + +**`Example`** + +```ts +const owner = await nevermined.nfts721.ownerOfAssetByAgreement(ddo.id, agreementId) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[ownerOfAssetByAgreement](NFT721Api.md#ownerofassetbyagreement) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:468](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L468) + +--- + +### ownerOfTokenId + +▸ **ownerOfTokenId**(`tokenId`): `Promise`<`string`\> + +Given some information, it gets the owner of the NFT + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :----------- | +| `tokenId` | `string` | The token id | + +#### Returns + +`Promise`<`string`\> + +The address of the NFT owner. + +**`Example`** + +```ts +const owner = await nevermined.nfts721.ownerOfTokenId(tokenId) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[ownerOfTokenId](NFT721Api.md#owneroftokenid) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:433](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L433) + +--- + +### registerNeverminedAsset + +▸ `Protected` **registerNeverminedAsset**(`assetAttributes`, `publisher`, `publicationOptions`, `nftAttributes?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +It registers a new asset in a Nevermined network. This method is protected and not exposed +via the Nevermined APIs directly. It must accessed via the `assets`, `compute`, and `nfts` APIs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------- | +| `assetAttributes` | [`AssetAttributes`](AssetAttributes.md) | Attributes describing the asset | +| `publisher` | [`Account`](Account.md) | The account publishing the asset | +| `publicationOptions` | [`AssetPublicationOptions`](AssetPublicationOptions.md) | Allows to specify the publication options of the off-chain and the on-chain data. | +| `nftAttributes?` | [`NFTAttributes`](NFTAttributes.md) | Attributes describing the NFT (ERC-721) associated to the asset | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`CreateProgressStep`](../enums/CreateProgressStep.md), [`DDO`](DDO.md)\> + +The metadata of the asset created (DDO) + +**`See`** + +[PublishOnChainOptions](../enums/PublishOnChainOptions.md) and [PublishMetadataOptions](../enums/PublishMetadataOptions.md) + +#### Inherited from + +[NFT721Api](NFT721Api.md).[registerNeverminedAsset](NFT721Api.md#registerneverminedasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L42) + +--- + +### releaseRewards + +▸ **releaseRewards**(`agreementId`, `did`, `publisher`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Release the funds from escrow. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to release rewards | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the funds release was successful. + +**`Remarks`** + +A publisher is able to release the funds put on escrow by the consumer after transferring the NFTs. + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.releaseRewards(agreementId, ddo.id, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards. + +#### Inherited from + +[NFT721Api](NFT721Api.md).[releaseRewards](NFT721Api.md#releaserewards) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:277](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L277) + +--- + +### releaseSecondaryMarketRewards + +▸ **releaseSecondaryMarketRewards**(`owner`, `account`, `agreementIdSeed`, `txParams?`): `Promise`<`boolean`\> + +Used to release the secondary market NFT & the locked rewards. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :---------------------------------------------------------------- | +| `owner` | [`Account`](Account.md) | The owner account. | +| `account` | [`Account`](Account.md) | Account of the user sending the transaction | +| `agreementIdSeed` | `string` | the seed of the Agreement Id of the underlying service agreement. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +true if the transaction was successful. + +**`Example`** + +```ts +// TODO +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error releasing the rewards. + +#### Inherited from + +[NFT721Api](NFT721Api.md).[releaseSecondaryMarketRewards](NFT721Api.md#releasesecondarymarketrewards) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:529](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L529) + +--- + +### resolveAsset + +▸ `Protected` **resolveAsset**(`did`, `policy?`): `Promise`<[`DDO`](DDO.md)\> + +Returns a DDO by DID. Depending of the resolution policy it prioritize the Metadata API or Immutable urls. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :------------------------------------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID. | +| `policy` | [`DIDResolvePolicy`](../enums/DIDResolvePolicy.md) | `DIDResolvePolicy.MetadataAPIFirst` | It specifies the resolve policy to apply. It allows to select that priorities during the asset resolution via Metadata API or Immutable URLs (IPFS, Filecoin, etc) | + +#### Returns + +`Promise`<[`DDO`](DDO.md)\> + +[DDO](DDO.md) + +#### Inherited from + +[NFT721Api](NFT721Api.md).[resolveAsset](NFT721Api.md#resolveasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:310](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L310) + +--- + +### revokeOperatorRole + +▸ **revokeOperatorRole**(`operatorAddress`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Revokes a minter (`operatorAddress`) of the NFT Contract. +Granting and revoking minting permissions only can be done by the NFT Contract owner + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------------------- | :----------------------------------------------------------------------- | +| `operatorAddress` | `string` | The address of the account to be revoked as operator in the NFT Contract | +| `from?` | [`Account`](Account.md) | The account revoking operator permissions | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.revokeOperatorRole(someoneElse, artist) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[revokeOperatorRole](NFT721Api.md#revokeoperatorrole) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:611](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L611) + +--- + +### setApprovalForAll + +▸ **setApprovalForAll**(`target`, `approved`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Enable or disable NFT permissions for an operator. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :------------------------------------------------------------------- | +| `target` | `string` | The address that of the operator we want to give transfer rights to. | +| `approved` | `boolean` | Give or remove transfer rights from the operator. | +| `from` | [`Account`](Account.md) | The account that wants to give transfer rights to the operator. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Optional transaction parameters. | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +The ethers.ContractTransactionReceipt + +**`Example`** + +```ts +await nevermined.nfts721.setApprovalForAll(someoneElse, true, artist) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[setApprovalForAll](NFT721Api.md#setapprovalforall) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:395](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L395) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[setInstanceConfig](NFT721Api.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transfer + +▸ **transfer**(`agreementId`, `did`, `publisher`, `serviceReference?`, `txParams?`): `Promise`<`boolean`\> + +Transfer NFT-721 to the consumer. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------ | :---------------------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The NFT sales agreement id. | +| `did` | `string` | `undefined` | The Decentralized identifier of the NFT asset. | +| `publisher` | [`Account`](Account.md) | `undefined` | The current owner of the NFTs. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-sales'` | The reference to identify wich service within the DDO to transfer | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters. | + +#### Returns + +`Promise`<`boolean`\> + +true if the transfer was successful. + +**`Remarks`** + +A publisher/provider will check if the consumer put the funds in escrow and +execute the transfer in order to be able to release the rewards. + +**`Example`** + +```ts +const receipt = await nevermined.nfts721.transfer(agreementId, ddo.id, artist) +``` + +**`Throws`** + +[NFTError](NFTError.md) +Thrown if there is an error transferring the NFT + +#### Inherited from + +[NFT721Api](NFT721Api.md).[transfer](NFT721Api.md#transfer) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:226](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L226) + +--- + +### updateAsset + +▸ `Protected` **updateAsset**(`did`, `metadata`, `publisher`, `publishMetadataOptions?`, `txParams?`): [`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +Given a DID, updates the metadata associated to the asset. It also can upload this metadata to a remote decentralized stored depending on the `publishMetadata` parameter. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------------- | :------------------------------------------------------------- | :--------------------------------------- | :------------------------------------------------------------------------------- | +| `did` | `string` | `undefined` | Decentralized ID representing the unique id of an asset in a Nevermined network. | +| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | Metadata describing the asset | +| `publisher` | [`Account`](Account.md) | `undefined` | Account of the user updating the metadata | +| `publishMetadataOptions` | [`PublishMetadataOptions`](../enums/PublishMetadataOptions.md) | `PublishMetadataOptions.OnlyMetadataAPI` | It allows to specify where to store the metadata | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Optional transaction parameters | + +#### Returns + +[`SubscribablePromise`](SubscribablePromise.md)<[`UpdateProgressStep`](../enums/UpdateProgressStep.md), [`DDO`](DDO.md)\> + +[DDO](DDO.md) The DDO updated + +#### Inherited from + +[NFT721Api](NFT721Api.md).[updateAsset](NFT721Api.md#updateasset) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:353](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L353) + +--- + +### deployInstance + +▸ `Static` **deployInstance**(`config`, `contractABI`, `from`, `args?`): `Promise`<[`SubscriptionNFTApi`](SubscriptionNFTApi.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------------------------------------------ | :------------ | +| `config` | [`NeverminedOptions`](NeverminedOptions.md) | `undefined` | +| `contractABI` | `any` | `undefined` | +| `from` | [`Account`](Account.md) | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`Promise`<[`SubscriptionNFTApi`](SubscriptionNFTApi.md)\> + +#### Defined in + +[src/nevermined/api/nfts/SubscriptionNFTApi.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/SubscriptionNFTApi.ts#L25) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`, `nftContractAddress`): `Promise`<[`NFT721Api`](NFT721Api.md)\> + +Create a new Nevermined NFTs (ERC-721) instance allowing to interact with that kind of NFTs. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :---------------------------------------------------------- | :-------------------------------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | The Nevermined config | +| `nftContractAddress` | `string` | If the Nft721 Contract is deployed in an address it will connect to that contract | + +#### Returns + +`Promise`<[`NFT721Api`](NFT721Api.md)\> + +The NFTs 721 API instance [NFT721Api](NFT721Api.md). + +**`Example`** + +```ts +nfts721 = await Nft721Api.getInstance(instanceConfig, nftContractAddress) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[getInstance](NFT721Api.md#getinstance) + +#### Defined in + +[src/nevermined/api/nfts/NFT721Api.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFT721Api.ts#L39) + +--- + +### getInstanceUsingABI + +▸ `Static` **getInstanceUsingABI**(`config`, `nftContractAddress`, `solidityABI`): `Promise`<[`SubscriptionNFTApi`](SubscriptionNFTApi.md)\> + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | +| `nftContractAddress` | `string` | +| `solidityABI` | `any` | + +#### Returns + +`Promise`<[`SubscriptionNFTApi`](SubscriptionNFTApi.md)\> + +#### Defined in + +[src/nevermined/api/nfts/SubscriptionNFTApi.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/SubscriptionNFTApi.ts#L8) + +--- + +### getNFTContractAddress + +▸ `Static` **getNFTContractAddress**(`ddo`, `serviceReference?`): `any` + +Gets the NFT contract address associated with a Nevermined asset from the DDO. + +#### Parameters + +| Name | Type | Default value | Description | +| :----------------- | :------------------------------------------------------------ | :------------- | :------------------------------------------------ | +| `ddo` | [`DDO`](DDO.md) | `undefined` | The DDO of the asset. | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | `'nft-access'` | The service type to look for the contract address | + +#### Returns + +`any` + +The NFT contract address. + +**`Example`** + +```ts +const nftContractAddress = NFT1155Api.getNFTContractAddress(ddo) +``` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[getNFTContractAddress](NFT721Api.md#getnftcontractaddress) + +#### Defined in + +[src/nevermined/api/nfts/NFTsBaseApi.ts:219](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/nfts/NFTsBaseApi.ts#L219) + +--- + +### getServicePlugin + +▸ `Static` `Protected` **getServicePlugin**(`config`): `Object` + +Initializes the default Nevermined service plugins and return that instance + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :---------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Nevermined config | + +#### Returns + +`Object` + +The Nevermined Service Plugin instance + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------ | +| `aave-credit` | [`ServicePlugin`](../interfaces/ServicePlugin.md)<[`ServiceAaveCredit`](../interfaces/ServiceAaveCredit.md)\> | +| `access` | [`AccessService`](AccessService.md) | +| `compute` | [`EscrowComputeExecutionTemplate`](EscrowComputeExecutionTemplate.md) | +| `nft-access` | [`NFTAccessService`](NFTAccessService.md) | +| `nft-sales` | [`NFTSalesService`](NFTSalesService.md) | + +#### Inherited from + +[NFT721Api](NFT721Api.md).[getServicePlugin](NFT721Api.md#getserviceplugin) + +#### Defined in + +[src/nevermined/api/RegistryBaseApi.ts:618](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/RegistryBaseApi.ts#L618) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[NFT721Api](NFT721Api.md).[setInstanceConfig](NFT721Api.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/TemplateStoreManager.md b/docs/api-reference/classes/TemplateStoreManager.md new file mode 100644 index 000000000..ee5b88feb --- /dev/null +++ b/docs/api-reference/classes/TemplateStoreManager.md @@ -0,0 +1,687 @@ +[@nevermined-io/sdk](../code-reference.md) / TemplateStoreManager + +# Class: TemplateStoreManager + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`TemplateStoreManager`** + +## Table of contents + +### Constructors + +- [constructor](TemplateStoreManager.md#constructor) + +### Properties + +- [address](TemplateStoreManager.md#address) +- [contract](TemplateStoreManager.md#contract) +- [contractName](TemplateStoreManager.md#contractname) +- [events](TemplateStoreManager.md#events) +- [version](TemplateStoreManager.md#version) + +### Accessors + +- [artifactsFolder](TemplateStoreManager.md#artifactsfolder) +- [circuitsFolder](TemplateStoreManager.md#circuitsfolder) +- [config](TemplateStoreManager.md#config) +- [instanceConfig](TemplateStoreManager.md#instanceconfig) +- [instantiableConfig](TemplateStoreManager.md#instantiableconfig) +- [logger](TemplateStoreManager.md#logger) +- [nevermined](TemplateStoreManager.md#nevermined) +- [web3](TemplateStoreManager.md#web3) + +### Methods + +- [approveTemplate](TemplateStoreManager.md#approvetemplate) +- [call](TemplateStoreManager.md#call) +- [getFromAddress](TemplateStoreManager.md#getfromaddress) +- [getInputsOfMethod](TemplateStoreManager.md#getinputsofmethod) +- [getListSize](TemplateStoreManager.md#getlistsize) +- [getOwner](TemplateStoreManager.md#getowner) +- [getSignatureOfMethod](TemplateStoreManager.md#getsignatureofmethod) +- [getTemplate](TemplateStoreManager.md#gettemplate) +- [init](TemplateStoreManager.md#init) +- [isApproved](TemplateStoreManager.md#isapproved) +- [proposeTemplate](TemplateStoreManager.md#proposetemplate) +- [revokeTemplate](TemplateStoreManager.md#revoketemplate) +- [send](TemplateStoreManager.md#send) +- [sendFrom](TemplateStoreManager.md#sendfrom) +- [setInstanceConfig](TemplateStoreManager.md#setinstanceconfig) +- [getInstance](TemplateStoreManager.md#getinstance) +- [setInstanceConfig](TemplateStoreManager.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new TemplateStoreManager**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### approveTemplate + +▸ **approveTemplate**(`address`, `from?`, `ignoreApproved?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------------- | :---------------------------------------------- | +| `address` | `string` | +| `from?` | [`Account`](Account.md) | +| `ignoreApproved?` | `boolean` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L50) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getListSize + +▸ **getListSize**(): `Promise`<`unknown`\> + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:85](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L85) + +--- + +### getOwner + +▸ **getOwner**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L29) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### getTemplate + +▸ **getTemplate**(`templateId`): `Promise`<[`TemplateMetadata`](../interfaces/TemplateMetadata.md)\> + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `templateId` | `string` | + +#### Returns + +`Promise`<[`TemplateMetadata`](../interfaces/TemplateMetadata.md)\> + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:71](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L71) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### isApproved + +▸ **isApproved**(`templateId`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `templateId` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L81) + +--- + +### proposeTemplate + +▸ **proposeTemplate**(`address`, `from?`, `ignoreExists?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :-------------- | :---------------------------------------------- | +| `address` | `string` | +| `from?` | [`Account`](Account.md) | +| `ignoreExists?` | `boolean` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L33) + +--- + +### revokeTemplate + +▸ **revokeTemplate**(`address`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `address` | `string` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L67) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`TemplateStoreManager`](TemplateStoreManager.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`TemplateStoreManager`](TemplateStoreManager.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L21) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Token.md b/docs/api-reference/classes/Token.md new file mode 100644 index 000000000..c0445f7ca --- /dev/null +++ b/docs/api-reference/classes/Token.md @@ -0,0 +1,728 @@ +[@nevermined-io/sdk](../code-reference.md) / Token + +# Class: Token + +## Hierarchy + +- [`ContractBase`](ContractBase.md) + + ↳ **`Token`** + + ↳↳ [`CustomToken`](CustomToken.md) + +## Table of contents + +### Constructors + +- [constructor](Token.md#constructor) + +### Properties + +- [address](Token.md#address) +- [contract](Token.md#contract) +- [contractName](Token.md#contractname) +- [events](Token.md#events) +- [version](Token.md#version) +- [ERC20_ABI](Token.md#erc20_abi) + +### Accessors + +- [artifactsFolder](Token.md#artifactsfolder) +- [circuitsFolder](Token.md#circuitsfolder) +- [config](Token.md#config) +- [instanceConfig](Token.md#instanceconfig) +- [instantiableConfig](Token.md#instantiableconfig) +- [logger](Token.md#logger) +- [nevermined](Token.md#nevermined) +- [web3](Token.md#web3) + +### Methods + +- [approve](Token.md#approve) +- [balanceOf](Token.md#balanceof) +- [balanceOfConverted](Token.md#balanceofconverted) +- [call](Token.md#call) +- [decimals](Token.md#decimals) +- [getFromAddress](Token.md#getfromaddress) +- [getInputsOfMethod](Token.md#getinputsofmethod) +- [getSignatureOfMethod](Token.md#getsignatureofmethod) +- [init](Token.md#init) +- [name](Token.md#name) +- [send](Token.md#send) +- [sendFrom](Token.md#sendfrom) +- [setInstanceConfig](Token.md#setinstanceconfig) +- [strBalanceOf](Token.md#strbalanceof) +- [symbol](Token.md#symbol) +- [totalSupply](Token.md#totalsupply) +- [transfer](Token.md#transfer) +- [getInstance](Token.md#getinstance) +- [setInstanceConfig](Token.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Token**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ContractBase](ContractBase.md).[constructor](ContractBase.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[address](ContractBase.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[contract](ContractBase.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[contractName](ContractBase.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ContractBase](ContractBase.md).[events](ContractBase.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ContractBase](ContractBase.md).[version](ContractBase.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +--- + +### ERC20_ABI + +▪ `Static` **ERC20_ABI**: `string`[] + +#### Defined in + +[src/keeper/contracts/Token.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L7) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ContractBase.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ContractBase.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ContractBase.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ContractBase.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ContractBase.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ContractBase.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### approve + +▸ **approve**(`to`, `price`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `to` | `string` | +| `price` | `bigint` | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L27) + +--- + +### balanceOf + +▸ **balanceOf**(`address`): `Promise`<`bigint`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<`bigint`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L43) + +--- + +### balanceOfConverted + +▸ **balanceOfConverted**(`address`): `Promise`<`bigint`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<`bigint`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L35) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[call](ContractBase.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### decimals + +▸ **decimals**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L31) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[getFromAddress](ContractBase.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ContractBase](ContractBase.md).[getInputsOfMethod](ContractBase.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ContractBase](ContractBase.md).[getSignatureOfMethod](ContractBase.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[init](ContractBase.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### name + +▸ **name**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L51) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[send](ContractBase.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ContractBase](ContractBase.md).[sendFrom](ContractBase.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### strBalanceOf + +▸ **strBalanceOf**(`address`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `address` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L39) + +--- + +### symbol + +▸ **symbol**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L47) + +--- + +### totalSupply + +▸ **totalSupply**(): `Promise`<`bigint`\> + +#### Returns + +`Promise`<`bigint`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L55) + +--- + +### transfer + +▸ **transfer**(`to`, `amount`, `from`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `to` | `string` | +| `amount` | `bigint` | +| `from` | `string` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Defined in + +[src/keeper/contracts/Token.ts:59](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L59) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`Token`](Token.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`Token`](Token.md)\> + +#### Overrides + +[ContractBase](ContractBase.md).[getInstance](ContractBase.md#getinstance) + +#### Defined in + +[src/keeper/contracts/Token.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Token.ts#L21) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ContractBase](ContractBase.md).[setInstanceConfig](ContractBase.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/TokenUtils.md b/docs/api-reference/classes/TokenUtils.md new file mode 100644 index 000000000..d6a4fe2a0 --- /dev/null +++ b/docs/api-reference/classes/TokenUtils.md @@ -0,0 +1,402 @@ +[@nevermined-io/sdk](../code-reference.md) / TokenUtils + +# Class: TokenUtils + +Tokens submodule of Nevermined. + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`TokenUtils`** + +## Table of contents + +### Constructors + +- [constructor](TokenUtils.md#constructor) + +### Accessors + +- [artifactsFolder](TokenUtils.md#artifactsfolder) +- [circuitsFolder](TokenUtils.md#circuitsfolder) +- [config](TokenUtils.md#config) +- [instanceConfig](TokenUtils.md#instanceconfig) +- [instantiableConfig](TokenUtils.md#instantiableconfig) +- [logger](TokenUtils.md#logger) +- [nevermined](TokenUtils.md#nevermined) +- [web3](TokenUtils.md#web3) + +### Methods + +- [getAddress](TokenUtils.md#getaddress) +- [getName](TokenUtils.md#getname) +- [getSymbol](TokenUtils.md#getsymbol) +- [getTotalSupply](TokenUtils.md#gettotalsupply) +- [request](TokenUtils.md#request) +- [setInstanceConfig](TokenUtils.md#setinstanceconfig) +- [transfer](TokenUtils.md#transfer) +- [getInstance](TokenUtils.md#getinstance) +- [setInstanceConfig](TokenUtils.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new TokenUtils**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/Token.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L9) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### getAddress + +▸ **getAddress**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/nevermined/Token.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L30) + +--- + +### getName + +▸ **getName**(): `Promise`<`string`\> + +Get token name. + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/Token.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L37) + +--- + +### getSymbol + +▸ **getSymbol**(): `Promise`<`string`\> + +Get token symbol. + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/Token.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L26) + +--- + +### getTotalSupply + +▸ **getTotalSupply**(): `Promise`<`bigint`\> + +Get token total supply + +#### Returns + +`Promise`<`bigint`\> + +#### Defined in + +[src/nevermined/Token.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L44) + +--- + +### request + +▸ **request**(`account`, `amount`, `params?`): `Promise`<`boolean`\> + +Request tokens for an account. + +#### Parameters + +| Name | Type | Description | +| :-------- | :---------------------------------------------- | :---------------- | +| `account` | [`Account`](Account.md) | Account instance. | +| `amount` | `number` | Token amount. | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | - | + +#### Returns + +`Promise`<`boolean`\> + +true if the call succeeded, false otherwise + +#### Defined in + +[src/nevermined/Token.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L73) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### transfer + +▸ **transfer**(`to`, `amount`, `from`, `txParams?`): `Promise`<`boolean`\> + +Transfer a number of tokens to the mentioned account. + +#### Parameters + +| Name | Type | Description | +| :---------- | :---------------------------------------------- | :-------------------------------- | +| `to` | `string` | Address that receives the tokens. | +| `amount` | `bigint` | Tokens to transfer. | +| `from` | [`Account`](Account.md) | Sender account address. | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`boolean`\> + +True if the transfer succeeded. + +#### Defined in + +[src/nevermined/Token.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L56) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`TokenUtils`](TokenUtils.md)\> + +Returns the instance of Token. + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`TokenUtils`](TokenUtils.md)\> + +[Token](Token.md) + +#### Overrides + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/nevermined/Token.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Token.ts#L18) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/TransferDIDOwnershipCondition.md b/docs/api-reference/classes/TransferDIDOwnershipCondition.md new file mode 100644 index 000000000..2a9300ab8 --- /dev/null +++ b/docs/api-reference/classes/TransferDIDOwnershipCondition.md @@ -0,0 +1,977 @@ +[@nevermined-io/sdk](../code-reference.md) / TransferDIDOwnershipCondition + +# Class: TransferDIDOwnershipCondition + +Condition allowing to transfer the ownership between the original owner and a receiver. + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`AccessConditionContext`\> + + ↳ **`TransferDIDOwnershipCondition`** + +## Table of contents + +### Constructors + +- [constructor](TransferDIDOwnershipCondition.md#constructor) + +### Properties + +- [address](TransferDIDOwnershipCondition.md#address) +- [contract](TransferDIDOwnershipCondition.md#contract) +- [contractName](TransferDIDOwnershipCondition.md#contractname) +- [events](TransferDIDOwnershipCondition.md#events) +- [version](TransferDIDOwnershipCondition.md#version) + +### Accessors + +- [artifactsFolder](TransferDIDOwnershipCondition.md#artifactsfolder) +- [circuitsFolder](TransferDIDOwnershipCondition.md#circuitsfolder) +- [config](TransferDIDOwnershipCondition.md#config) +- [instanceConfig](TransferDIDOwnershipCondition.md#instanceconfig) +- [instantiableConfig](TransferDIDOwnershipCondition.md#instantiableconfig) +- [logger](TransferDIDOwnershipCondition.md#logger) +- [nevermined](TransferDIDOwnershipCondition.md#nevermined) +- [web3](TransferDIDOwnershipCondition.md#web3) + +### Methods + +- [abortByTimeOut](TransferDIDOwnershipCondition.md#abortbytimeout) +- [call](TransferDIDOwnershipCondition.md#call) +- [fulfill](TransferDIDOwnershipCondition.md#fulfill) +- [fulfillInstance](TransferDIDOwnershipCondition.md#fulfillinstance) +- [fulfillPlain](TransferDIDOwnershipCondition.md#fulfillplain) +- [fulfillWithNode](TransferDIDOwnershipCondition.md#fulfillwithnode) +- [generateId](TransferDIDOwnershipCondition.md#generateid) +- [generateIdHash](TransferDIDOwnershipCondition.md#generateidhash) +- [generateIdWithSeed](TransferDIDOwnershipCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](TransferDIDOwnershipCondition.md#getconditionfulfilledevent) +- [getFromAddress](TransferDIDOwnershipCondition.md#getfromaddress) +- [getInputsOfMethod](TransferDIDOwnershipCondition.md#getinputsofmethod) +- [getSignatureOfMethod](TransferDIDOwnershipCondition.md#getsignatureofmethod) +- [hashValues](TransferDIDOwnershipCondition.md#hashvalues) +- [hashValuesPlain](TransferDIDOwnershipCondition.md#hashvaluesplain) +- [init](TransferDIDOwnershipCondition.md#init) +- [instance](TransferDIDOwnershipCondition.md#instance) +- [instanceFromDDO](TransferDIDOwnershipCondition.md#instancefromddo) +- [nodeMethod](TransferDIDOwnershipCondition.md#nodemethod) +- [params](TransferDIDOwnershipCondition.md#params) +- [paramsFromDDO](TransferDIDOwnershipCondition.md#paramsfromddo) +- [send](TransferDIDOwnershipCondition.md#send) +- [sendFrom](TransferDIDOwnershipCondition.md#sendfrom) +- [setInstanceConfig](TransferDIDOwnershipCondition.md#setinstanceconfig) +- [getInstance](TransferDIDOwnershipCondition.md#getinstance) +- [setInstanceConfig](TransferDIDOwnershipCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new TransferDIDOwnershipCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `receiver`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill the transfer DID ownership condition. + +#### Parameters + +| Name | Type | Description | +| :------------ | :---------------------------------------------- | :----------------------------------------- | +| `agreementId` | `string` | Agreement identifier. | +| `did` | `string` | The Decentralized Identifier of the asset. | +| `receiver` | `string` | The address of the granted user. | +| `from?` | [`Account`](Account.md) | Account fullfilling | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | Transaction parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Condition state. + +**`Remarks`** + +Only DID owner or DID provider can call this method. +Fulfill method transfer full ownership permissions to the receiver address. + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L53) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `AccessConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L208) + +--- + +### params + +▸ **params**(`did`, `receiver`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generates the hash of the condition inputs. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :----------------------------------------------- | +| `did` | `string` | The Decentralized Identifier of the asset. | +| `receiver` | `string` | Address of the granted user or the DID provider. | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Hash of all the values. + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L31) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :----------------------- | +| `«destructured»` | `AccessConditionContext` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L35) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`TransferDIDOwnershipCondition`](TransferDIDOwnershipCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`TransferDIDOwnershipCondition`](TransferDIDOwnershipCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L15) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/TransferNFT721Condition.md b/docs/api-reference/classes/TransferNFT721Condition.md new file mode 100644 index 000000000..6fc9ddc81 --- /dev/null +++ b/docs/api-reference/classes/TransferNFT721Condition.md @@ -0,0 +1,1007 @@ +[@nevermined-io/sdk](../code-reference.md) / TransferNFT721Condition + +# Class: TransferNFT721Condition + +Condition allowing to transfer an NFT between the original owner and a receiver + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`TransferNFT721ConditionContext`\> + + ↳ **`TransferNFT721Condition`** + +## Table of contents + +### Constructors + +- [constructor](TransferNFT721Condition.md#constructor) + +### Properties + +- [address](TransferNFT721Condition.md#address) +- [contract](TransferNFT721Condition.md#contract) +- [contractName](TransferNFT721Condition.md#contractname) +- [events](TransferNFT721Condition.md#events) +- [version](TransferNFT721Condition.md#version) + +### Accessors + +- [artifactsFolder](TransferNFT721Condition.md#artifactsfolder) +- [circuitsFolder](TransferNFT721Condition.md#circuitsfolder) +- [config](TransferNFT721Condition.md#config) +- [instanceConfig](TransferNFT721Condition.md#instanceconfig) +- [instantiableConfig](TransferNFT721Condition.md#instantiableconfig) +- [logger](TransferNFT721Condition.md#logger) +- [nevermined](TransferNFT721Condition.md#nevermined) +- [web3](TransferNFT721Condition.md#web3) + +### Methods + +- [abortByTimeOut](TransferNFT721Condition.md#abortbytimeout) +- [call](TransferNFT721Condition.md#call) +- [fulfill](TransferNFT721Condition.md#fulfill) +- [fulfillInstance](TransferNFT721Condition.md#fulfillinstance) +- [fulfillPlain](TransferNFT721Condition.md#fulfillplain) +- [fulfillWithNode](TransferNFT721Condition.md#fulfillwithnode) +- [generateId](TransferNFT721Condition.md#generateid) +- [generateIdHash](TransferNFT721Condition.md#generateidhash) +- [generateIdWithSeed](TransferNFT721Condition.md#generateidwithseed) +- [getConditionFulfilledEvent](TransferNFT721Condition.md#getconditionfulfilledevent) +- [getFromAddress](TransferNFT721Condition.md#getfromaddress) +- [getInputsOfMethod](TransferNFT721Condition.md#getinputsofmethod) +- [getSignatureOfMethod](TransferNFT721Condition.md#getsignatureofmethod) +- [hashValues](TransferNFT721Condition.md#hashvalues) +- [hashValuesPlain](TransferNFT721Condition.md#hashvaluesplain) +- [init](TransferNFT721Condition.md#init) +- [instance](TransferNFT721Condition.md#instance) +- [instanceFromDDO](TransferNFT721Condition.md#instancefromddo) +- [nodeMethod](TransferNFT721Condition.md#nodemethod) +- [params](TransferNFT721Condition.md#params) +- [paramsFromDDO](TransferNFT721Condition.md#paramsfromddo) +- [paramsFromService](TransferNFT721Condition.md#paramsfromservice) +- [send](TransferNFT721Condition.md#send) +- [sendFrom](TransferNFT721Condition.md#sendfrom) +- [setInstanceConfig](TransferNFT721Condition.md#setinstanceconfig) +- [getInstance](TransferNFT721Condition.md#getinstance) +- [setInstanceConfig](TransferNFT721Condition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new TransferNFT721Condition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `nftReceiver`, `lockPaymentCondition`, `nftTokenAddress`, `willBeTransferred?`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill the transfer NFT condition. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :---------------------------------------------- | :------------ | :--------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The agreement identifier. | +| `did` | `string` | `undefined` | The DID of the asset with NFTs. | +| `nftReceiver` | `string` | `undefined` | The address of the account to receive the NFT. | +| `lockPaymentCondition` | `string` | `undefined` | lock payment condition identifier. | +| `nftTokenAddress` | `string` | `undefined` | address of the nft token to use. | +| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | +| `from?` | [`Account`](Account.md) | `undefined` | | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Condition state. + +**`Remarks`** + +Only DID owner or DID provider can call this method. + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:146](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L146) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `TransferNFT721ConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:171](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L171) + +--- + +### params + +▸ **params**(`did`, `nftHolder`, `nftReceiver`, `lockCondition`, `nftTokenAddress`, `willBeTransferred?`, `expiration?`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generates the hash of condition inputs. + +#### Parameters + +| Name | Type | Default value | Description | +| :------------------ | :-------- | :------------ | :--------------------------------------------------- | +| `did` | `string` | `undefined` | The DID of the asset with NFTs. | +| `nftHolder` | `string` | `undefined` | The address of the Holder of the NFT. | +| `nftReceiver` | `string` | `undefined` | The address of the granted user or the DID provider. | +| `lockCondition` | `string` | `undefined` | Lock condition identifier. | +| `nftTokenAddress` | `string` | `undefined` | The address of the NFT token to use. | +| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | +| `expiration` | `number` | `0` | The expiration time of the condition | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Hash of all the values + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L38) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`, `lockCondition`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :------------------------------- | +| `«destructured»` | `TransferNFT721ConditionContext` | +| `lockCondition` | `any` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:83](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L83) + +--- + +### paramsFromService + +▸ **paramsFromService**(`«destructured»`, `lockCondition`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :------------------------------- | +| `«destructured»` | `TransferNFT721ConditionContext` | +| `lockCondition` | `any` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:107](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L107) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`TransferNFT721Condition`](TransferNFT721Condition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`TransferNFT721Condition`](TransferNFT721Condition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L23) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/TransferNFTCondition.md b/docs/api-reference/classes/TransferNFTCondition.md new file mode 100644 index 000000000..91a3d377e --- /dev/null +++ b/docs/api-reference/classes/TransferNFTCondition.md @@ -0,0 +1,1059 @@ +[@nevermined-io/sdk](../code-reference.md) / TransferNFTCondition + +# Class: TransferNFTCondition + +Condition allowing to transfer an NFT between the original owner and a receiver + +## Hierarchy + +- [`ProviderCondition`](ProviderCondition.md)<`TransferNFTConditionContext`\> + + ↳ **`TransferNFTCondition`** + +## Table of contents + +### Constructors + +- [constructor](TransferNFTCondition.md#constructor) + +### Properties + +- [address](TransferNFTCondition.md#address) +- [contract](TransferNFTCondition.md#contract) +- [contractName](TransferNFTCondition.md#contractname) +- [events](TransferNFTCondition.md#events) +- [version](TransferNFTCondition.md#version) +- [NO_EXPIRY](TransferNFTCondition.md#no_expiry) + +### Accessors + +- [artifactsFolder](TransferNFTCondition.md#artifactsfolder) +- [circuitsFolder](TransferNFTCondition.md#circuitsfolder) +- [config](TransferNFTCondition.md#config) +- [instanceConfig](TransferNFTCondition.md#instanceconfig) +- [instantiableConfig](TransferNFTCondition.md#instantiableconfig) +- [logger](TransferNFTCondition.md#logger) +- [nevermined](TransferNFTCondition.md#nevermined) +- [web3](TransferNFTCondition.md#web3) + +### Methods + +- [abortByTimeOut](TransferNFTCondition.md#abortbytimeout) +- [call](TransferNFTCondition.md#call) +- [fulfill](TransferNFTCondition.md#fulfill) +- [fulfillForDelegate](TransferNFTCondition.md#fulfillfordelegate) +- [fulfillInstance](TransferNFTCondition.md#fulfillinstance) +- [fulfillPlain](TransferNFTCondition.md#fulfillplain) +- [fulfillWithNode](TransferNFTCondition.md#fulfillwithnode) +- [generateId](TransferNFTCondition.md#generateid) +- [generateIdHash](TransferNFTCondition.md#generateidhash) +- [generateIdWithSeed](TransferNFTCondition.md#generateidwithseed) +- [getConditionFulfilledEvent](TransferNFTCondition.md#getconditionfulfilledevent) +- [getFromAddress](TransferNFTCondition.md#getfromaddress) +- [getInputsOfMethod](TransferNFTCondition.md#getinputsofmethod) +- [getSignatureOfMethod](TransferNFTCondition.md#getsignatureofmethod) +- [hashValues](TransferNFTCondition.md#hashvalues) +- [hashValuesPlain](TransferNFTCondition.md#hashvaluesplain) +- [init](TransferNFTCondition.md#init) +- [instance](TransferNFTCondition.md#instance) +- [instanceFromDDO](TransferNFTCondition.md#instancefromddo) +- [nftContractFromService](TransferNFTCondition.md#nftcontractfromservice) +- [nodeMethod](TransferNFTCondition.md#nodemethod) +- [params](TransferNFTCondition.md#params) +- [paramsFromDDO](TransferNFTCondition.md#paramsfromddo) +- [send](TransferNFTCondition.md#send) +- [sendFrom](TransferNFTCondition.md#sendfrom) +- [setInstanceConfig](TransferNFTCondition.md#setinstanceconfig) +- [getInstance](TransferNFTCondition.md#getinstance) +- [setInstanceConfig](TransferNFTCondition.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new TransferNFTCondition**(`contractName`) + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `contractName` | `string` | + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[constructor](ProviderCondition.md#constructor) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L34) + +## Properties + +### address + +• **address**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[address](ProviderCondition.md#address) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L32) + +--- + +### contract + +• **contract**: `BaseContract` = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contract](ProviderCondition.md#contract) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L29) + +--- + +### contractName + +• `Readonly` **contractName**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[contractName](ProviderCondition.md#contractname) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L28) + +--- + +### events + +• **events**: [`ContractEvent`](ContractEvent.md) \| [`SubgraphEvent`](SubgraphEvent.md) = `null` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[events](ProviderCondition.md#events) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L30) + +--- + +### version + +• **version**: `string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[version](ProviderCondition.md#version) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L31) + +--- + +### NO_EXPIRY + +▪ `Static` `Readonly` **NO_EXPIRY**: `0` + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L26) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProviderCondition.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +ProviderCondition.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +ProviderCondition.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +ProviderCondition.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +ProviderCondition.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +ProviderCondition.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### abortByTimeOut + +▸ **abortByTimeOut**(`conditionId`, `from?`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------------------------- | +| `conditionId` | `string` | +| `from?` | [`Account`](Account.md) | +| `params?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[abortByTimeOut](ProviderCondition.md#abortbytimeout) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L88) + +--- + +### call + +▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | `string` | + +#### Returns + +`Promise`<`T`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[call](ProviderCondition.md#call) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L328) + +--- + +### fulfill + +▸ **fulfill**(`agreementId`, `did`, `nftReceiver`, `nftAmount`, `nftContractAddress`, `lockPaymentCondition`, `willBeTransferred?`, `expiration?`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill the transfer NFT condition. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :---------------------------------------------- | :------------ | :--------------------------------------------------- | +| `agreementId` | `string` | `undefined` | The agreement identifier. | +| `did` | `string` | `undefined` | The DID of the asset with NFTs. | +| `nftReceiver` | `string` | `undefined` | The address of the account to receive the NFT. | +| `nftAmount` | `bigint` | `undefined` | amount of NFTs to transfer. | +| `nftContractAddress` | `string` | `undefined` | Address of the nft contract | +| `lockPaymentCondition` | `string` | `undefined` | lock payment condition identifier. | +| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | +| `expiration` | `number` | `0` | - | +| `from?` | [`Account`](Account.md) | `undefined` | | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | - | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Condition state. + +**`Remarks`** + +Only DID owner or DID provider can call this method. + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[fulfill](ProviderCondition.md#fulfill) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:141](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L141) + +--- + +### fulfillForDelegate + +▸ **fulfillForDelegate**(`agreementId`, `did`, `nftHolder`, `nftReceiver`, `nftAmount`, `lockPaymentCondition`, `nftAddress`, `willBeTransferred?`, `expiration?`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +Fulfill the transfer NFT condition. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :---------------------------------------------- | :------------ | :------------------------------------------------------------ | +| `agreementId` | `string` | `undefined` | The agreement identifier. | +| `did` | `string` | `undefined` | The DID of the asset with NFTs. | +| `nftHolder` | `string` | `undefined` | The address of the account currently holding the NFT. | +| `nftReceiver` | `string` | `undefined` | The address of the account to receive the NFT. | +| `nftAmount` | `bigint` | `undefined` | The amount of NFTs to transfer. | +| `lockPaymentCondition` | `string` | `undefined` | The lock payment condition identifier. | +| `nftAddress` | `string` | `undefined` | - | +| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | +| `expiration` | `bigint` | `undefined` | Block in which the token expires. If zero means no expiration | +| `from?` | [`Account`](Account.md) | `undefined` | Account sending the transaction | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | Transaction parameters | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +Condition state. + +**`Remarks`** + +Only DID owner or DID provider can call this method. + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:187](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L187) + +--- + +### fulfillInstance + +▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :----------------- | :----------------------------------------------------------------------------------------- | :------------ | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | +| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillInstance](ProviderCondition.md#fulfillinstance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:150](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L150) + +--- + +### fulfillPlain + +▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `txParams?`, `method?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :-------------------------------------------------------- | :------------ | +| `agreementId` | `string` | `undefined` | +| `args` | `any`[] | `undefined` | +| `from?` | [`Account`](Account.md) | `undefined` | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | `undefined` | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | `'fulfill'` | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillPlain](ProviderCondition.md#fulfillplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L63) + +--- + +### fulfillWithNode + +▸ **fulfillWithNode**(`cond`, `additionalParams`, `from?`, `txParams?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :----------------- | :----------------------------------------------------------------------------------------- | +| `cond` | [`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | +| `additionalParams` | `Record`<`string`, `unknown`\> | +| `from?` | [`Account`](Account.md) | +| `txParams?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[fulfillWithNode](ProviderCondition.md#fulfillwithnode) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L194) + +--- + +### generateId + +▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateId](ProviderCondition.md#generateid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L77) + +--- + +### generateIdHash + +▸ **generateIdHash**(`agreementId`, `...values`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `...values` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdHash](ProviderCondition.md#generateidhash) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L73) + +--- + +### generateIdWithSeed + +▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | +| `valueHash` | `string` | + +#### Returns + +`Promise`<[`string`, `string`]\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[generateIdWithSeed](ProviderCondition.md#generateidwithseed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L81) + +--- + +### getConditionFulfilledEvent + +▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../code-reference.md#eventresult) + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +[`EventResult`](../code-reference.md#eventresult) + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getConditionFulfilledEvent](ProviderCondition.md#getconditionfulfilledevent) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L92) + +--- + +### getFromAddress + +▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `from?` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getFromAddress](ProviderCondition.md#getfromaddress) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L80) + +--- + +### getInputsOfMethod + +▸ **getInputsOfMethod**(`methodName`): readonly `ParamType`[] + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `methodName` | `string` | + +#### Returns + +readonly `ParamType`[] + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getInputsOfMethod](ProviderCondition.md#getinputsofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L44) + +--- + +### getSignatureOfMethod + +▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :------- | :------------ | +| `methodName` | `string` | `undefined` | +| `args` | `any`[] | `[]` | + +#### Returns + +`string` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[getSignatureOfMethod](ProviderCondition.md#getsignatureofmethod) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L39) + +--- + +### hashValues + +▸ **hashValues**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValues](ProviderCondition.md#hashvalues) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L129) + +--- + +### hashValuesPlain + +▸ **hashValuesPlain**(`...args`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :-------- | :------ | +| `...args` | `any`[] | + +#### Returns + +`Promise`<`string`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[hashValuesPlain](ProviderCondition.md#hashvaluesplain) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L133) + +--- + +### init + +▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :--------- | :---------------------------------------------------------- | :------------ | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | `undefined` | +| `optional` | `boolean` | `false` | + +#### Returns + +`Promise`<`void`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[init](ProviderCondition.md#init) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L49) + +--- + +### instance + +▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------- | +| `agreementId` | `string` | +| `params` | [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instance](ProviderCondition.md#instance) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:174](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L174) + +--- + +### instanceFromDDO + +▸ **instanceFromDDO**(`agreementId`, `ctx`, `...args`): `Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :------------ | :-------------------------------------------------------------------- | +| `agreementId` | `string` | +| `ctx` | `TransferNFTConditionContext` | +| `...args` | [`ConditionInstanceSmall`](../interfaces/ConditionInstanceSmall.md)[] | + +#### Returns + +`Promise`<[`ConditionInstance`](../interfaces/ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[instanceFromDDO](ProviderCondition.md#instancefromddo) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L142) + +--- + +### nftContractFromService + +▸ **nftContractFromService**(`service`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------ | +| `service` | [`ServiceCommon`](../interfaces/ServiceCommon.md) | + +#### Returns + +`string` + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:92](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L92) + +--- + +### nodeMethod + +▸ **nodeMethod**(): [`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Returns + +[`ConditionMethod`](../code-reference.md#conditionmethod) + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[nodeMethod](ProviderCondition.md#nodemethod) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:213](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L213) + +--- + +### params + +▸ **params**(`did`, `nftHolder`, `nftReceiver`, `nftAmount`, `lockCondition`, `nftContractAddress?`, `willBeTransferred?`, `expiration?`): [`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Generates the hash of condition inputs. + +#### Parameters + +| Name | Type | Default value | Description | +| :-------------------- | :-------- | :------------ | :--------------------------------------------------- | +| `did` | `string` | `undefined` | The DID of the asset with NFTs. | +| `nftHolder` | `string` | `undefined` | The address of the holder of the NFT. | +| `nftReceiver` | `string` | `undefined` | The address of the granted user or the DID provider. | +| `nftAmount` | `bigint` | `undefined` | Amount of NFTs to transfer. | +| `lockCondition` | `string` | `undefined` | Lock condition identifier. | +| `nftContractAddress?` | `string` | `undefined` | The address of the NFT token to use. | +| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | +| `expiration` | `number` | `0` | - | + +#### Returns + +[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\> + +Hash of all the values + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[params](ProviderCondition.md#params) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L44) + +--- + +### paramsFromDDO + +▸ **paramsFromDDO**(`«destructured»`, `lockCondition`): `Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :---------------------------- | +| `«destructured»` | `TransferNFTConditionContext` | +| `lockCondition` | `any` | + +#### Returns + +`Promise`<[`ConditionParameters`](../interfaces/ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[paramsFromDDO](ProviderCondition.md#paramsfromddo) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L99) + +--- + +### send + +▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `from` | `string` | +| `args` | `any`[] | +| `params` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[send](ProviderCondition.md#send) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:235](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L235) + +--- + +### sendFrom + +▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractTransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------- | +| `name` | `string` | +| `args` | `any`[] | +| `from?` | [`Account`](Account.md) | +| `value?` | [`TxParameters`](../interfaces/TxParameters.md) | + +#### Returns + +`Promise`<`ContractTransactionReceipt`\> + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[sendFrom](ProviderCondition.md#sendfrom) + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:88](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L88) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`config`): `Promise`<[`TransferNFTCondition`](TransferNFTCondition.md)\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`Promise`<[`TransferNFTCondition`](TransferNFTCondition.md)\> + +#### Overrides + +[ProviderCondition](ProviderCondition.md).[getInstance](ProviderCondition.md#getinstance) + +#### Defined in + +[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L28) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[ProviderCondition](ProviderCondition.md).[setInstanceConfig](ProviderCondition.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/UtilsApi.md b/docs/api-reference/classes/UtilsApi.md new file mode 100644 index 000000000..0df6db865 --- /dev/null +++ b/docs/api-reference/classes/UtilsApi.md @@ -0,0 +1,386 @@ +[@nevermined-io/sdk](../code-reference.md) / UtilsApi + +# Class: UtilsApi + +Nevermined Utils API + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`UtilsApi`** + +## Table of contents + +### Constructors + +- [constructor](UtilsApi.md#constructor) + +### Properties + +- [agreements](UtilsApi.md#agreements) +- [contractHandler](UtilsApi.md#contracthandler) +- [fetch](UtilsApi.md#fetch) +- [files](UtilsApi.md#files) +- [jwt](UtilsApi.md#jwt) +- [signature](UtilsApi.md#signature) +- [token](UtilsApi.md#token) +- [versions](UtilsApi.md#versions) + +### Accessors + +- [artifactsFolder](UtilsApi.md#artifactsfolder) +- [circuitsFolder](UtilsApi.md#circuitsfolder) +- [config](UtilsApi.md#config) +- [instanceConfig](UtilsApi.md#instanceconfig) +- [instantiableConfig](UtilsApi.md#instantiableconfig) +- [logger](UtilsApi.md#logger) +- [nevermined](UtilsApi.md#nevermined) +- [web3](UtilsApi.md#web3) + +### Methods + +- [setInstanceConfig](UtilsApi.md#setinstanceconfig) +- [getInstance](UtilsApi.md#getinstance) +- [setInstanceConfig](UtilsApi.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new UtilsApi**(`config`) + +Creates a new AssetsApi + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L57) + +## Properties + +### agreements + +• **agreements**: [`ServiceAgreement`](ServiceAgreement.md) + +Agreement utils. + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L15) + +--- + +### contractHandler + +• **contractHandler**: [`ContractHandler`](ContractHandler.md) + +Contract utils + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L50) + +--- + +### fetch + +• **fetch**: [`WebServiceConnector`](WebServiceConnector.md) + +Fetch utils. + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L20) + +--- + +### files + +• **files**: [`Files`](Files.md) + +Files utils. + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L25) + +--- + +### jwt + +• **jwt**: [`JwtUtils`](JwtUtils.md) + +Jwt utils. + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L30) + +--- + +### signature + +• **signature**: [`SignatureUtils`](SignatureUtils.md) + +Signature utils. + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L35) + +--- + +### token + +• **token**: [`TokenUtils`](TokenUtils.md) + +Token utils. + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L40) + +--- + +### versions + +• **versions**: [`Versions`](Versions.md) + +Token utils. + +#### Defined in + +[src/nevermined/api/UtilsApi.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/UtilsApi.ts#L45) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Versions.md b/docs/api-reference/classes/Versions.md new file mode 100644 index 000000000..a2146c6a5 --- /dev/null +++ b/docs/api-reference/classes/Versions.md @@ -0,0 +1,294 @@ +[@nevermined-io/sdk](../code-reference.md) / Versions + +# Class: Versions + +Versions submodule . + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`Versions`** + +## Table of contents + +### Constructors + +- [constructor](Versions.md#constructor) + +### Accessors + +- [artifactsFolder](Versions.md#artifactsfolder) +- [circuitsFolder](Versions.md#circuitsfolder) +- [config](Versions.md#config) +- [instanceConfig](Versions.md#instanceconfig) +- [instantiableConfig](Versions.md#instantiableconfig) +- [logger](Versions.md#logger) +- [nevermined](Versions.md#nevermined) +- [web3](Versions.md#web3) + +### Methods + +- [get](Versions.md#get) +- [setInstanceConfig](Versions.md#setinstanceconfig) +- [getInstance](Versions.md#getinstance) +- [setInstanceConfig](Versions.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new Versions**(`config`) + +Creates a new Versions + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------------------------- | :--------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | Configuration of the Nevermined instance | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/Versions.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L46) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### get + +▸ **get**(): `Promise`<[`PlatformVersions`](../interfaces/PlatformVersions.md)\> + +#### Returns + +`Promise`<[`PlatformVersions`](../interfaces/PlatformVersions.md)\> + +#### Defined in + +[src/nevermined/Versions.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L51) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/Web3Error.md b/docs/api-reference/classes/Web3Error.md new file mode 100644 index 000000000..6cf23df5a --- /dev/null +++ b/docs/api-reference/classes/Web3Error.md @@ -0,0 +1,165 @@ +[@nevermined-io/sdk](../code-reference.md) / Web3Error + +# Class: Web3Error + +## Hierarchy + +- `Error` + + ↳ **`Web3Error`** + +## Table of contents + +### Constructors + +- [constructor](Web3Error.md#constructor) + +### Properties + +- [message](Web3Error.md#message) +- [name](Web3Error.md#name) +- [stack](Web3Error.md#stack) +- [prepareStackTrace](Web3Error.md#preparestacktrace) +- [stackTraceLimit](Web3Error.md#stacktracelimit) + +### Methods + +- [captureStackTrace](Web3Error.md#capturestacktrace) + +## Constructors + +### constructor + +• **new Web3Error**(`message`) + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `message` | `string` | + +#### Overrides + +Error.constructor + +#### Defined in + +[src/errors/Web3Error.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/errors/Web3Error.ts#L2) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +--- + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +--- + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +--- + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------------ | :----------- | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +--- + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :---------------- | :--------- | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/Web3Provider.md b/docs/api-reference/classes/Web3Provider.md new file mode 100644 index 000000000..d95b92272 --- /dev/null +++ b/docs/api-reference/classes/Web3Provider.md @@ -0,0 +1,43 @@ +[@nevermined-io/sdk](../code-reference.md) / Web3Provider + +# Class: Web3Provider + +## Table of contents + +### Constructors + +- [constructor](Web3Provider.md#constructor) + +### Methods + +- [getWeb3](Web3Provider.md#getweb3) + +## Constructors + +### constructor + +• **new Web3Provider**() + +## Methods + +### getWeb3 + +▸ `Static` **getWeb3**(`config?`): `Promise`<`JsonRpcProvider` \| `BrowserProvider`\> + +Returns ethers.Provider instance. + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------ | +| `config` | `Partial`<[`NeverminedOptions`](NeverminedOptions.md)\> | + +#### Returns + +`Promise`<`JsonRpcProvider` \| `BrowserProvider`\> + +web3 instance + +#### Defined in + +[src/keeper/Web3Provider.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/Web3Provider.ts#L10) diff --git a/docs/api-reference/classes/Web3ProviderWrapper.md b/docs/api-reference/classes/Web3ProviderWrapper.md new file mode 100644 index 000000000..720111dc8 --- /dev/null +++ b/docs/api-reference/classes/Web3ProviderWrapper.md @@ -0,0 +1,64 @@ +[@nevermined-io/sdk](../code-reference.md) / Web3ProviderWrapper + +# Class: Web3ProviderWrapper + +## Table of contents + +### Constructors + +- [constructor](Web3ProviderWrapper.md#constructor) + +### Properties + +- [provider](Web3ProviderWrapper.md#provider) + +### Methods + +- [send](Web3ProviderWrapper.md#send) + +## Constructors + +### constructor + +• **new Web3ProviderWrapper**(`provider`) + +#### Parameters + +| Name | Type | +| :--------- | :------------------------------------- | +| `provider` | `JsonRpcProvider` \| `BrowserProvider` | + +#### Defined in + +[src/keeper/utils.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L82) + +## Properties + +### provider + +• **provider**: `JsonRpcProvider` \| `BrowserProvider` + +#### Defined in + +[src/keeper/utils.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L80) + +## Methods + +### send + +▸ **send**(`payload`, `callback`): `void` + +#### Parameters + +| Name | Type | +| :--------- | :--------------------------------------------------------------------------------------------- | +| `payload` | [`JsonRpcPayload`](../interfaces/JsonRpcPayload.md) | +| `callback` | (`error`: `Error`, `result?`: [`JsonRpcResponse`](../interfaces/JsonRpcResponse.md)) => `void` | + +#### Returns + +`void` + +#### Defined in + +[src/keeper/utils.ts:85](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L85) diff --git a/docs/api-reference/classes/WebServiceConnector.md b/docs/api-reference/classes/WebServiceConnector.md new file mode 100644 index 000000000..e8b190950 --- /dev/null +++ b/docs/api-reference/classes/WebServiceConnector.md @@ -0,0 +1,586 @@ +[@nevermined-io/sdk](../code-reference.md) / WebServiceConnector + +# Class: WebServiceConnector + +Provides a common interface to web services. + +## Hierarchy + +- [`Instantiable`](Instantiable.md) + + ↳ **`WebServiceConnector`** + +## Table of contents + +### Constructors + +- [constructor](WebServiceConnector.md#constructor) + +### Accessors + +- [artifactsFolder](WebServiceConnector.md#artifactsfolder) +- [circuitsFolder](WebServiceConnector.md#circuitsfolder) +- [config](WebServiceConnector.md#config) +- [instanceConfig](WebServiceConnector.md#instanceconfig) +- [instantiableConfig](WebServiceConnector.md#instantiableconfig) +- [logger](WebServiceConnector.md#logger) +- [nevermined](WebServiceConnector.md#nevermined) +- [web3](WebServiceConnector.md#web3) + +### Methods + +- [\_sleep](WebServiceConnector.md#_sleep) +- [delete](WebServiceConnector.md#delete) +- [downloadFile](WebServiceConnector.md#downloadfile) +- [downloadUrl](WebServiceConnector.md#downloadurl) +- [fetch](WebServiceConnector.md#fetch) +- [fetchCID](WebServiceConnector.md#fetchcid) +- [fetchToken](WebServiceConnector.md#fetchtoken) +- [get](WebServiceConnector.md#get) +- [getFileResponse](WebServiceConnector.md#getfileresponse) +- [post](WebServiceConnector.md#post) +- [put](WebServiceConnector.md#put) +- [setInstanceConfig](WebServiceConnector.md#setinstanceconfig) +- [uploadFile](WebServiceConnector.md#uploadfile) +- [uploadMessage](WebServiceConnector.md#uploadmessage) +- [getIPFSAuthToken](WebServiceConnector.md#getipfsauthtoken) +- [getInstance](WebServiceConnector.md#getinstance) +- [setInstanceConfig](WebServiceConnector.md#setinstanceconfig-1) + +## Constructors + +### constructor + +• **new WebServiceConnector**(`config`) + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Overrides + +[Instantiable](Instantiable.md).[constructor](Instantiable.md#constructor) + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L21) + +## Accessors + +### artifactsFolder + +• `Protected` `get` **artifactsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.artifactsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L73) + +--- + +### circuitsFolder + +• `Protected` `get` **circuitsFolder**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Instantiable.circuitsFolder + +#### Defined in + +[src/Instantiable.abstract.ts:77](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L77) + +--- + +### config + +• `Protected` `get` **config**(): [`NeverminedOptions`](NeverminedOptions.md) + +#### Returns + +[`NeverminedOptions`](NeverminedOptions.md) + +#### Inherited from + +Instantiable.config + +#### Defined in + +[src/Instantiable.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L57) + +--- + +### instanceConfig + +• `Protected` `get` **instanceConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instanceConfig + +#### Defined in + +[src/Instantiable.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L81) + +--- + +### instantiableConfig + +• `Protected` `get` **instantiableConfig**(): [`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Returns + +[`InstantiableConfig`](../interfaces/InstantiableConfig.md) + +#### Inherited from + +Instantiable.instantiableConfig + +#### Defined in + +[src/Instantiable.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L50) + +--- + +### logger + +• `Protected` `get` **logger**(): `Logger` + +#### Returns + +`Logger` + +#### Inherited from + +Instantiable.logger + +#### Defined in + +[src/Instantiable.abstract.ts:64](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L64) + +--- + +### nevermined + +• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) + +#### Returns + +[`Nevermined`](Nevermined.md) + +#### Inherited from + +Instantiable.nevermined + +#### Defined in + +[src/Instantiable.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L35) + +--- + +### web3 + +• `get` **web3**(): `JsonRpcProvider` \| `BrowserProvider` + +#### Returns + +`JsonRpcProvider` \| `BrowserProvider` + +#### Inherited from + +Instantiable.web3 + +#### Defined in + +[src/Instantiable.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L42) + +## Methods + +### \_sleep + +▸ `Private` **\_sleep**(`ms`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :--- | :------- | +| `ms` | `number` | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:221](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L221) + +--- + +### delete + +▸ **delete**(`url`, `payload?`, `headers?`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | +| :--------- | :--------- | +| `url` | `string` | +| `payload?` | `BodyInit` | +| `headers` | `Object` | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:65](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L65) + +--- + +### downloadFile + +▸ **downloadFile**(`url`, `destination?`, `index?`, `headers?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `url` | `string` | +| `destination?` | `string` | +| `index?` | `number` | +| `headers?` | `Object` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L80) + +--- + +### downloadUrl + +▸ **downloadUrl**(`url`, `headers?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `url` | `string` | +| `headers?` | `any` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:132](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L132) + +--- + +### fetch + +▸ `Private` **fetch**(`url`, `opts`, `numberTries?`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------------ | :------------ | +| `url` | `any` | `undefined` | +| `opts` | `RequestInit` | `undefined` | +| `numberTries` | `number` | `1` | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:203](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L203) + +--- + +### fetchCID + +▸ **fetchCID**(`cid`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `cid` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:175](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L175) + +--- + +### fetchToken + +▸ **fetchToken**(`url`, `grantToken`, `numberTries?`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------- | :------------ | +| `url` | `string` | `undefined` | +| `grantToken` | `string` | `undefined` | +| `numberTries` | `number` | `1` | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:159](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L159) + +--- + +### get + +▸ **get**(`url`, `headers?`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `url` | `any` | +| `headers` | `Object` | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L41) + +--- + +### getFileResponse + +▸ `Private` **getFileResponse**(`url`, `index?`, `headers?`): `Promise`<{ `name`: `string` ; `response`: `Response` }\> + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `url` | `string` | +| `index?` | `number` | +| `headers?` | `Object` | + +#### Returns + +`Promise`<{ `name`: `string` ; `response`: `Response` }\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:107](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L107) + +--- + +### post + +▸ **post**(`url`, `payload`, `headers?`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | +| :-------- | :--------- | +| `url` | `string` | +| `payload` | `BodyInit` | +| `headers` | `Object` | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L26) + +--- + +### put + +▸ **put**(`url`, `payload`, `headers?`): `Promise`<`Response`\> + +#### Parameters + +| Name | Type | +| :-------- | :--------- | +| `url` | `string` | +| `payload` | `BodyInit` | +| `headers` | `Object` | + +#### Returns + +`Promise`<`Response`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L50) + +--- + +### setInstanceConfig + +▸ `Protected` **setInstanceConfig**(`config`): `void` + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------- | +| `config` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig) + +#### Defined in + +[src/Instantiable.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L99) + +--- + +### uploadFile + +▸ **uploadFile**(`url`, `data`, `encrypt?`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :--------- | :----------- | +| `url` | `string` | +| `data` | `ReadStream` | +| `encrypt?` | `boolean` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:149](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L149) + +--- + +### uploadMessage + +▸ **uploadMessage**(`url`, `data`, `encrypt?`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :--------- | :-------- | +| `url` | `string` | +| `data` | `string` | +| `encrypt?` | `boolean` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:140](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L140) + +--- + +### getIPFSAuthToken + +▸ `Static` `Private` **getIPFSAuthToken**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/nevermined/utils/WebServiceConnector.ts:193](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/WebServiceConnector.ts#L193) + +--- + +### getInstance + +▸ `Static` **getInstance**(`..._args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :---- | +| `..._args` | `any` | + +#### Returns + +`any` + +#### Inherited from + +[Instantiable](Instantiable.md).[getInstance](Instantiable.md#getinstance) + +#### Defined in + +[src/Instantiable.abstract.ts:86](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L86) + +--- + +### setInstanceConfig + +▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------- | +| `T` | extends [`Instantiable`](Instantiable.md) | + +#### Parameters + +| Name | Type | +| :------------------- | :---------------------------------------------------------- | +| `instance` | `T` | +| `instantiableConfig` | [`InstantiableConfig`](../interfaces/InstantiableConfig.md) | + +#### Returns + +`void` + +#### Inherited from + +[Instantiable](Instantiable.md).[setInstanceConfig](Instantiable.md#setinstanceconfig-1) + +#### Defined in + +[src/Instantiable.abstract.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L90) diff --git a/docs/api-reference/classes/conditions.AaveBorrowCondition.md b/docs/api-reference/classes/conditions.AaveBorrowCondition.md deleted file mode 100644 index 040c0e315..000000000 --- a/docs/api-reference/classes/conditions.AaveBorrowCondition.md +++ /dev/null @@ -1,1119 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / AaveBorrowCondition - -# Class: AaveBorrowCondition - -[conditions](../modules/conditions.md).AaveBorrowCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`AaveBorrowConditionContext`\> - - ↳ **`AaveBorrowCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.AaveBorrowCondition.md#constructor) - -### Properties - -- [contract](conditions.AaveBorrowCondition.md#contract) -- [contractName](conditions.AaveBorrowCondition.md#contractname) -- [events](conditions.AaveBorrowCondition.md#events) -- [version](conditions.AaveBorrowCondition.md#version) - -### Accessors - -- [address](conditions.AaveBorrowCondition.md#address) -- [artifactsFolder](conditions.AaveBorrowCondition.md#artifactsfolder) -- [config](conditions.AaveBorrowCondition.md#config) -- [instanceConfig](conditions.AaveBorrowCondition.md#instanceconfig) -- [instantiableConfig](conditions.AaveBorrowCondition.md#instantiableconfig) -- [logger](conditions.AaveBorrowCondition.md#logger) -- [nevermined](conditions.AaveBorrowCondition.md#nevermined) -- [web3](conditions.AaveBorrowCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.AaveBorrowCondition.md#abortbytimeout) -- [addresses](conditions.AaveBorrowCondition.md#addresses) -- [call](conditions.AaveBorrowCondition.md#call) -- [checkExists](conditions.AaveBorrowCondition.md#checkexists) -- [findSigner](conditions.AaveBorrowCondition.md#findsigner) -- [fulfill](conditions.AaveBorrowCondition.md#fulfill) -- [fulfillGateway](conditions.AaveBorrowCondition.md#fulfillgateway) -- [fulfillInstance](conditions.AaveBorrowCondition.md#fulfillinstance) -- [fulfillPlain](conditions.AaveBorrowCondition.md#fulfillplain) -- [gatewayMethod](conditions.AaveBorrowCondition.md#gatewaymethod) -- [generateId](conditions.AaveBorrowCondition.md#generateid) -- [generateIdHash](conditions.AaveBorrowCondition.md#generateidhash) -- [generateIdWithSeed](conditions.AaveBorrowCondition.md#generateidwithseed) -- [getAddress](conditions.AaveBorrowCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.AaveBorrowCondition.md#getconditionfulfilledevent) -- [getContract](conditions.AaveBorrowCondition.md#getcontract) -- [getFromAddress](conditions.AaveBorrowCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.AaveBorrowCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.AaveBorrowCondition.md#getsignatureofmethod) -- [hashValues](conditions.AaveBorrowCondition.md#hashvalues) -- [hashValuesPlain](conditions.AaveBorrowCondition.md#hashvaluesplain) -- [init](conditions.AaveBorrowCondition.md#init) -- [instance](conditions.AaveBorrowCondition.md#instance) -- [instanceFromDDO](conditions.AaveBorrowCondition.md#instancefromddo) -- [params](conditions.AaveBorrowCondition.md#params) -- [paramsFromDDO](conditions.AaveBorrowCondition.md#paramsfromddo) -- [send](conditions.AaveBorrowCondition.md#send) -- [sendFrom](conditions.AaveBorrowCondition.md#sendfrom) -- [setInstanceConfig](conditions.AaveBorrowCondition.md#setinstanceconfig) -- [addressesStatic](conditions.AaveBorrowCondition.md#addressesstatic) -- [findSignerStatic](conditions.AaveBorrowCondition.md#findsignerstatic) -- [getInstance](conditions.AaveBorrowCondition.md#getinstance) -- [setInstanceConfig](conditions.AaveBorrowCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new AaveBorrowCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `assetToBorrow`, `amount`, `interestRateMode`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `vaultAddress` | `string` | -| `assetToBorrow` | `string` | -| `amount` | `string` | -| `interestRateMode` | `number` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/defi/AaveBorrowCondition.ts:62](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveBorrowCondition.ts#L62) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `AaveBorrowConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `vaultAddress`, `assetToBorrow`, `amount`, `interestRateMode`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :----------------- | :------- | -| `did` | `string` | -| `vaultAddress` | `string` | -| `assetToBorrow` | `string` | -| `amount` | `string` | -| `interestRateMode` | `number` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/defi/AaveBorrowCondition.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveBorrowCondition.ts#L30) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :--------------------------- | -| `__namedParameters` | `AaveBorrowConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/defi/AaveBorrowCondition.ts:46](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveBorrowCondition.ts#L46) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`AaveBorrowCondition`](conditions.AaveBorrowCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`AaveBorrowCondition`](conditions.AaveBorrowCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/defi/AaveBorrowCondition.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveBorrowCondition.ts#L19) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.AaveCollateralDepositCondition.md b/docs/api-reference/classes/conditions.AaveCollateralDepositCondition.md deleted file mode 100644 index 48487992e..000000000 --- a/docs/api-reference/classes/conditions.AaveCollateralDepositCondition.md +++ /dev/null @@ -1,1123 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / AaveCollateralDepositCondition - -# Class: AaveCollateralDepositCondition - -[conditions](../modules/conditions.md).AaveCollateralDepositCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`AaveCollateralDepositConditionContext`\> - - ↳ **`AaveCollateralDepositCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.AaveCollateralDepositCondition.md#constructor) - -### Properties - -- [contract](conditions.AaveCollateralDepositCondition.md#contract) -- [contractName](conditions.AaveCollateralDepositCondition.md#contractname) -- [events](conditions.AaveCollateralDepositCondition.md#events) -- [version](conditions.AaveCollateralDepositCondition.md#version) - -### Accessors - -- [address](conditions.AaveCollateralDepositCondition.md#address) -- [artifactsFolder](conditions.AaveCollateralDepositCondition.md#artifactsfolder) -- [config](conditions.AaveCollateralDepositCondition.md#config) -- [instanceConfig](conditions.AaveCollateralDepositCondition.md#instanceconfig) -- [instantiableConfig](conditions.AaveCollateralDepositCondition.md#instantiableconfig) -- [logger](conditions.AaveCollateralDepositCondition.md#logger) -- [nevermined](conditions.AaveCollateralDepositCondition.md#nevermined) -- [web3](conditions.AaveCollateralDepositCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.AaveCollateralDepositCondition.md#abortbytimeout) -- [addresses](conditions.AaveCollateralDepositCondition.md#addresses) -- [call](conditions.AaveCollateralDepositCondition.md#call) -- [checkExists](conditions.AaveCollateralDepositCondition.md#checkexists) -- [findSigner](conditions.AaveCollateralDepositCondition.md#findsigner) -- [fulfill](conditions.AaveCollateralDepositCondition.md#fulfill) -- [fulfillGateway](conditions.AaveCollateralDepositCondition.md#fulfillgateway) -- [fulfillInstance](conditions.AaveCollateralDepositCondition.md#fulfillinstance) -- [fulfillPlain](conditions.AaveCollateralDepositCondition.md#fulfillplain) -- [gatewayMethod](conditions.AaveCollateralDepositCondition.md#gatewaymethod) -- [generateId](conditions.AaveCollateralDepositCondition.md#generateid) -- [generateIdHash](conditions.AaveCollateralDepositCondition.md#generateidhash) -- [generateIdWithSeed](conditions.AaveCollateralDepositCondition.md#generateidwithseed) -- [getAddress](conditions.AaveCollateralDepositCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.AaveCollateralDepositCondition.md#getconditionfulfilledevent) -- [getContract](conditions.AaveCollateralDepositCondition.md#getcontract) -- [getFromAddress](conditions.AaveCollateralDepositCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.AaveCollateralDepositCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.AaveCollateralDepositCondition.md#getsignatureofmethod) -- [hashValues](conditions.AaveCollateralDepositCondition.md#hashvalues) -- [hashValuesPlain](conditions.AaveCollateralDepositCondition.md#hashvaluesplain) -- [init](conditions.AaveCollateralDepositCondition.md#init) -- [instance](conditions.AaveCollateralDepositCondition.md#instance) -- [instanceFromDDO](conditions.AaveCollateralDepositCondition.md#instancefromddo) -- [params](conditions.AaveCollateralDepositCondition.md#params) -- [paramsFromDDO](conditions.AaveCollateralDepositCondition.md#paramsfromddo) -- [send](conditions.AaveCollateralDepositCondition.md#send) -- [sendFrom](conditions.AaveCollateralDepositCondition.md#sendfrom) -- [setInstanceConfig](conditions.AaveCollateralDepositCondition.md#setinstanceconfig) -- [addressesStatic](conditions.AaveCollateralDepositCondition.md#addressesstatic) -- [findSignerStatic](conditions.AaveCollateralDepositCondition.md#findsignerstatic) -- [getInstance](conditions.AaveCollateralDepositCondition.md#getinstance) -- [setInstanceConfig](conditions.AaveCollateralDepositCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new AaveCollateralDepositCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `vaultAddress` | `string` | -| `collateralAsset` | `string` | -| `collateralAmount` | `string` | -| `delegatedAsset` | `string` | -| `delegatedAmount` | `string` | -| `interestRateMode` | `number` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:71](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L71) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `AaveCollateralDepositConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `vaultAddress`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :----------------- | :------- | -| `did` | `string` | -| `vaultAddress` | `string` | -| `collateralAsset` | `string` | -| `collateralAmount` | `string` | -| `delegatedAsset` | `string` | -| `delegatedAmount` | `string` | -| `interestRateMode` | `number` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L32) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :-------------------------------------- | -| `__namedParameters` | `AaveCollateralDepositConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:51](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L51) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`AaveCollateralDepositCondition`](conditions.AaveCollateralDepositCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`AaveCollateralDepositCondition`](conditions.AaveCollateralDepositCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralDepositCondition.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralDepositCondition.ts#L21) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.AaveCollateralWithdrawCondition.md b/docs/api-reference/classes/conditions.AaveCollateralWithdrawCondition.md deleted file mode 100644 index 496fc5f95..000000000 --- a/docs/api-reference/classes/conditions.AaveCollateralWithdrawCondition.md +++ /dev/null @@ -1,1115 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / AaveCollateralWithdrawCondition - -# Class: AaveCollateralWithdrawCondition - -[conditions](../modules/conditions.md).AaveCollateralWithdrawCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`AaveCollateralWithdrawConditionContext`\> - - ↳ **`AaveCollateralWithdrawCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.AaveCollateralWithdrawCondition.md#constructor) - -### Properties - -- [contract](conditions.AaveCollateralWithdrawCondition.md#contract) -- [contractName](conditions.AaveCollateralWithdrawCondition.md#contractname) -- [events](conditions.AaveCollateralWithdrawCondition.md#events) -- [version](conditions.AaveCollateralWithdrawCondition.md#version) - -### Accessors - -- [address](conditions.AaveCollateralWithdrawCondition.md#address) -- [artifactsFolder](conditions.AaveCollateralWithdrawCondition.md#artifactsfolder) -- [config](conditions.AaveCollateralWithdrawCondition.md#config) -- [instanceConfig](conditions.AaveCollateralWithdrawCondition.md#instanceconfig) -- [instantiableConfig](conditions.AaveCollateralWithdrawCondition.md#instantiableconfig) -- [logger](conditions.AaveCollateralWithdrawCondition.md#logger) -- [nevermined](conditions.AaveCollateralWithdrawCondition.md#nevermined) -- [web3](conditions.AaveCollateralWithdrawCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.AaveCollateralWithdrawCondition.md#abortbytimeout) -- [addresses](conditions.AaveCollateralWithdrawCondition.md#addresses) -- [call](conditions.AaveCollateralWithdrawCondition.md#call) -- [checkExists](conditions.AaveCollateralWithdrawCondition.md#checkexists) -- [findSigner](conditions.AaveCollateralWithdrawCondition.md#findsigner) -- [fulfill](conditions.AaveCollateralWithdrawCondition.md#fulfill) -- [fulfillGateway](conditions.AaveCollateralWithdrawCondition.md#fulfillgateway) -- [fulfillInstance](conditions.AaveCollateralWithdrawCondition.md#fulfillinstance) -- [fulfillPlain](conditions.AaveCollateralWithdrawCondition.md#fulfillplain) -- [gatewayMethod](conditions.AaveCollateralWithdrawCondition.md#gatewaymethod) -- [generateId](conditions.AaveCollateralWithdrawCondition.md#generateid) -- [generateIdHash](conditions.AaveCollateralWithdrawCondition.md#generateidhash) -- [generateIdWithSeed](conditions.AaveCollateralWithdrawCondition.md#generateidwithseed) -- [getAddress](conditions.AaveCollateralWithdrawCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.AaveCollateralWithdrawCondition.md#getconditionfulfilledevent) -- [getContract](conditions.AaveCollateralWithdrawCondition.md#getcontract) -- [getFromAddress](conditions.AaveCollateralWithdrawCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.AaveCollateralWithdrawCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.AaveCollateralWithdrawCondition.md#getsignatureofmethod) -- [hashValues](conditions.AaveCollateralWithdrawCondition.md#hashvalues) -- [hashValuesPlain](conditions.AaveCollateralWithdrawCondition.md#hashvaluesplain) -- [init](conditions.AaveCollateralWithdrawCondition.md#init) -- [instance](conditions.AaveCollateralWithdrawCondition.md#instance) -- [instanceFromDDO](conditions.AaveCollateralWithdrawCondition.md#instancefromddo) -- [params](conditions.AaveCollateralWithdrawCondition.md#params) -- [paramsFromDDO](conditions.AaveCollateralWithdrawCondition.md#paramsfromddo) -- [send](conditions.AaveCollateralWithdrawCondition.md#send) -- [sendFrom](conditions.AaveCollateralWithdrawCondition.md#sendfrom) -- [setInstanceConfig](conditions.AaveCollateralWithdrawCondition.md#setinstanceconfig) -- [addressesStatic](conditions.AaveCollateralWithdrawCondition.md#addressesstatic) -- [findSignerStatic](conditions.AaveCollateralWithdrawCondition.md#findsignerstatic) -- [getInstance](conditions.AaveCollateralWithdrawCondition.md#getinstance) -- [setInstanceConfig](conditions.AaveCollateralWithdrawCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new AaveCollateralWithdrawCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `collateralAsset`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :---------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `vaultAddress` | `string` | -| `collateralAsset` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:40](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L40) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `AaveCollateralWithdrawConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `vaultAddress`, `collateralAsset`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `did` | `string` | -| `vaultAddress` | `string` | -| `collateralAsset` | `string` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L28) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :--------------------------------------- | -| `__namedParameters` | `AaveCollateralWithdrawConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L32) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`AaveCollateralWithdrawCondition`](conditions.AaveCollateralWithdrawCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`AaveCollateralWithdrawCondition`](conditions.AaveCollateralWithdrawCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCollateralWithdrawCondition.ts#L17) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.AaveRepayCondition.md b/docs/api-reference/classes/conditions.AaveRepayCondition.md deleted file mode 100644 index 2ca3e379e..000000000 --- a/docs/api-reference/classes/conditions.AaveRepayCondition.md +++ /dev/null @@ -1,1119 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / AaveRepayCondition - -# Class: AaveRepayCondition - -[conditions](../modules/conditions.md).AaveRepayCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`AaveRepayConditionContext`\> - - ↳ **`AaveRepayCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.AaveRepayCondition.md#constructor) - -### Properties - -- [contract](conditions.AaveRepayCondition.md#contract) -- [contractName](conditions.AaveRepayCondition.md#contractname) -- [events](conditions.AaveRepayCondition.md#events) -- [version](conditions.AaveRepayCondition.md#version) - -### Accessors - -- [address](conditions.AaveRepayCondition.md#address) -- [artifactsFolder](conditions.AaveRepayCondition.md#artifactsfolder) -- [config](conditions.AaveRepayCondition.md#config) -- [instanceConfig](conditions.AaveRepayCondition.md#instanceconfig) -- [instantiableConfig](conditions.AaveRepayCondition.md#instantiableconfig) -- [logger](conditions.AaveRepayCondition.md#logger) -- [nevermined](conditions.AaveRepayCondition.md#nevermined) -- [web3](conditions.AaveRepayCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.AaveRepayCondition.md#abortbytimeout) -- [addresses](conditions.AaveRepayCondition.md#addresses) -- [call](conditions.AaveRepayCondition.md#call) -- [checkExists](conditions.AaveRepayCondition.md#checkexists) -- [findSigner](conditions.AaveRepayCondition.md#findsigner) -- [fulfill](conditions.AaveRepayCondition.md#fulfill) -- [fulfillGateway](conditions.AaveRepayCondition.md#fulfillgateway) -- [fulfillInstance](conditions.AaveRepayCondition.md#fulfillinstance) -- [fulfillPlain](conditions.AaveRepayCondition.md#fulfillplain) -- [gatewayMethod](conditions.AaveRepayCondition.md#gatewaymethod) -- [generateId](conditions.AaveRepayCondition.md#generateid) -- [generateIdHash](conditions.AaveRepayCondition.md#generateidhash) -- [generateIdWithSeed](conditions.AaveRepayCondition.md#generateidwithseed) -- [getAddress](conditions.AaveRepayCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.AaveRepayCondition.md#getconditionfulfilledevent) -- [getContract](conditions.AaveRepayCondition.md#getcontract) -- [getFromAddress](conditions.AaveRepayCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.AaveRepayCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.AaveRepayCondition.md#getsignatureofmethod) -- [hashValues](conditions.AaveRepayCondition.md#hashvalues) -- [hashValuesPlain](conditions.AaveRepayCondition.md#hashvaluesplain) -- [init](conditions.AaveRepayCondition.md#init) -- [instance](conditions.AaveRepayCondition.md#instance) -- [instanceFromDDO](conditions.AaveRepayCondition.md#instancefromddo) -- [params](conditions.AaveRepayCondition.md#params) -- [paramsFromDDO](conditions.AaveRepayCondition.md#paramsfromddo) -- [send](conditions.AaveRepayCondition.md#send) -- [sendFrom](conditions.AaveRepayCondition.md#sendfrom) -- [setInstanceConfig](conditions.AaveRepayCondition.md#setinstanceconfig) -- [addressesStatic](conditions.AaveRepayCondition.md#addressesstatic) -- [findSignerStatic](conditions.AaveRepayCondition.md#findsignerstatic) -- [getInstance](conditions.AaveRepayCondition.md#getinstance) -- [setInstanceConfig](conditions.AaveRepayCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new AaveRepayCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `assetToRepay`, `amountToRepay`, `interestRateMode`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `vaultAddress` | `string` | -| `assetToRepay` | `string` | -| `amountToRepay` | `string` | -| `interestRateMode` | `number` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/defi/AaveRepayCondition.ts:61](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveRepayCondition.ts#L61) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `AaveRepayConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `vaultAddress`, `assetToRepay`, `amountToRepay`, `interestRateMode`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :----------------- | :------- | -| `did` | `string` | -| `vaultAddress` | `string` | -| `assetToRepay` | `string` | -| `amountToRepay` | `string` | -| `interestRateMode` | `number` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/defi/AaveRepayCondition.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveRepayCondition.ts#L30) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :-------------------------- | -| `__namedParameters` | `AaveRepayConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/defi/AaveRepayCondition.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveRepayCondition.ts#L45) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`AaveRepayCondition`](conditions.AaveRepayCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`AaveRepayCondition`](conditions.AaveRepayCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/defi/AaveRepayCondition.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveRepayCondition.ts#L19) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.AccessCondition.md b/docs/api-reference/classes/conditions.AccessCondition.md deleted file mode 100644 index 197ce8709..000000000 --- a/docs/api-reference/classes/conditions.AccessCondition.md +++ /dev/null @@ -1,1157 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / AccessCondition - -# Class: AccessCondition - -[conditions](../modules/conditions.md).AccessCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`AccessConditionContext`\> - - ↳ **`AccessCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.AccessCondition.md#constructor) - -### Properties - -- [contract](conditions.AccessCondition.md#contract) -- [contractName](conditions.AccessCondition.md#contractname) -- [events](conditions.AccessCondition.md#events) -- [version](conditions.AccessCondition.md#version) - -### Accessors - -- [address](conditions.AccessCondition.md#address) -- [artifactsFolder](conditions.AccessCondition.md#artifactsfolder) -- [config](conditions.AccessCondition.md#config) -- [instanceConfig](conditions.AccessCondition.md#instanceconfig) -- [instantiableConfig](conditions.AccessCondition.md#instantiableconfig) -- [logger](conditions.AccessCondition.md#logger) -- [nevermined](conditions.AccessCondition.md#nevermined) -- [web3](conditions.AccessCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.AccessCondition.md#abortbytimeout) -- [addresses](conditions.AccessCondition.md#addresses) -- [call](conditions.AccessCondition.md#call) -- [checkExists](conditions.AccessCondition.md#checkexists) -- [checkPermissions](conditions.AccessCondition.md#checkpermissions) -- [findSigner](conditions.AccessCondition.md#findsigner) -- [fulfill](conditions.AccessCondition.md#fulfill) -- [fulfillGateway](conditions.AccessCondition.md#fulfillgateway) -- [fulfillInstance](conditions.AccessCondition.md#fulfillinstance) -- [fulfillPlain](conditions.AccessCondition.md#fulfillplain) -- [gatewayMethod](conditions.AccessCondition.md#gatewaymethod) -- [generateId](conditions.AccessCondition.md#generateid) -- [generateIdHash](conditions.AccessCondition.md#generateidhash) -- [generateIdWithSeed](conditions.AccessCondition.md#generateidwithseed) -- [getAddress](conditions.AccessCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.AccessCondition.md#getconditionfulfilledevent) -- [getContract](conditions.AccessCondition.md#getcontract) -- [getFromAddress](conditions.AccessCondition.md#getfromaddress) -- [getGrantedDidByConsumer](conditions.AccessCondition.md#getgranteddidbyconsumer) -- [getInputsOfMethod](conditions.AccessCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.AccessCondition.md#getsignatureofmethod) -- [hashValues](conditions.AccessCondition.md#hashvalues) -- [hashValuesPlain](conditions.AccessCondition.md#hashvaluesplain) -- [init](conditions.AccessCondition.md#init) -- [instance](conditions.AccessCondition.md#instance) -- [instanceFromDDO](conditions.AccessCondition.md#instancefromddo) -- [params](conditions.AccessCondition.md#params) -- [paramsFromDDO](conditions.AccessCondition.md#paramsfromddo) -- [send](conditions.AccessCondition.md#send) -- [sendFrom](conditions.AccessCondition.md#sendfrom) -- [setInstanceConfig](conditions.AccessCondition.md#setinstanceconfig) -- [addressesStatic](conditions.AccessCondition.md#addressesstatic) -- [findSignerStatic](conditions.AccessCondition.md#findsignerstatic) -- [getInstance](conditions.AccessCondition.md#getinstance) -- [setInstanceConfig](conditions.AccessCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new AccessCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### checkPermissions - -▸ **checkPermissions**(`grantee`, `did`, `from?`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :---------------------- | -| `grantee` | `string` | -| `did` | `string` | -| `from?` | [`Account`](Account.md) | - -#### Returns - -`Promise`<`boolean`\> - -#### Defined in - -[src/keeper/contracts/conditions/AccessCondition.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/AccessCondition.ts#L42) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `grantee`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `grantee` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/AccessCondition.ts:27](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/AccessCondition.ts#L27) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getGrantedDidByConsumer - -▸ **getGrantedDidByConsumer**(`consumer`): `Promise`<{ `agreementId`: `string` ; `did`: `string` }[]\> - -#### Parameters - -| Name | Type | -| :--------- | :------- | -| `consumer` | `string` | - -#### Returns - -`Promise`<{ `agreementId`: `string` ; `did`: `string` }[]\> - -#### Defined in - -[src/keeper/contracts/conditions/AccessCondition.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/AccessCondition.ts#L50) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `AccessConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `grantee`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `did` | `string` | -| `grantee` | `string` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/AccessCondition.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/AccessCondition.ts#L19) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :----------------------- | -| `__namedParameters` | `AccessConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/AccessCondition.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/AccessCondition.ts#L23) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`AccessCondition`](conditions.AccessCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`AccessCondition`](conditions.AccessCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/AccessCondition.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/AccessCondition.ts#L13) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.ComputeExecutionCondition.md b/docs/api-reference/classes/conditions.ComputeExecutionCondition.md deleted file mode 100644 index 21438cefa..000000000 --- a/docs/api-reference/classes/conditions.ComputeExecutionCondition.md +++ /dev/null @@ -1,1136 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ComputeExecutionCondition - -# Class: ComputeExecutionCondition - -[conditions](../modules/conditions.md).ComputeExecutionCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`ComputeExecutionConditionContext`\> - - ↳ **`ComputeExecutionCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.ComputeExecutionCondition.md#constructor) - -### Properties - -- [contract](conditions.ComputeExecutionCondition.md#contract) -- [contractName](conditions.ComputeExecutionCondition.md#contractname) -- [events](conditions.ComputeExecutionCondition.md#events) -- [version](conditions.ComputeExecutionCondition.md#version) - -### Accessors - -- [address](conditions.ComputeExecutionCondition.md#address) -- [artifactsFolder](conditions.ComputeExecutionCondition.md#artifactsfolder) -- [config](conditions.ComputeExecutionCondition.md#config) -- [instanceConfig](conditions.ComputeExecutionCondition.md#instanceconfig) -- [instantiableConfig](conditions.ComputeExecutionCondition.md#instantiableconfig) -- [logger](conditions.ComputeExecutionCondition.md#logger) -- [nevermined](conditions.ComputeExecutionCondition.md#nevermined) -- [web3](conditions.ComputeExecutionCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.ComputeExecutionCondition.md#abortbytimeout) -- [addresses](conditions.ComputeExecutionCondition.md#addresses) -- [call](conditions.ComputeExecutionCondition.md#call) -- [checkExists](conditions.ComputeExecutionCondition.md#checkexists) -- [findSigner](conditions.ComputeExecutionCondition.md#findsigner) -- [fulfill](conditions.ComputeExecutionCondition.md#fulfill) -- [fulfillGateway](conditions.ComputeExecutionCondition.md#fulfillgateway) -- [fulfillInstance](conditions.ComputeExecutionCondition.md#fulfillinstance) -- [fulfillPlain](conditions.ComputeExecutionCondition.md#fulfillplain) -- [gatewayMethod](conditions.ComputeExecutionCondition.md#gatewaymethod) -- [generateId](conditions.ComputeExecutionCondition.md#generateid) -- [generateIdHash](conditions.ComputeExecutionCondition.md#generateidhash) -- [generateIdWithSeed](conditions.ComputeExecutionCondition.md#generateidwithseed) -- [getAddress](conditions.ComputeExecutionCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.ComputeExecutionCondition.md#getconditionfulfilledevent) -- [getContract](conditions.ComputeExecutionCondition.md#getcontract) -- [getFromAddress](conditions.ComputeExecutionCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.ComputeExecutionCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.ComputeExecutionCondition.md#getsignatureofmethod) -- [hashValues](conditions.ComputeExecutionCondition.md#hashvalues) -- [hashValuesPlain](conditions.ComputeExecutionCondition.md#hashvaluesplain) -- [init](conditions.ComputeExecutionCondition.md#init) -- [instance](conditions.ComputeExecutionCondition.md#instance) -- [instanceFromDDO](conditions.ComputeExecutionCondition.md#instancefromddo) -- [params](conditions.ComputeExecutionCondition.md#params) -- [paramsFromDDO](conditions.ComputeExecutionCondition.md#paramsfromddo) -- [send](conditions.ComputeExecutionCondition.md#send) -- [sendFrom](conditions.ComputeExecutionCondition.md#sendfrom) -- [setInstanceConfig](conditions.ComputeExecutionCondition.md#setinstanceconfig) -- [wasComputeTriggered](conditions.ComputeExecutionCondition.md#wascomputetriggered) -- [addressesStatic](conditions.ComputeExecutionCondition.md#addressesstatic) -- [findSignerStatic](conditions.ComputeExecutionCondition.md#findsignerstatic) -- [getInstance](conditions.ComputeExecutionCondition.md#getinstance) -- [setInstanceConfig](conditions.ComputeExecutionCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new ComputeExecutionCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `computeConsumer`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :---------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `computeConsumer` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L30) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `ComputeExecutionConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `computeConsumer`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `did` | `string` | -| `computeConsumer` | `string` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L26) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :--------------------------------- | -| `__namedParameters` | `ComputeExecutionConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L12) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### wasComputeTriggered - -▸ **wasComputeTriggered**(`did`, `computeConsumer`, `from?`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :---------------- | :---------------------- | -| `did` | `string` | -| `computeConsumer` | `string` | -| `from?` | [`Account`](Account.md) | - -#### Returns - -`Promise`<`boolean`\> - -#### Defined in - -[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L45) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`ComputeExecutionCondition`](conditions.ComputeExecutionCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`ComputeExecutionCondition`](conditions.ComputeExecutionCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/ComputeExecutionCondition.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/ComputeExecutionCondition.ts#L16) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.ConditionSmall.md b/docs/api-reference/classes/conditions.ConditionSmall.md deleted file mode 100644 index 4e25c476f..000000000 --- a/docs/api-reference/classes/conditions.ConditionSmall.md +++ /dev/null @@ -1,885 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ConditionSmall - -# Class: ConditionSmall - -[conditions](../modules/conditions.md).ConditionSmall - -## Hierarchy - -- `ContractBase` - - ↳ **`ConditionSmall`** - - ↳↳ [`Condition`](Condition.md) - -## Table of contents - -### Constructors - -- [constructor](conditions.ConditionSmall.md#constructor) - -### Properties - -- [contract](conditions.ConditionSmall.md#contract) -- [contractName](conditions.ConditionSmall.md#contractname) -- [events](conditions.ConditionSmall.md#events) -- [version](conditions.ConditionSmall.md#version) - -### Accessors - -- [address](conditions.ConditionSmall.md#address) -- [artifactsFolder](conditions.ConditionSmall.md#artifactsfolder) -- [config](conditions.ConditionSmall.md#config) -- [instanceConfig](conditions.ConditionSmall.md#instanceconfig) -- [instantiableConfig](conditions.ConditionSmall.md#instantiableconfig) -- [logger](conditions.ConditionSmall.md#logger) -- [nevermined](conditions.ConditionSmall.md#nevermined) -- [web3](conditions.ConditionSmall.md#web3) - -### Methods - -- [abortByTimeOut](conditions.ConditionSmall.md#abortbytimeout) -- [addresses](conditions.ConditionSmall.md#addresses) -- [call](conditions.ConditionSmall.md#call) -- [checkExists](conditions.ConditionSmall.md#checkexists) -- [findSigner](conditions.ConditionSmall.md#findsigner) -- [fulfill](conditions.ConditionSmall.md#fulfill) -- [fulfillPlain](conditions.ConditionSmall.md#fulfillplain) -- [generateId](conditions.ConditionSmall.md#generateid) -- [generateIdHash](conditions.ConditionSmall.md#generateidhash) -- [generateIdWithSeed](conditions.ConditionSmall.md#generateidwithseed) -- [getAddress](conditions.ConditionSmall.md#getaddress) -- [getConditionFulfilledEvent](conditions.ConditionSmall.md#getconditionfulfilledevent) -- [getContract](conditions.ConditionSmall.md#getcontract) -- [getFromAddress](conditions.ConditionSmall.md#getfromaddress) -- [getInputsOfMethod](conditions.ConditionSmall.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.ConditionSmall.md#getsignatureofmethod) -- [hashValues](conditions.ConditionSmall.md#hashvalues) -- [init](conditions.ConditionSmall.md#init) -- [send](conditions.ConditionSmall.md#send) -- [sendFrom](conditions.ConditionSmall.md#sendfrom) -- [setInstanceConfig](conditions.ConditionSmall.md#setinstanceconfig) -- [addressesStatic](conditions.ConditionSmall.md#addressesstatic) -- [findSignerStatic](conditions.ConditionSmall.md#findsignerstatic) -- [getInstance](conditions.ConditionSmall.md#getinstance) -- [setInstanceConfig](conditions.ConditionSmall.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new ConditionSmall**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -ContractBase.constructor - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -ContractBase.contract - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -ContractBase.contractName - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -ContractBase.events - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -ContractBase.version - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ContractBase.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ContractBase.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ContractBase.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ContractBase.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ContractBase.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ContractBase.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ContractBase.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ContractBase.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -ContractBase.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -ContractBase.call - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -ContractBase.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -ContractBase.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ `Abstract` **fulfill**(`agreementId`, ...`args`): `any` - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...args` | `any`[] | - -#### Returns - -`any` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:67](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L67) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ContractBase.getAddress - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -ContractBase.getContract - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -ContractBase.getFromAddress - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -ContractBase.getInputsOfMethod - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -ContractBase.getSignatureOfMethod - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L63) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -ContractBase.init - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -ContractBase.send - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -ContractBase.sendFrom - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -ContractBase.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -ContractBase.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -ContractBase.findSignerStatic - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**<`Ctx`, `Extra`\>(`config`, `conditionName`, `conditionsClass`, `optional?`): `Promise`<`any`\> - -#### Type parameters - -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Extra` | - -#### Parameters - -| Name | Type | Default value | -| :---------------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `conditionName` | `string` | `undefined` | -| `conditionsClass` | `any` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`any`\> - -#### Overrides - -ContractBase.getInstance - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L52) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -ContractBase.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.ConsumerCondition.md b/docs/api-reference/classes/conditions.ConsumerCondition.md deleted file mode 100644 index 9834c659c..000000000 --- a/docs/api-reference/classes/conditions.ConsumerCondition.md +++ /dev/null @@ -1,1123 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ConsumerCondition - -# Class: ConsumerCondition - -[conditions](../modules/conditions.md).ConsumerCondition - -## Type parameters - -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Record`<`string`, `unknown`\> | - -## Hierarchy - -- [`Condition`](Condition.md)<`Ctx`, `Extra`\> - - ↳ **`ConsumerCondition`** - - ↳↳ [`LockPaymentCondition`](conditions.LockPaymentCondition.md) - - ↳↳ [`NFTHolderCondition`](conditions.NFTHolderCondition.md) - - ↳↳ [`NFT721HolderCondition`](conditions.NFT721HolderCondition.md) - - ↳↳ [`NFTLockCondition`](conditions.NFTLockCondition.md) - -## Table of contents - -### Constructors - -- [constructor](conditions.ConsumerCondition.md#constructor) - -### Properties - -- [contract](conditions.ConsumerCondition.md#contract) -- [contractName](conditions.ConsumerCondition.md#contractname) -- [events](conditions.ConsumerCondition.md#events) -- [version](conditions.ConsumerCondition.md#version) - -### Accessors - -- [address](conditions.ConsumerCondition.md#address) -- [artifactsFolder](conditions.ConsumerCondition.md#artifactsfolder) -- [config](conditions.ConsumerCondition.md#config) -- [instanceConfig](conditions.ConsumerCondition.md#instanceconfig) -- [instantiableConfig](conditions.ConsumerCondition.md#instantiableconfig) -- [logger](conditions.ConsumerCondition.md#logger) -- [nevermined](conditions.ConsumerCondition.md#nevermined) -- [web3](conditions.ConsumerCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.ConsumerCondition.md#abortbytimeout) -- [addresses](conditions.ConsumerCondition.md#addresses) -- [call](conditions.ConsumerCondition.md#call) -- [checkExists](conditions.ConsumerCondition.md#checkexists) -- [findSigner](conditions.ConsumerCondition.md#findsigner) -- [fulfill](conditions.ConsumerCondition.md#fulfill) -- [fulfillGateway](conditions.ConsumerCondition.md#fulfillgateway) -- [fulfillInstance](conditions.ConsumerCondition.md#fulfillinstance) -- [fulfillPlain](conditions.ConsumerCondition.md#fulfillplain) -- [generateId](conditions.ConsumerCondition.md#generateid) -- [generateIdHash](conditions.ConsumerCondition.md#generateidhash) -- [generateIdWithSeed](conditions.ConsumerCondition.md#generateidwithseed) -- [getAddress](conditions.ConsumerCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.ConsumerCondition.md#getconditionfulfilledevent) -- [getContract](conditions.ConsumerCondition.md#getcontract) -- [getFromAddress](conditions.ConsumerCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.ConsumerCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.ConsumerCondition.md#getsignatureofmethod) -- [hashValues](conditions.ConsumerCondition.md#hashvalues) -- [hashValuesPlain](conditions.ConsumerCondition.md#hashvaluesplain) -- [init](conditions.ConsumerCondition.md#init) -- [instance](conditions.ConsumerCondition.md#instance) -- [instanceFromDDO](conditions.ConsumerCondition.md#instancefromddo) -- [params](conditions.ConsumerCondition.md#params) -- [paramsFromDDO](conditions.ConsumerCondition.md#paramsfromddo) -- [send](conditions.ConsumerCondition.md#send) -- [sendFrom](conditions.ConsumerCondition.md#sendfrom) -- [setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig) -- [addressesStatic](conditions.ConsumerCondition.md#addressesstatic) -- [findSignerStatic](conditions.ConsumerCondition.md#findsignerstatic) -- [getInstance](conditions.ConsumerCondition.md#getinstance) -- [setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new ConsumerCondition**<`Ctx`, `Extra`\>(`contractName`) - -#### Type parameters - -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Record`<`string`, `unknown`\> | - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[Condition](Condition.md).[constructor](Condition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[Condition](Condition.md).[contract](Condition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[Condition](Condition.md).[contractName](Condition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[Condition](Condition.md).[events](Condition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[Condition](Condition.md).[version](Condition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Condition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Condition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -Condition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Condition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Condition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -Condition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -Condition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -Condition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[abortByTimeOut](Condition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[Condition](Condition.md).[addresses](Condition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[Condition](Condition.md).[call](Condition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[Condition](Condition.md).[checkExists](Condition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[Condition](Condition.md).[findSigner](Condition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ `Abstract` **fulfill**(`agreementId`, ...`args`): `any` - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...args` | `any`[] | - -#### Returns - -`any` - -#### Inherited from - -[Condition](Condition.md).[fulfill](Condition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:67](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L67) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`_cond`, `_additionalParams`, `_from?`, `_params?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------------ | :----------------------------------------------------------------------------- | -| `_cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\> | -| `_additionalParams` | `Extra` | -| `_from?` | [`Account`](Account.md) | -| `_params?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Overrides - -[Condition](Condition.md).[fulfillGateway](Condition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:230](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L230) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :----------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\> | `undefined` | -| `additionalParams` | `Extra` | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[fulfillInstance](Condition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[fulfillPlain](Condition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[generateId](Condition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[generateIdHash](Condition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[Condition](Condition.md).[generateIdWithSeed](Condition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[Condition](Condition.md).[getAddress](Condition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[Condition](Condition.md).[getConditionFulfilledEvent](Condition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[Condition](Condition.md).[getContract](Condition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[getFromAddress](Condition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[Condition](Condition.md).[getInputsOfMethod](Condition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[Condition](Condition.md).[getSignatureOfMethod](Condition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[hashValues](Condition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[hashValuesPlain](Condition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[Condition](Condition.md).[init](Condition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Parameters - -| Name | Type | -| :------------ | :--------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Inherited from - -[Condition](Condition.md).[instance](Condition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `Ctx` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Inherited from - -[Condition](Condition.md).[instanceFromDDO](Condition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(...`args`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> - -#### Inherited from - -[Condition](Condition.md).[params](Condition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:134](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L134) - ---- - -### paramsFromDDO - -▸ `Abstract` **paramsFromDDO**(`ctx`, ...`args`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\>\> - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------- | -| `ctx` | `Ctx` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\>\> - -#### Inherited from - -[Condition](Condition.md).[paramsFromDDO](Condition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:149](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L149) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[send](Condition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[sendFrom](Condition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[Condition](Condition.md).[addressesStatic](Condition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[Condition](Condition.md).[findSignerStatic](Condition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**<`Ctx`, `Extra`\>(`config`, `conditionName`, `conditionsClass`, `optional?`): `Promise`<`any`\> - -#### Type parameters - -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Extra` | - -#### Parameters - -| Name | Type | Default value | -| :---------------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `conditionName` | `string` | `undefined` | -| `conditionsClass` | `any` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[Condition](Condition.md).[getInstance](Condition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:121](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L121) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.DistributeNFTCollateralCondition.md b/docs/api-reference/classes/conditions.DistributeNFTCollateralCondition.md deleted file mode 100644 index fe36d8300..000000000 --- a/docs/api-reference/classes/conditions.DistributeNFTCollateralCondition.md +++ /dev/null @@ -1,1127 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / DistributeNFTCollateralCondition - -# Class: DistributeNFTCollateralCondition - -[conditions](../modules/conditions.md).DistributeNFTCollateralCondition - -Condition allowing to transfer an NFT either to the original owner or a lender -depending on the loan status. - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`DistributeNFTCollateralConditionContext`\> - - ↳ **`DistributeNFTCollateralCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.DistributeNFTCollateralCondition.md#constructor) - -### Properties - -- [contract](conditions.DistributeNFTCollateralCondition.md#contract) -- [contractName](conditions.DistributeNFTCollateralCondition.md#contractname) -- [events](conditions.DistributeNFTCollateralCondition.md#events) -- [version](conditions.DistributeNFTCollateralCondition.md#version) - -### Accessors - -- [address](conditions.DistributeNFTCollateralCondition.md#address) -- [artifactsFolder](conditions.DistributeNFTCollateralCondition.md#artifactsfolder) -- [config](conditions.DistributeNFTCollateralCondition.md#config) -- [instanceConfig](conditions.DistributeNFTCollateralCondition.md#instanceconfig) -- [instantiableConfig](conditions.DistributeNFTCollateralCondition.md#instantiableconfig) -- [logger](conditions.DistributeNFTCollateralCondition.md#logger) -- [nevermined](conditions.DistributeNFTCollateralCondition.md#nevermined) -- [web3](conditions.DistributeNFTCollateralCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.DistributeNFTCollateralCondition.md#abortbytimeout) -- [addresses](conditions.DistributeNFTCollateralCondition.md#addresses) -- [call](conditions.DistributeNFTCollateralCondition.md#call) -- [checkExists](conditions.DistributeNFTCollateralCondition.md#checkexists) -- [findSigner](conditions.DistributeNFTCollateralCondition.md#findsigner) -- [fulfill](conditions.DistributeNFTCollateralCondition.md#fulfill) -- [fulfillGateway](conditions.DistributeNFTCollateralCondition.md#fulfillgateway) -- [fulfillInstance](conditions.DistributeNFTCollateralCondition.md#fulfillinstance) -- [fulfillPlain](conditions.DistributeNFTCollateralCondition.md#fulfillplain) -- [gatewayMethod](conditions.DistributeNFTCollateralCondition.md#gatewaymethod) -- [generateId](conditions.DistributeNFTCollateralCondition.md#generateid) -- [generateIdHash](conditions.DistributeNFTCollateralCondition.md#generateidhash) -- [generateIdWithSeed](conditions.DistributeNFTCollateralCondition.md#generateidwithseed) -- [getAddress](conditions.DistributeNFTCollateralCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.DistributeNFTCollateralCondition.md#getconditionfulfilledevent) -- [getContract](conditions.DistributeNFTCollateralCondition.md#getcontract) -- [getFromAddress](conditions.DistributeNFTCollateralCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.DistributeNFTCollateralCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.DistributeNFTCollateralCondition.md#getsignatureofmethod) -- [hashValues](conditions.DistributeNFTCollateralCondition.md#hashvalues) -- [hashValuesPlain](conditions.DistributeNFTCollateralCondition.md#hashvaluesplain) -- [init](conditions.DistributeNFTCollateralCondition.md#init) -- [instance](conditions.DistributeNFTCollateralCondition.md#instance) -- [instanceFromDDO](conditions.DistributeNFTCollateralCondition.md#instancefromddo) -- [params](conditions.DistributeNFTCollateralCondition.md#params) -- [paramsFromDDO](conditions.DistributeNFTCollateralCondition.md#paramsfromddo) -- [send](conditions.DistributeNFTCollateralCondition.md#send) -- [sendFrom](conditions.DistributeNFTCollateralCondition.md#sendfrom) -- [setInstanceConfig](conditions.DistributeNFTCollateralCondition.md#setinstanceconfig) -- [addressesStatic](conditions.DistributeNFTCollateralCondition.md#addressesstatic) -- [findSignerStatic](conditions.DistributeNFTCollateralCondition.md#findsignerstatic) -- [getInstance](conditions.DistributeNFTCollateralCondition.md#getinstance) -- [setInstanceConfig](conditions.DistributeNFTCollateralCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new DistributeNFTCollateralCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `vaultAddress`, `nftContractAddress`, `from?`, `txParams?`): `Promise`<`ContractReceipt`\> - -Fulfill the distribute NFT collateral condition. -Only the borrower or the lender can call this method. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :---------------------- | :--------------------------------------------------------- | -| `agreementId` | `string` | The agreement identifier. | -| `did` | `string` | The DID of the asset with NFTs. | -| `vaultAddress` | `string` | The address of the vault contract where the NFT is locked. | -| `nftContractAddress` | `string` | The address of the NFT721 contract | -| `from?` | [`Account`](Account.md) | | -| `txParams?` | `TxParameters` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -Condition state. - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:62](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L62) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `DistributeNFTCollateralConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `vaultAddress`, `nftContractAddress`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generates the ash of condition inputs. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :------- | :--------------------------------------------------------- | -| `did` | `string` | The DID of the asset with NFTs. | -| `vaultAddress` | `string` | The address of the vault contract where the NFT is locked. | -| `nftContractAddress` | `string` | The address of the NFT721 contract | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Hash of all the values - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:39](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L39) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :---------------------------------------- | -| `__namedParameters` | `DistributeNFTCollateralConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L43) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`DistributeNFTCollateralCondition`](conditions.DistributeNFTCollateralCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`DistributeNFTCollateralCondition`](conditions.DistributeNFTCollateralCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/DistributeNFT721CollateralCondition.ts#L21) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.EscrowPaymentCondition.md b/docs/api-reference/classes/conditions.EscrowPaymentCondition.md deleted file mode 100644 index 49d6763fc..000000000 --- a/docs/api-reference/classes/conditions.EscrowPaymentCondition.md +++ /dev/null @@ -1,1127 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / EscrowPaymentCondition - -# Class: EscrowPaymentCondition - -[conditions](../modules/conditions.md).EscrowPaymentCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`EscrowPaymentConditionContext`\> - - ↳ **`EscrowPaymentCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.EscrowPaymentCondition.md#constructor) - -### Properties - -- [contract](conditions.EscrowPaymentCondition.md#contract) -- [contractName](conditions.EscrowPaymentCondition.md#contractname) -- [events](conditions.EscrowPaymentCondition.md#events) -- [version](conditions.EscrowPaymentCondition.md#version) - -### Accessors - -- [address](conditions.EscrowPaymentCondition.md#address) -- [artifactsFolder](conditions.EscrowPaymentCondition.md#artifactsfolder) -- [config](conditions.EscrowPaymentCondition.md#config) -- [instanceConfig](conditions.EscrowPaymentCondition.md#instanceconfig) -- [instantiableConfig](conditions.EscrowPaymentCondition.md#instantiableconfig) -- [logger](conditions.EscrowPaymentCondition.md#logger) -- [nevermined](conditions.EscrowPaymentCondition.md#nevermined) -- [web3](conditions.EscrowPaymentCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.EscrowPaymentCondition.md#abortbytimeout) -- [addresses](conditions.EscrowPaymentCondition.md#addresses) -- [call](conditions.EscrowPaymentCondition.md#call) -- [checkExists](conditions.EscrowPaymentCondition.md#checkexists) -- [findSigner](conditions.EscrowPaymentCondition.md#findsigner) -- [fulfill](conditions.EscrowPaymentCondition.md#fulfill) -- [fulfillGateway](conditions.EscrowPaymentCondition.md#fulfillgateway) -- [fulfillInstance](conditions.EscrowPaymentCondition.md#fulfillinstance) -- [fulfillPlain](conditions.EscrowPaymentCondition.md#fulfillplain) -- [gatewayMethod](conditions.EscrowPaymentCondition.md#gatewaymethod) -- [generateId](conditions.EscrowPaymentCondition.md#generateid) -- [generateIdHash](conditions.EscrowPaymentCondition.md#generateidhash) -- [generateIdWithSeed](conditions.EscrowPaymentCondition.md#generateidwithseed) -- [getAddress](conditions.EscrowPaymentCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.EscrowPaymentCondition.md#getconditionfulfilledevent) -- [getContract](conditions.EscrowPaymentCondition.md#getcontract) -- [getFromAddress](conditions.EscrowPaymentCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.EscrowPaymentCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.EscrowPaymentCondition.md#getsignatureofmethod) -- [hashValues](conditions.EscrowPaymentCondition.md#hashvalues) -- [hashValuesPlain](conditions.EscrowPaymentCondition.md#hashvaluesplain) -- [init](conditions.EscrowPaymentCondition.md#init) -- [instance](conditions.EscrowPaymentCondition.md#instance) -- [instanceFromDDO](conditions.EscrowPaymentCondition.md#instancefromddo) -- [params](conditions.EscrowPaymentCondition.md#params) -- [paramsFromDDO](conditions.EscrowPaymentCondition.md#paramsfromddo) -- [send](conditions.EscrowPaymentCondition.md#send) -- [sendFrom](conditions.EscrowPaymentCondition.md#sendfrom) -- [setInstanceConfig](conditions.EscrowPaymentCondition.md#setinstanceconfig) -- [addressesStatic](conditions.EscrowPaymentCondition.md#addressesstatic) -- [findSignerStatic](conditions.EscrowPaymentCondition.md#findsignerstatic) -- [getInstance](conditions.EscrowPaymentCondition.md#getinstance) -- [setInstanceConfig](conditions.EscrowPaymentCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new EscrowPaymentCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `amounts`, `receivers`, `returnAddress`, `lockPaymentAddress`, `tokenAddress`, `lockCondition`, `releaseCondition`, `from?`, `txParams?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `returnAddress` | `string` | -| `lockPaymentAddress` | `string` | -| `tokenAddress` | `string` | -| `lockCondition` | `string` | -| `releaseCondition` | `string` | -| `from?` | [`Account`](Account.md) | -| `txParams?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:68](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L68) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `EscrowPaymentConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `amounts`, `receivers`, `returnAddress`, `sender`, `tokenAddress`, `lockCondition`, `releaseCondition`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------- | -| `did` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `returnAddress` | `string` | -| `sender` | `string` | -| `tokenAddress` | `string` | -| `lockCondition` | `string` | -| `releaseCondition` | `string` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L28) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`, `access`, `lock`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :----------------------------------------------------------------------------- | -| `__namedParameters` | `EscrowPaymentConditionContext` | -| `access` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md) | -| `lock` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md) | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:49](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L49) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/EscrowPaymentCondition.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/EscrowPaymentCondition.ts#L18) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.LockPaymentCondition.md b/docs/api-reference/classes/conditions.LockPaymentCondition.md deleted file mode 100644 index bbd870c5d..000000000 --- a/docs/api-reference/classes/conditions.LockPaymentCondition.md +++ /dev/null @@ -1,1100 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / LockPaymentCondition - -# Class: LockPaymentCondition - -[conditions](../modules/conditions.md).LockPaymentCondition - -## Hierarchy - -- [`ConsumerCondition`](conditions.ConsumerCondition.md)<[`ConditionContext`](../interfaces/conditions.ConditionContext.md)\> - - ↳ **`LockPaymentCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.LockPaymentCondition.md#constructor) - -### Properties - -- [contract](conditions.LockPaymentCondition.md#contract) -- [contractName](conditions.LockPaymentCondition.md#contractname) -- [events](conditions.LockPaymentCondition.md#events) -- [version](conditions.LockPaymentCondition.md#version) - -### Accessors - -- [address](conditions.LockPaymentCondition.md#address) -- [artifactsFolder](conditions.LockPaymentCondition.md#artifactsfolder) -- [config](conditions.LockPaymentCondition.md#config) -- [instanceConfig](conditions.LockPaymentCondition.md#instanceconfig) -- [instantiableConfig](conditions.LockPaymentCondition.md#instantiableconfig) -- [logger](conditions.LockPaymentCondition.md#logger) -- [nevermined](conditions.LockPaymentCondition.md#nevermined) -- [web3](conditions.LockPaymentCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.LockPaymentCondition.md#abortbytimeout) -- [addresses](conditions.LockPaymentCondition.md#addresses) -- [call](conditions.LockPaymentCondition.md#call) -- [checkExists](conditions.LockPaymentCondition.md#checkexists) -- [findSigner](conditions.LockPaymentCondition.md#findsigner) -- [fulfill](conditions.LockPaymentCondition.md#fulfill) -- [fulfillGateway](conditions.LockPaymentCondition.md#fulfillgateway) -- [fulfillInstance](conditions.LockPaymentCondition.md#fulfillinstance) -- [fulfillPlain](conditions.LockPaymentCondition.md#fulfillplain) -- [generateId](conditions.LockPaymentCondition.md#generateid) -- [generateIdHash](conditions.LockPaymentCondition.md#generateidhash) -- [generateIdWithSeed](conditions.LockPaymentCondition.md#generateidwithseed) -- [getAddress](conditions.LockPaymentCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.LockPaymentCondition.md#getconditionfulfilledevent) -- [getContract](conditions.LockPaymentCondition.md#getcontract) -- [getFromAddress](conditions.LockPaymentCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.LockPaymentCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.LockPaymentCondition.md#getsignatureofmethod) -- [hashValues](conditions.LockPaymentCondition.md#hashvalues) -- [hashValuesPlain](conditions.LockPaymentCondition.md#hashvaluesplain) -- [init](conditions.LockPaymentCondition.md#init) -- [instance](conditions.LockPaymentCondition.md#instance) -- [instanceFromDDO](conditions.LockPaymentCondition.md#instancefromddo) -- [params](conditions.LockPaymentCondition.md#params) -- [paramsFromDDO](conditions.LockPaymentCondition.md#paramsfromddo) -- [send](conditions.LockPaymentCondition.md#send) -- [sendFrom](conditions.LockPaymentCondition.md#sendfrom) -- [setInstanceConfig](conditions.LockPaymentCondition.md#setinstanceconfig) -- [addressesStatic](conditions.LockPaymentCondition.md#addressesstatic) -- [findSignerStatic](conditions.LockPaymentCondition.md#findsignerstatic) -- [getInstance](conditions.LockPaymentCondition.md#getinstance) -- [setInstanceConfig](conditions.LockPaymentCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new LockPaymentCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[constructor](conditions.ConsumerCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contract](conditions.ConsumerCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contractName](conditions.ConsumerCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[events](conditions.ConsumerCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[version](conditions.ConsumerCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ConsumerCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ConsumerCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ConsumerCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ConsumerCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[abortByTimeOut](conditions.ConsumerCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addresses](conditions.ConsumerCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[call](conditions.ConsumerCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[checkExists](conditions.ConsumerCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSigner](conditions.ConsumerCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :-------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfill](conditions.ConsumerCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/LockPaymentCondition.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/LockPaymentCondition.ts#L44) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`_cond`, `_additionalParams`, `_from?`, `_params?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------------ | :---------------------------------------------------------------------------------------------------- | -| `_cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `_additionalParams` | `Record`<`string`, `unknown`\> | -| `_from?` | [`Account`](Account.md) | -| `_params?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillGateway](conditions.ConsumerCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:230](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L230) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillInstance](conditions.ConsumerCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillPlain](conditions.ConsumerCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateId](conditions.ConsumerCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdHash](conditions.ConsumerCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdWithSeed](conditions.ConsumerCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getAddress](conditions.ConsumerCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getConditionFulfilledEvent](conditions.ConsumerCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getContract](conditions.ConsumerCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getFromAddress](conditions.ConsumerCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInputsOfMethod](conditions.ConsumerCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getSignatureOfMethod](conditions.ConsumerCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValues](conditions.ConsumerCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValuesPlain](conditions.ConsumerCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[init](conditions.ConsumerCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instance](conditions.ConsumerCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instanceFromDDO](conditions.ConsumerCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :-------------- | :---------- | -| `did` | `string` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[params](conditions.ConsumerCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/LockPaymentCondition.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/LockPaymentCondition.ts#L15) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :----------------------------------------------------------------- | -| `__namedParameters` | [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[paramsFromDDO](conditions.ConsumerCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/LockPaymentCondition.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/LockPaymentCondition.ts#L33) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[send](conditions.ConsumerCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[sendFrom](conditions.ConsumerCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addressesStatic](conditions.ConsumerCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSignerStatic](conditions.ConsumerCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`LockPaymentCondition`](conditions.LockPaymentCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`LockPaymentCondition`](conditions.LockPaymentCondition.md)\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInstance](conditions.ConsumerCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/LockPaymentCondition.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/LockPaymentCondition.ts#L9) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.NFT721HolderCondition.md b/docs/api-reference/classes/conditions.NFT721HolderCondition.md deleted file mode 100644 index e609a9ff2..000000000 --- a/docs/api-reference/classes/conditions.NFT721HolderCondition.md +++ /dev/null @@ -1,1127 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / NFT721HolderCondition - -# Class: NFT721HolderCondition - -[conditions](../modules/conditions.md).NFT721HolderCondition - -Allows to fulfill a condition to users holding some amount of NFTs for a specific DID. - -## Hierarchy - -- [`ConsumerCondition`](conditions.ConsumerCondition.md)<`NFT721HolderConditionContext`\> - - ↳ **`NFT721HolderCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.NFT721HolderCondition.md#constructor) - -### Properties - -- [contract](conditions.NFT721HolderCondition.md#contract) -- [contractName](conditions.NFT721HolderCondition.md#contractname) -- [events](conditions.NFT721HolderCondition.md#events) -- [version](conditions.NFT721HolderCondition.md#version) - -### Accessors - -- [address](conditions.NFT721HolderCondition.md#address) -- [artifactsFolder](conditions.NFT721HolderCondition.md#artifactsfolder) -- [config](conditions.NFT721HolderCondition.md#config) -- [instanceConfig](conditions.NFT721HolderCondition.md#instanceconfig) -- [instantiableConfig](conditions.NFT721HolderCondition.md#instantiableconfig) -- [logger](conditions.NFT721HolderCondition.md#logger) -- [nevermined](conditions.NFT721HolderCondition.md#nevermined) -- [web3](conditions.NFT721HolderCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.NFT721HolderCondition.md#abortbytimeout) -- [addresses](conditions.NFT721HolderCondition.md#addresses) -- [call](conditions.NFT721HolderCondition.md#call) -- [checkExists](conditions.NFT721HolderCondition.md#checkexists) -- [findSigner](conditions.NFT721HolderCondition.md#findsigner) -- [fulfill](conditions.NFT721HolderCondition.md#fulfill) -- [fulfillGateway](conditions.NFT721HolderCondition.md#fulfillgateway) -- [fulfillInstance](conditions.NFT721HolderCondition.md#fulfillinstance) -- [fulfillPlain](conditions.NFT721HolderCondition.md#fulfillplain) -- [generateId](conditions.NFT721HolderCondition.md#generateid) -- [generateIdHash](conditions.NFT721HolderCondition.md#generateidhash) -- [generateIdWithSeed](conditions.NFT721HolderCondition.md#generateidwithseed) -- [getAddress](conditions.NFT721HolderCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.NFT721HolderCondition.md#getconditionfulfilledevent) -- [getContract](conditions.NFT721HolderCondition.md#getcontract) -- [getFromAddress](conditions.NFT721HolderCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.NFT721HolderCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.NFT721HolderCondition.md#getsignatureofmethod) -- [hashValues](conditions.NFT721HolderCondition.md#hashvalues) -- [hashValuesPlain](conditions.NFT721HolderCondition.md#hashvaluesplain) -- [init](conditions.NFT721HolderCondition.md#init) -- [instance](conditions.NFT721HolderCondition.md#instance) -- [instanceFromDDO](conditions.NFT721HolderCondition.md#instancefromddo) -- [nftContractFromService](conditions.NFT721HolderCondition.md#nftcontractfromservice) -- [params](conditions.NFT721HolderCondition.md#params) -- [paramsFromDDO](conditions.NFT721HolderCondition.md#paramsfromddo) -- [send](conditions.NFT721HolderCondition.md#send) -- [sendFrom](conditions.NFT721HolderCondition.md#sendfrom) -- [setInstanceConfig](conditions.NFT721HolderCondition.md#setinstanceconfig) -- [addressesStatic](conditions.NFT721HolderCondition.md#addressesstatic) -- [findSignerStatic](conditions.NFT721HolderCondition.md#findsignerstatic) -- [getInstance](conditions.NFT721HolderCondition.md#getinstance) -- [setInstanceConfig](conditions.NFT721HolderCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new NFT721HolderCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[constructor](conditions.ConsumerCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contract](conditions.ConsumerCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contractName](conditions.ConsumerCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[events](conditions.ConsumerCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[version](conditions.ConsumerCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ConsumerCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ConsumerCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ConsumerCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ConsumerCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[abortByTimeOut](conditions.ConsumerCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addresses](conditions.ConsumerCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[call](conditions.ConsumerCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[checkExists](conditions.ConsumerCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSigner](conditions.ConsumerCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `holderAddress`, `nftTokenAddress`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -Fulfill requires a validation that holder as enough NFTs for a specific DID. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------- | :----------------------------------------------- | -| `agreementId` | `string` | SEA agreement identifier. | -| `did` | `string` | The Decentralized Identifier of the asset. | -| `holderAddress` | `string` | The contract address where the reward is locked. | -| `nftTokenAddress` | `string` | The contract address of the nft to use. | -| `from?` | [`Account`](Account.md) | | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -condition state - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfill](conditions.ConsumerCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:71](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L71) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`_cond`, `_additionalParams`, `_from?`, `_params?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------------ | :---------------------------------------------------------------------------------------------------- | -| `_cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `_additionalParams` | `Record`<`string`, `unknown`\> | -| `_from?` | [`Account`](Account.md) | -| `_params?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillGateway](conditions.ConsumerCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:230](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L230) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillInstance](conditions.ConsumerCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillPlain](conditions.ConsumerCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateId](conditions.ConsumerCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdHash](conditions.ConsumerCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdWithSeed](conditions.ConsumerCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getAddress](conditions.ConsumerCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getConditionFulfilledEvent](conditions.ConsumerCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getContract](conditions.ConsumerCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getFromAddress](conditions.ConsumerCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInputsOfMethod](conditions.ConsumerCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getSignatureOfMethod](conditions.ConsumerCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValues](conditions.ConsumerCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValuesPlain](conditions.ConsumerCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[init](conditions.ConsumerCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instance](conditions.ConsumerCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `NFT721HolderConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instanceFromDDO](conditions.ConsumerCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### nftContractFromService - -▸ **nftContractFromService**(`service`): `string` - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -`string` - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L44) - ---- - -### params - -▸ **params**(`did`, `holderAddress`, `nftTokenAddress`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generate the hash of condition inputs with the following parameters. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :------- | :----------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the asset. | -| `holderAddress` | `string` | The address of the NFT holder . | -| `nftTokenAddress` | `string` | The address of the nft 721 token to use | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -hash of all the values - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[params](conditions.ConsumerCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L35) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :----------------------------- | -| `__namedParameters` | `NFT721HolderConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[paramsFromDDO](conditions.ConsumerCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L50) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[send](conditions.ConsumerCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[sendFrom](conditions.ConsumerCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addressesStatic](conditions.ConsumerCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSignerStatic](conditions.ConsumerCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721HolderCondition`](conditions.NFT721HolderCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFT721HolderCondition`](conditions.NFT721HolderCondition.md)\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInstance](conditions.ConsumerCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFT721HolderCondition.ts#L16) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.NFT721LockCondition.md b/docs/api-reference/classes/conditions.NFT721LockCondition.md deleted file mode 100644 index 26d989813..000000000 --- a/docs/api-reference/classes/conditions.NFT721LockCondition.md +++ /dev/null @@ -1,1126 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / NFT721LockCondition - -# Class: NFT721LockCondition - -[conditions](../modules/conditions.md).NFT721LockCondition - -Implementation of the NFT Lock Condition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`NFT721LockConditionContext`\> - - ↳ **`NFT721LockCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.NFT721LockCondition.md#constructor) - -### Properties - -- [contract](conditions.NFT721LockCondition.md#contract) -- [contractName](conditions.NFT721LockCondition.md#contractname) -- [events](conditions.NFT721LockCondition.md#events) -- [version](conditions.NFT721LockCondition.md#version) - -### Accessors - -- [address](conditions.NFT721LockCondition.md#address) -- [artifactsFolder](conditions.NFT721LockCondition.md#artifactsfolder) -- [config](conditions.NFT721LockCondition.md#config) -- [instanceConfig](conditions.NFT721LockCondition.md#instanceconfig) -- [instantiableConfig](conditions.NFT721LockCondition.md#instantiableconfig) -- [logger](conditions.NFT721LockCondition.md#logger) -- [nevermined](conditions.NFT721LockCondition.md#nevermined) -- [web3](conditions.NFT721LockCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.NFT721LockCondition.md#abortbytimeout) -- [addresses](conditions.NFT721LockCondition.md#addresses) -- [call](conditions.NFT721LockCondition.md#call) -- [checkExists](conditions.NFT721LockCondition.md#checkexists) -- [findSigner](conditions.NFT721LockCondition.md#findsigner) -- [fulfill](conditions.NFT721LockCondition.md#fulfill) -- [fulfillGateway](conditions.NFT721LockCondition.md#fulfillgateway) -- [fulfillInstance](conditions.NFT721LockCondition.md#fulfillinstance) -- [fulfillPlain](conditions.NFT721LockCondition.md#fulfillplain) -- [gatewayMethod](conditions.NFT721LockCondition.md#gatewaymethod) -- [generateId](conditions.NFT721LockCondition.md#generateid) -- [generateIdHash](conditions.NFT721LockCondition.md#generateidhash) -- [generateIdWithSeed](conditions.NFT721LockCondition.md#generateidwithseed) -- [getAddress](conditions.NFT721LockCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.NFT721LockCondition.md#getconditionfulfilledevent) -- [getContract](conditions.NFT721LockCondition.md#getcontract) -- [getFromAddress](conditions.NFT721LockCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.NFT721LockCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.NFT721LockCondition.md#getsignatureofmethod) -- [hashValues](conditions.NFT721LockCondition.md#hashvalues) -- [hashValuesPlain](conditions.NFT721LockCondition.md#hashvaluesplain) -- [init](conditions.NFT721LockCondition.md#init) -- [instance](conditions.NFT721LockCondition.md#instance) -- [instanceFromDDO](conditions.NFT721LockCondition.md#instancefromddo) -- [params](conditions.NFT721LockCondition.md#params) -- [paramsFromDDO](conditions.NFT721LockCondition.md#paramsfromddo) -- [send](conditions.NFT721LockCondition.md#send) -- [sendFrom](conditions.NFT721LockCondition.md#sendfrom) -- [setInstanceConfig](conditions.NFT721LockCondition.md#setinstanceconfig) -- [addressesStatic](conditions.NFT721LockCondition.md#addressesstatic) -- [findSignerStatic](conditions.NFT721LockCondition.md#findsignerstatic) -- [getInstance](conditions.NFT721LockCondition.md#getinstance) -- [setInstanceConfig](conditions.NFT721LockCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new NFT721LockCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `lockAddress`, `amount`, `nftContractAddress`, `from?`): `Promise`<`ContractReceipt`\> - -Fulfill requires valid NFT transfer in order to lock the amount of DID NFTs based on SEA. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :---------------------- | :-------------------------------------------- | -| `agreementId` | `string` | SEA agreement identifier. | -| `did` | `string` | Asset Decentralized identifier. | -| `lockAddress` | `string` | The contract address where the NFT is locked. | -| `amount` | `number` | The amount of tokens to be locked. | -| `nftContractAddress` | `string` | The NFT721 contract address | -| `from?` | [`Account`](Account.md) | | - -#### Returns - -`Promise`<`ContractReceipt`\> - -Condition state. - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/defi/NFT721LockCondition.ts:72](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/NFT721LockCondition.ts#L72) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `NFT721LockConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `lockAddress`, `amount`, `nftContractAddress`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generates the hash of condition inputs. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :------- | :----------------------------------------------- | -| `did` | `string` | The DID of the asset with NFTs attached to lock. | -| `lockAddress` | `string` | the address to lock the NFT to (vault address) | -| `amount` | `number` | The amount of locked tokens. | -| `nftContractAddress` | `string` | The NFT721 contract address | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Hash of all the values. - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/defi/NFT721LockCondition.ts:39](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/NFT721LockCondition.ts#L39) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :--------------------------- | -| `__namedParameters` | `NFT721LockConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/defi/NFT721LockCondition.ts:53](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/NFT721LockCondition.ts#L53) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721LockCondition`](conditions.NFT721LockCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFT721LockCondition`](conditions.NFT721LockCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/defi/NFT721LockCondition.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/NFT721LockCondition.ts#L20) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.NFTAccessCondition.md b/docs/api-reference/classes/conditions.NFTAccessCondition.md deleted file mode 100644 index 40e477120..000000000 --- a/docs/api-reference/classes/conditions.NFTAccessCondition.md +++ /dev/null @@ -1,1136 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / NFTAccessCondition - -# Class: NFTAccessCondition - -[conditions](../modules/conditions.md).NFTAccessCondition - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`NFTAccessConditionContext`\> - - ↳ **`NFTAccessCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.NFTAccessCondition.md#constructor) - -### Properties - -- [contract](conditions.NFTAccessCondition.md#contract) -- [contractName](conditions.NFTAccessCondition.md#contractname) -- [events](conditions.NFTAccessCondition.md#events) -- [version](conditions.NFTAccessCondition.md#version) - -### Accessors - -- [address](conditions.NFTAccessCondition.md#address) -- [artifactsFolder](conditions.NFTAccessCondition.md#artifactsfolder) -- [config](conditions.NFTAccessCondition.md#config) -- [instanceConfig](conditions.NFTAccessCondition.md#instanceconfig) -- [instantiableConfig](conditions.NFTAccessCondition.md#instantiableconfig) -- [logger](conditions.NFTAccessCondition.md#logger) -- [nevermined](conditions.NFTAccessCondition.md#nevermined) -- [web3](conditions.NFTAccessCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.NFTAccessCondition.md#abortbytimeout) -- [addresses](conditions.NFTAccessCondition.md#addresses) -- [call](conditions.NFTAccessCondition.md#call) -- [checkExists](conditions.NFTAccessCondition.md#checkexists) -- [checkPermissions](conditions.NFTAccessCondition.md#checkpermissions) -- [findSigner](conditions.NFTAccessCondition.md#findsigner) -- [fulfill](conditions.NFTAccessCondition.md#fulfill) -- [fulfillGateway](conditions.NFTAccessCondition.md#fulfillgateway) -- [fulfillInstance](conditions.NFTAccessCondition.md#fulfillinstance) -- [fulfillPlain](conditions.NFTAccessCondition.md#fulfillplain) -- [gatewayMethod](conditions.NFTAccessCondition.md#gatewaymethod) -- [generateId](conditions.NFTAccessCondition.md#generateid) -- [generateIdHash](conditions.NFTAccessCondition.md#generateidhash) -- [generateIdWithSeed](conditions.NFTAccessCondition.md#generateidwithseed) -- [getAddress](conditions.NFTAccessCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.NFTAccessCondition.md#getconditionfulfilledevent) -- [getContract](conditions.NFTAccessCondition.md#getcontract) -- [getFromAddress](conditions.NFTAccessCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.NFTAccessCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.NFTAccessCondition.md#getsignatureofmethod) -- [hashValues](conditions.NFTAccessCondition.md#hashvalues) -- [hashValuesPlain](conditions.NFTAccessCondition.md#hashvaluesplain) -- [init](conditions.NFTAccessCondition.md#init) -- [instance](conditions.NFTAccessCondition.md#instance) -- [instanceFromDDO](conditions.NFTAccessCondition.md#instancefromddo) -- [params](conditions.NFTAccessCondition.md#params) -- [paramsFromDDO](conditions.NFTAccessCondition.md#paramsfromddo) -- [send](conditions.NFTAccessCondition.md#send) -- [sendFrom](conditions.NFTAccessCondition.md#sendfrom) -- [setInstanceConfig](conditions.NFTAccessCondition.md#setinstanceconfig) -- [addressesStatic](conditions.NFTAccessCondition.md#addressesstatic) -- [findSignerStatic](conditions.NFTAccessCondition.md#findsignerstatic) -- [getInstance](conditions.NFTAccessCondition.md#getinstance) -- [setInstanceConfig](conditions.NFTAccessCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new NFTAccessCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### checkPermissions - -▸ **checkPermissions**(`grantee`, `did`, `from?`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :---------------------- | -| `grantee` | `string` | -| `did` | `string` | -| `from?` | [`Account`](Account.md) | - -#### Returns - -`Promise`<`boolean`\> - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L41) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `grantee`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `grantee` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L26) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `NFTAccessConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `grantee`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `did` | `string` | -| `grantee` | `string` | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L18) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :-------------------------- | -| `__namedParameters` | `NFTAccessConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:22](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L22) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFTAccessCondition`](conditions.NFTAccessCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFTAccessCondition`](conditions.NFTAccessCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTAccessCondition.ts#L12) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.NFTHolderCondition.md b/docs/api-reference/classes/conditions.NFTHolderCondition.md deleted file mode 100644 index da6c85997..000000000 --- a/docs/api-reference/classes/conditions.NFTHolderCondition.md +++ /dev/null @@ -1,1127 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / NFTHolderCondition - -# Class: NFTHolderCondition - -[conditions](../modules/conditions.md).NFTHolderCondition - -Allows to fulfill a condition to users holding some amount of NFTs for a specific DID. - -## Hierarchy - -- [`ConsumerCondition`](conditions.ConsumerCondition.md)<`NFTHolderConditionContext`\> - - ↳ **`NFTHolderCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.NFTHolderCondition.md#constructor) - -### Properties - -- [contract](conditions.NFTHolderCondition.md#contract) -- [contractName](conditions.NFTHolderCondition.md#contractname) -- [events](conditions.NFTHolderCondition.md#events) -- [version](conditions.NFTHolderCondition.md#version) - -### Accessors - -- [address](conditions.NFTHolderCondition.md#address) -- [artifactsFolder](conditions.NFTHolderCondition.md#artifactsfolder) -- [config](conditions.NFTHolderCondition.md#config) -- [instanceConfig](conditions.NFTHolderCondition.md#instanceconfig) -- [instantiableConfig](conditions.NFTHolderCondition.md#instantiableconfig) -- [logger](conditions.NFTHolderCondition.md#logger) -- [nevermined](conditions.NFTHolderCondition.md#nevermined) -- [web3](conditions.NFTHolderCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.NFTHolderCondition.md#abortbytimeout) -- [addresses](conditions.NFTHolderCondition.md#addresses) -- [amountFromService](conditions.NFTHolderCondition.md#amountfromservice) -- [call](conditions.NFTHolderCondition.md#call) -- [checkExists](conditions.NFTHolderCondition.md#checkexists) -- [findSigner](conditions.NFTHolderCondition.md#findsigner) -- [fulfill](conditions.NFTHolderCondition.md#fulfill) -- [fulfillGateway](conditions.NFTHolderCondition.md#fulfillgateway) -- [fulfillInstance](conditions.NFTHolderCondition.md#fulfillinstance) -- [fulfillPlain](conditions.NFTHolderCondition.md#fulfillplain) -- [generateId](conditions.NFTHolderCondition.md#generateid) -- [generateIdHash](conditions.NFTHolderCondition.md#generateidhash) -- [generateIdWithSeed](conditions.NFTHolderCondition.md#generateidwithseed) -- [getAddress](conditions.NFTHolderCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.NFTHolderCondition.md#getconditionfulfilledevent) -- [getContract](conditions.NFTHolderCondition.md#getcontract) -- [getFromAddress](conditions.NFTHolderCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.NFTHolderCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.NFTHolderCondition.md#getsignatureofmethod) -- [hashValues](conditions.NFTHolderCondition.md#hashvalues) -- [hashValuesPlain](conditions.NFTHolderCondition.md#hashvaluesplain) -- [init](conditions.NFTHolderCondition.md#init) -- [instance](conditions.NFTHolderCondition.md#instance) -- [instanceFromDDO](conditions.NFTHolderCondition.md#instancefromddo) -- [params](conditions.NFTHolderCondition.md#params) -- [paramsFromDDO](conditions.NFTHolderCondition.md#paramsfromddo) -- [send](conditions.NFTHolderCondition.md#send) -- [sendFrom](conditions.NFTHolderCondition.md#sendfrom) -- [setInstanceConfig](conditions.NFTHolderCondition.md#setinstanceconfig) -- [addressesStatic](conditions.NFTHolderCondition.md#addressesstatic) -- [findSignerStatic](conditions.NFTHolderCondition.md#findsignerstatic) -- [getInstance](conditions.NFTHolderCondition.md#getinstance) -- [setInstanceConfig](conditions.NFTHolderCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new NFTHolderCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[constructor](conditions.ConsumerCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contract](conditions.ConsumerCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contractName](conditions.ConsumerCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[events](conditions.ConsumerCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[version](conditions.ConsumerCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ConsumerCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ConsumerCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ConsumerCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ConsumerCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[abortByTimeOut](conditions.ConsumerCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addresses](conditions.ConsumerCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### amountFromService - -▸ **amountFromService**(`service`): `default` - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -`default` - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L36) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[call](conditions.ConsumerCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[checkExists](conditions.ConsumerCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSigner](conditions.ConsumerCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `holderAddress`, `amount`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -Fulfill requires a validation that holder as enough NFTs for a specific DID. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :---------------------- | :----------------------------------------------- | -| `agreementId` | `string` | SEA agreement identifier. | -| `did` | `string` | The Decentralized Identifier of the asset. | -| `holderAddress` | `string` | The contract address where the reward is locked. | -| `amount` | `default` | The amount of NFT to be hold | -| `from?` | [`Account`](Account.md) | | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -condition state - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfill](conditions.ConsumerCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:62](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L62) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`_cond`, `_additionalParams`, `_from?`, `_params?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------------ | :---------------------------------------------------------------------------------------------------- | -| `_cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `_additionalParams` | `Record`<`string`, `unknown`\> | -| `_from?` | [`Account`](Account.md) | -| `_params?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillGateway](conditions.ConsumerCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:230](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L230) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillInstance](conditions.ConsumerCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillPlain](conditions.ConsumerCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateId](conditions.ConsumerCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdHash](conditions.ConsumerCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdWithSeed](conditions.ConsumerCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getAddress](conditions.ConsumerCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getConditionFulfilledEvent](conditions.ConsumerCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getContract](conditions.ConsumerCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getFromAddress](conditions.ConsumerCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInputsOfMethod](conditions.ConsumerCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getSignatureOfMethod](conditions.ConsumerCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValues](conditions.ConsumerCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValuesPlain](conditions.ConsumerCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[init](conditions.ConsumerCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instance](conditions.ConsumerCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `NFTHolderConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instanceFromDDO](conditions.ConsumerCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `holderAddress`, `amount?`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generate the hash of condition inputs with the following parameters. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :-------- | :---------------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the asset. | -| `holderAddress` | `string` | The address of the NFT holder . | -| `amount?` | `default` | The amount of NFTs that need to be hold by the holder | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -hash of all the values - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[params](conditions.ConsumerCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L32) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :-------------------------- | -| `__namedParameters` | `NFTHolderConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[paramsFromDDO](conditions.ConsumerCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L42) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[send](conditions.ConsumerCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[sendFrom](conditions.ConsumerCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addressesStatic](conditions.ConsumerCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSignerStatic](conditions.ConsumerCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFTHolderCondition`](conditions.NFTHolderCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFTHolderCondition`](conditions.NFTHolderCondition.md)\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInstance](conditions.ConsumerCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTHolderCondition.ts#L18) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.NFTLockCondition.md b/docs/api-reference/classes/conditions.NFTLockCondition.md deleted file mode 100644 index 9d02c1f6c..000000000 --- a/docs/api-reference/classes/conditions.NFTLockCondition.md +++ /dev/null @@ -1,1106 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / NFTLockCondition - -# Class: NFTLockCondition - -[conditions](../modules/conditions.md).NFTLockCondition - -Implementation of the NFT Lock Condition - -## Hierarchy - -- [`ConsumerCondition`](conditions.ConsumerCondition.md)<`NFTLockConditionContext`\> - - ↳ **`NFTLockCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.NFTLockCondition.md#constructor) - -### Properties - -- [contract](conditions.NFTLockCondition.md#contract) -- [contractName](conditions.NFTLockCondition.md#contractname) -- [events](conditions.NFTLockCondition.md#events) -- [version](conditions.NFTLockCondition.md#version) - -### Accessors - -- [address](conditions.NFTLockCondition.md#address) -- [artifactsFolder](conditions.NFTLockCondition.md#artifactsfolder) -- [config](conditions.NFTLockCondition.md#config) -- [instanceConfig](conditions.NFTLockCondition.md#instanceconfig) -- [instantiableConfig](conditions.NFTLockCondition.md#instantiableconfig) -- [logger](conditions.NFTLockCondition.md#logger) -- [nevermined](conditions.NFTLockCondition.md#nevermined) -- [web3](conditions.NFTLockCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.NFTLockCondition.md#abortbytimeout) -- [addresses](conditions.NFTLockCondition.md#addresses) -- [call](conditions.NFTLockCondition.md#call) -- [checkExists](conditions.NFTLockCondition.md#checkexists) -- [findSigner](conditions.NFTLockCondition.md#findsigner) -- [fulfill](conditions.NFTLockCondition.md#fulfill) -- [fulfillGateway](conditions.NFTLockCondition.md#fulfillgateway) -- [fulfillInstance](conditions.NFTLockCondition.md#fulfillinstance) -- [fulfillPlain](conditions.NFTLockCondition.md#fulfillplain) -- [generateId](conditions.NFTLockCondition.md#generateid) -- [generateIdHash](conditions.NFTLockCondition.md#generateidhash) -- [generateIdWithSeed](conditions.NFTLockCondition.md#generateidwithseed) -- [getAddress](conditions.NFTLockCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.NFTLockCondition.md#getconditionfulfilledevent) -- [getContract](conditions.NFTLockCondition.md#getcontract) -- [getFromAddress](conditions.NFTLockCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.NFTLockCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.NFTLockCondition.md#getsignatureofmethod) -- [hashValues](conditions.NFTLockCondition.md#hashvalues) -- [hashValuesPlain](conditions.NFTLockCondition.md#hashvaluesplain) -- [init](conditions.NFTLockCondition.md#init) -- [instance](conditions.NFTLockCondition.md#instance) -- [instanceFromDDO](conditions.NFTLockCondition.md#instancefromddo) -- [params](conditions.NFTLockCondition.md#params) -- [paramsFromDDO](conditions.NFTLockCondition.md#paramsfromddo) -- [send](conditions.NFTLockCondition.md#send) -- [sendFrom](conditions.NFTLockCondition.md#sendfrom) -- [setInstanceConfig](conditions.NFTLockCondition.md#setinstanceconfig) -- [addressesStatic](conditions.NFTLockCondition.md#addressesstatic) -- [findSignerStatic](conditions.NFTLockCondition.md#findsignerstatic) -- [getInstance](conditions.NFTLockCondition.md#getinstance) -- [setInstanceConfig](conditions.NFTLockCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new NFTLockCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[constructor](conditions.ConsumerCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contract](conditions.ConsumerCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[contractName](conditions.ConsumerCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[events](conditions.ConsumerCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[version](conditions.ConsumerCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ConsumerCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ConsumerCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ConsumerCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ConsumerCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ConsumerCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ConsumerCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[abortByTimeOut](conditions.ConsumerCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addresses](conditions.ConsumerCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[call](conditions.ConsumerCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[checkExists](conditions.ConsumerCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSigner](conditions.ConsumerCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `rewardAddress`, `amount`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -Fulfill requires valid NFT transfer in order to lock the amount of DID NFTs based on SEA. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :---------------------- | :----------------------------------------------- | -| `agreementId` | `string` | SEA agreement identifier. | -| `did` | `string` | Asset Decentralized identifier. | -| `rewardAddress` | `string` | The contract address where the reward is locked. | -| `amount` | `default` | The amount of tokens to be transferred. | -| `from?` | [`Account`](Account.md) | | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -Condition state. - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfill](conditions.ConsumerCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:47](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L47) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`_cond`, `_additionalParams`, `_from?`, `_params?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------------ | :---------------------------------------------------------------------------------------------------- | -| `_cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `_additionalParams` | `Record`<`string`, `unknown`\> | -| `_from?` | [`Account`](Account.md) | -| `_params?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillGateway](conditions.ConsumerCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:230](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L230) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillInstance](conditions.ConsumerCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[fulfillPlain](conditions.ConsumerCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateId](conditions.ConsumerCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdHash](conditions.ConsumerCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[generateIdWithSeed](conditions.ConsumerCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getAddress](conditions.ConsumerCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getConditionFulfilledEvent](conditions.ConsumerCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getContract](conditions.ConsumerCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getFromAddress](conditions.ConsumerCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInputsOfMethod](conditions.ConsumerCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[getSignatureOfMethod](conditions.ConsumerCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValues](conditions.ConsumerCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[hashValuesPlain](conditions.ConsumerCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[init](conditions.ConsumerCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instance](conditions.ConsumerCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `NFTLockConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[instanceFromDDO](conditions.ConsumerCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `rewardAddress`, `amount`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generates the hash of condition inputs. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :------- | :----------------------------------------------- | -| `did` | `string` | The DID of the asset with NFTs attached to lock. | -| `rewardAddress` | `string` | The final address to receive the NFTs. | -| `amount` | `number` | The amount of locked tokens. | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Hash of all the values. - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[params](conditions.ConsumerCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L30) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------------ | -| `__namedParameters` | `NFTLockConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[paramsFromDDO](conditions.ConsumerCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:34](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L34) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[send](conditions.ConsumerCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[sendFrom](conditions.ConsumerCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[addressesStatic](conditions.ConsumerCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[findSignerStatic](conditions.ConsumerCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFTLockCondition`](conditions.NFTLockCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFTLockCondition`](conditions.NFTLockCondition.md)\> - -#### Overrides - -[ConsumerCondition](conditions.ConsumerCondition.md).[getInstance](conditions.ConsumerCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/NFTLockCondition.ts#L17) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ConsumerCondition](conditions.ConsumerCondition.md).[setInstanceConfig](conditions.ConsumerCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.ProviderCondition.md b/docs/api-reference/classes/conditions.ProviderCondition.md deleted file mode 100644 index 693354a98..000000000 --- a/docs/api-reference/classes/conditions.ProviderCondition.md +++ /dev/null @@ -1,1156 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ProviderCondition - -# Class: ProviderCondition - -[conditions](../modules/conditions.md).ProviderCondition - -## Type parameters - -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Record`<`string`, `unknown`\> | - -## Hierarchy - -- [`Condition`](Condition.md)<`Ctx`, `Extra`\> - - ↳ **`ProviderCondition`** - - ↳↳ [`AccessCondition`](conditions.AccessCondition.md) - - ↳↳ [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md) - - ↳↳ [`ComputeExecutionCondition`](conditions.ComputeExecutionCondition.md) - - ↳↳ [`NFTAccessCondition`](conditions.NFTAccessCondition.md) - - ↳↳ [`TransferNFTCondition`](conditions.TransferNFTCondition.md) - - ↳↳ [`TransferNFT721Condition`](conditions.TransferNFT721Condition.md) - - ↳↳ [`TransferDIDOwnershipCondition`](conditions.TransferDIDOwnershipCondition.md) - - ↳↳ [`AaveBorrowCondition`](conditions.AaveBorrowCondition.md) - - ↳↳ [`AaveCollateralDepositCondition`](conditions.AaveCollateralDepositCondition.md) - - ↳↳ [`AaveCollateralWithdrawCondition`](conditions.AaveCollateralWithdrawCondition.md) - - ↳↳ [`AaveRepayCondition`](conditions.AaveRepayCondition.md) - - ↳↳ [`NFT721LockCondition`](conditions.NFT721LockCondition.md) - - ↳↳ [`DistributeNFTCollateralCondition`](conditions.DistributeNFTCollateralCondition.md) - -## Table of contents - -### Constructors - -- [constructor](conditions.ProviderCondition.md#constructor) - -### Properties - -- [contract](conditions.ProviderCondition.md#contract) -- [contractName](conditions.ProviderCondition.md#contractname) -- [events](conditions.ProviderCondition.md#events) -- [version](conditions.ProviderCondition.md#version) - -### Accessors - -- [address](conditions.ProviderCondition.md#address) -- [artifactsFolder](conditions.ProviderCondition.md#artifactsfolder) -- [config](conditions.ProviderCondition.md#config) -- [instanceConfig](conditions.ProviderCondition.md#instanceconfig) -- [instantiableConfig](conditions.ProviderCondition.md#instantiableconfig) -- [logger](conditions.ProviderCondition.md#logger) -- [nevermined](conditions.ProviderCondition.md#nevermined) -- [web3](conditions.ProviderCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) -- [addresses](conditions.ProviderCondition.md#addresses) -- [call](conditions.ProviderCondition.md#call) -- [checkExists](conditions.ProviderCondition.md#checkexists) -- [findSigner](conditions.ProviderCondition.md#findsigner) -- [fulfill](conditions.ProviderCondition.md#fulfill) -- [fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) -- [fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) -- [fulfillPlain](conditions.ProviderCondition.md#fulfillplain) -- [gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) -- [generateId](conditions.ProviderCondition.md#generateid) -- [generateIdHash](conditions.ProviderCondition.md#generateidhash) -- [generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) -- [getAddress](conditions.ProviderCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) -- [getContract](conditions.ProviderCondition.md#getcontract) -- [getFromAddress](conditions.ProviderCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) -- [hashValues](conditions.ProviderCondition.md#hashvalues) -- [hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) -- [init](conditions.ProviderCondition.md#init) -- [instance](conditions.ProviderCondition.md#instance) -- [instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) -- [params](conditions.ProviderCondition.md#params) -- [paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) -- [send](conditions.ProviderCondition.md#send) -- [sendFrom](conditions.ProviderCondition.md#sendfrom) -- [setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) -- [addressesStatic](conditions.ProviderCondition.md#addressesstatic) -- [findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) -- [getInstance](conditions.ProviderCondition.md#getinstance) -- [setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new ProviderCondition**<`Ctx`, `Extra`\>(`contractName`) - -#### Type parameters - -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Record`<`string`, `unknown`\> | - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[Condition](Condition.md).[constructor](Condition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[Condition](Condition.md).[contract](Condition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[Condition](Condition.md).[contractName](Condition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[Condition](Condition.md).[events](Condition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[Condition](Condition.md).[version](Condition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Condition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Condition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -Condition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Condition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Condition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -Condition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -Condition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -Condition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[abortByTimeOut](Condition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[Condition](Condition.md).[addresses](Condition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[Condition](Condition.md).[call](Condition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[Condition](Condition.md).[checkExists](Condition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[Condition](Condition.md).[findSigner](Condition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ `Abstract` **fulfill**(`agreementId`, ...`args`): `any` - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...args` | `any`[] | - -#### Returns - -`any` - -#### Inherited from - -[Condition](Condition.md).[fulfill](Condition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:67](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L67) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :----------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\> | -| `additionalParams` | `Extra` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Overrides - -[Condition](Condition.md).[fulfillGateway](Condition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :----------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\> | `undefined` | -| `additionalParams` | `Extra` | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[fulfillInstance](Condition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[fulfillPlain](Condition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[generateId](Condition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[generateIdHash](Condition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[Condition](Condition.md).[generateIdWithSeed](Condition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[Condition](Condition.md).[getAddress](Condition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[Condition](Condition.md).[getConditionFulfilledEvent](Condition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[Condition](Condition.md).[getContract](Condition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[getFromAddress](Condition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[Condition](Condition.md).[getInputsOfMethod](Condition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[Condition](Condition.md).[getSignatureOfMethod](Condition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[hashValues](Condition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[Condition](Condition.md).[hashValuesPlain](Condition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[Condition](Condition.md).[init](Condition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Parameters - -| Name | Type | -| :------------ | :--------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Inherited from - -[Condition](Condition.md).[instance](Condition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `Ctx` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Extra`\>\> - -#### Inherited from - -[Condition](Condition.md).[instanceFromDDO](Condition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(...`args`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\> - -#### Inherited from - -[Condition](Condition.md).[params](Condition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:134](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L134) - ---- - -### paramsFromDDO - -▸ `Abstract` **paramsFromDDO**(`ctx`, ...`args`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\>\> - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------- | -| `ctx` | `Ctx` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Extra`\>\> - -#### Inherited from - -[Condition](Condition.md).[paramsFromDDO](Condition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:149](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L149) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[send](Condition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[Condition](Condition.md).[sendFrom](Condition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[Condition](Condition.md).[addressesStatic](Condition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[Condition](Condition.md).[findSignerStatic](Condition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**<`Ctx`, `Extra`\>(`config`, `conditionName`, `conditionsClass`, `optional?`): `Promise`<`any`\> - -#### Type parameters - -| Name | Type | -| :------ | :------------------------------------------------------------------------- | -| `Ctx` | extends [`ConditionContext`](../interfaces/conditions.ConditionContext.md) | -| `Extra` | `Extra` | - -#### Parameters - -| Name | Type | Default value | -| :---------------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `conditionName` | `string` | `undefined` | -| `conditionsClass` | `any` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[Condition](Condition.md).[getInstance](Condition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:121](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L121) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[Condition](Condition.md).[setInstanceConfig](Condition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.TransferDIDOwnershipCondition.md b/docs/api-reference/classes/conditions.TransferDIDOwnershipCondition.md deleted file mode 100644 index d65572616..000000000 --- a/docs/api-reference/classes/conditions.TransferDIDOwnershipCondition.md +++ /dev/null @@ -1,1128 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / TransferDIDOwnershipCondition - -# Class: TransferDIDOwnershipCondition - -[conditions](../modules/conditions.md).TransferDIDOwnershipCondition - -Condition allowing to transfer the ownership between the original owner and a receiver. - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`AccessConditionContext`\> - - ↳ **`TransferDIDOwnershipCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.TransferDIDOwnershipCondition.md#constructor) - -### Properties - -- [contract](conditions.TransferDIDOwnershipCondition.md#contract) -- [contractName](conditions.TransferDIDOwnershipCondition.md#contractname) -- [events](conditions.TransferDIDOwnershipCondition.md#events) -- [version](conditions.TransferDIDOwnershipCondition.md#version) - -### Accessors - -- [address](conditions.TransferDIDOwnershipCondition.md#address) -- [artifactsFolder](conditions.TransferDIDOwnershipCondition.md#artifactsfolder) -- [config](conditions.TransferDIDOwnershipCondition.md#config) -- [instanceConfig](conditions.TransferDIDOwnershipCondition.md#instanceconfig) -- [instantiableConfig](conditions.TransferDIDOwnershipCondition.md#instantiableconfig) -- [logger](conditions.TransferDIDOwnershipCondition.md#logger) -- [nevermined](conditions.TransferDIDOwnershipCondition.md#nevermined) -- [web3](conditions.TransferDIDOwnershipCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.TransferDIDOwnershipCondition.md#abortbytimeout) -- [addresses](conditions.TransferDIDOwnershipCondition.md#addresses) -- [call](conditions.TransferDIDOwnershipCondition.md#call) -- [checkExists](conditions.TransferDIDOwnershipCondition.md#checkexists) -- [findSigner](conditions.TransferDIDOwnershipCondition.md#findsigner) -- [fulfill](conditions.TransferDIDOwnershipCondition.md#fulfill) -- [fulfillGateway](conditions.TransferDIDOwnershipCondition.md#fulfillgateway) -- [fulfillInstance](conditions.TransferDIDOwnershipCondition.md#fulfillinstance) -- [fulfillPlain](conditions.TransferDIDOwnershipCondition.md#fulfillplain) -- [gatewayMethod](conditions.TransferDIDOwnershipCondition.md#gatewaymethod) -- [generateId](conditions.TransferDIDOwnershipCondition.md#generateid) -- [generateIdHash](conditions.TransferDIDOwnershipCondition.md#generateidhash) -- [generateIdWithSeed](conditions.TransferDIDOwnershipCondition.md#generateidwithseed) -- [getAddress](conditions.TransferDIDOwnershipCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.TransferDIDOwnershipCondition.md#getconditionfulfilledevent) -- [getContract](conditions.TransferDIDOwnershipCondition.md#getcontract) -- [getFromAddress](conditions.TransferDIDOwnershipCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.TransferDIDOwnershipCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.TransferDIDOwnershipCondition.md#getsignatureofmethod) -- [hashValues](conditions.TransferDIDOwnershipCondition.md#hashvalues) -- [hashValuesPlain](conditions.TransferDIDOwnershipCondition.md#hashvaluesplain) -- [init](conditions.TransferDIDOwnershipCondition.md#init) -- [instance](conditions.TransferDIDOwnershipCondition.md#instance) -- [instanceFromDDO](conditions.TransferDIDOwnershipCondition.md#instancefromddo) -- [params](conditions.TransferDIDOwnershipCondition.md#params) -- [paramsFromDDO](conditions.TransferDIDOwnershipCondition.md#paramsfromddo) -- [send](conditions.TransferDIDOwnershipCondition.md#send) -- [sendFrom](conditions.TransferDIDOwnershipCondition.md#sendfrom) -- [setInstanceConfig](conditions.TransferDIDOwnershipCondition.md#setinstanceconfig) -- [addressesStatic](conditions.TransferDIDOwnershipCondition.md#addressesstatic) -- [findSignerStatic](conditions.TransferDIDOwnershipCondition.md#findsignerstatic) -- [getInstance](conditions.TransferDIDOwnershipCondition.md#getinstance) -- [setInstanceConfig](conditions.TransferDIDOwnershipCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new TransferDIDOwnershipCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `receiver`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -Fulfill the transfer DID ownership condition. - -**`Remarks`** - -Only DID owner or DID provider can call this method. -Fulfill method transfer full ownership permissions to the receiver address. - -#### Parameters - -| Name | Type | Description | -| :------------ | :---------------------- | :----------------------------------------- | -| `agreementId` | `string` | Agreement identifier. | -| `did` | `string` | The Decentralized Identifier of the asset. | -| `receiver` | `string` | The address of the granted user. | -| `from?` | [`Account`](Account.md) | | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -Condition state. - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L52) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:221](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L221) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `AccessConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `receiver`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generates the hash of the condition inputs. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :----------------------------------------------- | -| `did` | `string` | The Decentralized Identifier of the asset. | -| `receiver` | `string` | Address of the granted user or the DID provider. | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Hash of all the values. - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L31) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :----------------------- | -| `__namedParameters` | `AccessConditionContext` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L35) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`TransferDIDOwnershipCondition`](conditions.TransferDIDOwnershipCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`TransferDIDOwnershipCondition`](conditions.TransferDIDOwnershipCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/TransferDIDOwnershipCondition.ts#L15) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.TransferNFT721Condition.md b/docs/api-reference/classes/conditions.TransferNFT721Condition.md deleted file mode 100644 index 82238d072..000000000 --- a/docs/api-reference/classes/conditions.TransferNFT721Condition.md +++ /dev/null @@ -1,1136 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / TransferNFT721Condition - -# Class: TransferNFT721Condition - -[conditions](../modules/conditions.md).TransferNFT721Condition - -Condition allowing to transfer an NFT between the original owner and a receiver - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`TransferNFT721ConditionContext`\> - - ↳ **`TransferNFT721Condition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.TransferNFT721Condition.md#constructor) - -### Properties - -- [contract](conditions.TransferNFT721Condition.md#contract) -- [contractName](conditions.TransferNFT721Condition.md#contractname) -- [events](conditions.TransferNFT721Condition.md#events) -- [version](conditions.TransferNFT721Condition.md#version) - -### Accessors - -- [address](conditions.TransferNFT721Condition.md#address) -- [artifactsFolder](conditions.TransferNFT721Condition.md#artifactsfolder) -- [config](conditions.TransferNFT721Condition.md#config) -- [instanceConfig](conditions.TransferNFT721Condition.md#instanceconfig) -- [instantiableConfig](conditions.TransferNFT721Condition.md#instantiableconfig) -- [logger](conditions.TransferNFT721Condition.md#logger) -- [nevermined](conditions.TransferNFT721Condition.md#nevermined) -- [web3](conditions.TransferNFT721Condition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.TransferNFT721Condition.md#abortbytimeout) -- [addresses](conditions.TransferNFT721Condition.md#addresses) -- [call](conditions.TransferNFT721Condition.md#call) -- [checkExists](conditions.TransferNFT721Condition.md#checkexists) -- [findSigner](conditions.TransferNFT721Condition.md#findsigner) -- [fulfill](conditions.TransferNFT721Condition.md#fulfill) -- [fulfillGateway](conditions.TransferNFT721Condition.md#fulfillgateway) -- [fulfillInstance](conditions.TransferNFT721Condition.md#fulfillinstance) -- [fulfillPlain](conditions.TransferNFT721Condition.md#fulfillplain) -- [gatewayMethod](conditions.TransferNFT721Condition.md#gatewaymethod) -- [generateId](conditions.TransferNFT721Condition.md#generateid) -- [generateIdHash](conditions.TransferNFT721Condition.md#generateidhash) -- [generateIdWithSeed](conditions.TransferNFT721Condition.md#generateidwithseed) -- [getAddress](conditions.TransferNFT721Condition.md#getaddress) -- [getConditionFulfilledEvent](conditions.TransferNFT721Condition.md#getconditionfulfilledevent) -- [getContract](conditions.TransferNFT721Condition.md#getcontract) -- [getFromAddress](conditions.TransferNFT721Condition.md#getfromaddress) -- [getInputsOfMethod](conditions.TransferNFT721Condition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.TransferNFT721Condition.md#getsignatureofmethod) -- [hashValues](conditions.TransferNFT721Condition.md#hashvalues) -- [hashValuesPlain](conditions.TransferNFT721Condition.md#hashvaluesplain) -- [init](conditions.TransferNFT721Condition.md#init) -- [instance](conditions.TransferNFT721Condition.md#instance) -- [instanceFromDDO](conditions.TransferNFT721Condition.md#instancefromddo) -- [params](conditions.TransferNFT721Condition.md#params) -- [paramsFromDDO](conditions.TransferNFT721Condition.md#paramsfromddo) -- [send](conditions.TransferNFT721Condition.md#send) -- [sendFrom](conditions.TransferNFT721Condition.md#sendfrom) -- [setInstanceConfig](conditions.TransferNFT721Condition.md#setinstanceconfig) -- [addressesStatic](conditions.TransferNFT721Condition.md#addressesstatic) -- [findSignerStatic](conditions.TransferNFT721Condition.md#findsignerstatic) -- [getInstance](conditions.TransferNFT721Condition.md#getinstance) -- [setInstanceConfig](conditions.TransferNFT721Condition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new TransferNFT721Condition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `nftReceiver`, `lockPaymentCondition`, `nftTokenAddress`, `willBeTransferred?`, `from?`, `txParams?`): `Promise`<`ContractReceipt`\> - -Fulfill the transfer NFT condition. - -**`Remarks`** - -Only DID owner or DID provider can call this method. - -#### Parameters - -| Name | Type | Default value | Description | -| :--------------------- | :---------------------- | :------------ | :--------------------------------------------------- | -| `agreementId` | `string` | `undefined` | The agreement identifier. | -| `did` | `string` | `undefined` | The DID of the asset with NFTs. | -| `nftReceiver` | `string` | `undefined` | The address of the account to receive the NFT. | -| `lockPaymentCondition` | `string` | `undefined` | lock payment condition identifier. | -| `nftTokenAddress` | `string` | `undefined` | address of the nft token to use. | -| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | -| `from?` | [`Account`](Account.md) | `undefined` | | -| `txParams?` | `TxParameters` | `undefined` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -Condition state. - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L129) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L154) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `TransferNFT721ConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `nftHolder`, `nftReceiver`, `lockCondition`, `nftTokenAddress`, `willBeTransferred?`, `expiration?`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generates the hash of condition inputs. - -#### Parameters - -| Name | Type | Default value | Description | -| :------------------ | :-------- | :------------ | :--------------------------------------------------- | -| `did` | `string` | `undefined` | The DID of the asset with NFTs. | -| `nftHolder` | `string` | `undefined` | The address of the Holder of the NFT. | -| `nftReceiver` | `string` | `undefined` | The address of the granted user or the DID provider. | -| `lockCondition` | `string` | `undefined` | Lock condition identifier. | -| `nftTokenAddress` | `string` | `undefined` | The address of the NFT token to use. | -| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | -| `expiration` | `number` | `0` | - | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Hash of all the values - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L43) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`, `lockCondition`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------------------- | -| `__namedParameters` | `TransferNFT721ConditionContext` | -| `lockCondition` | `any` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:88](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L88) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`TransferNFT721Condition`](conditions.TransferNFT721Condition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`TransferNFT721Condition`](conditions.TransferNFT721Condition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts:22](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFT721Condition.ts#L22) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/conditions.TransferNFTCondition.md b/docs/api-reference/classes/conditions.TransferNFTCondition.md deleted file mode 100644 index 8a1d0ab76..000000000 --- a/docs/api-reference/classes/conditions.TransferNFTCondition.md +++ /dev/null @@ -1,1172 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / TransferNFTCondition - -# Class: TransferNFTCondition - -[conditions](../modules/conditions.md).TransferNFTCondition - -Condition allowing to transfer an NFT between the original owner and a receiver - -## Hierarchy - -- [`ProviderCondition`](conditions.ProviderCondition.md)<`TransferNFTConditionContext`\> - - ↳ **`TransferNFTCondition`** - -## Table of contents - -### Constructors - -- [constructor](conditions.TransferNFTCondition.md#constructor) - -### Properties - -- [contract](conditions.TransferNFTCondition.md#contract) -- [contractName](conditions.TransferNFTCondition.md#contractname) -- [events](conditions.TransferNFTCondition.md#events) -- [version](conditions.TransferNFTCondition.md#version) - -### Accessors - -- [address](conditions.TransferNFTCondition.md#address) -- [artifactsFolder](conditions.TransferNFTCondition.md#artifactsfolder) -- [config](conditions.TransferNFTCondition.md#config) -- [instanceConfig](conditions.TransferNFTCondition.md#instanceconfig) -- [instantiableConfig](conditions.TransferNFTCondition.md#instantiableconfig) -- [logger](conditions.TransferNFTCondition.md#logger) -- [nevermined](conditions.TransferNFTCondition.md#nevermined) -- [web3](conditions.TransferNFTCondition.md#web3) - -### Methods - -- [abortByTimeOut](conditions.TransferNFTCondition.md#abortbytimeout) -- [addresses](conditions.TransferNFTCondition.md#addresses) -- [call](conditions.TransferNFTCondition.md#call) -- [checkExists](conditions.TransferNFTCondition.md#checkexists) -- [findSigner](conditions.TransferNFTCondition.md#findsigner) -- [fulfill](conditions.TransferNFTCondition.md#fulfill) -- [fulfillForDelegate](conditions.TransferNFTCondition.md#fulfillfordelegate) -- [fulfillGateway](conditions.TransferNFTCondition.md#fulfillgateway) -- [fulfillInstance](conditions.TransferNFTCondition.md#fulfillinstance) -- [fulfillPlain](conditions.TransferNFTCondition.md#fulfillplain) -- [gatewayMethod](conditions.TransferNFTCondition.md#gatewaymethod) -- [generateId](conditions.TransferNFTCondition.md#generateid) -- [generateIdHash](conditions.TransferNFTCondition.md#generateidhash) -- [generateIdWithSeed](conditions.TransferNFTCondition.md#generateidwithseed) -- [getAddress](conditions.TransferNFTCondition.md#getaddress) -- [getConditionFulfilledEvent](conditions.TransferNFTCondition.md#getconditionfulfilledevent) -- [getContract](conditions.TransferNFTCondition.md#getcontract) -- [getFromAddress](conditions.TransferNFTCondition.md#getfromaddress) -- [getInputsOfMethod](conditions.TransferNFTCondition.md#getinputsofmethod) -- [getSignatureOfMethod](conditions.TransferNFTCondition.md#getsignatureofmethod) -- [hashValues](conditions.TransferNFTCondition.md#hashvalues) -- [hashValuesPlain](conditions.TransferNFTCondition.md#hashvaluesplain) -- [init](conditions.TransferNFTCondition.md#init) -- [instance](conditions.TransferNFTCondition.md#instance) -- [instanceFromDDO](conditions.TransferNFTCondition.md#instancefromddo) -- [params](conditions.TransferNFTCondition.md#params) -- [paramsFromDDO](conditions.TransferNFTCondition.md#paramsfromddo) -- [send](conditions.TransferNFTCondition.md#send) -- [sendFrom](conditions.TransferNFTCondition.md#sendfrom) -- [setInstanceConfig](conditions.TransferNFTCondition.md#setinstanceconfig) -- [addressesStatic](conditions.TransferNFTCondition.md#addressesstatic) -- [findSignerStatic](conditions.TransferNFTCondition.md#findsignerstatic) -- [getInstance](conditions.TransferNFTCondition.md#getinstance) -- [setInstanceConfig](conditions.TransferNFTCondition.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• **new TransferNFTCondition**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[constructor](conditions.ProviderCondition.md#constructor) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L32) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contract](conditions.ProviderCondition.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[contractName](conditions.ProviderCondition.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[events](conditions.ProviderCondition.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[version](conditions.ProviderCondition.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -ProviderCondition.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -ProviderCondition.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -ProviderCondition.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -ProviderCondition.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -ProviderCondition.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -ProviderCondition.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### abortByTimeOut - -▸ **abortByTimeOut**(`agreementId`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------ | :---------------------- | -| `agreementId` | `string` | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[abortByTimeOut](conditions.ProviderCondition.md#abortbytimeout) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L97) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addresses](conditions.ProviderCondition.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[call](conditions.ProviderCondition.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[checkExists](conditions.ProviderCondition.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSigner](conditions.ProviderCondition.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### fulfill - -▸ **fulfill**(`agreementId`, `did`, `nftReceiver`, `nftAmount`, `lockPaymentCondition`, `from?`, `txParams?`): `Promise`<`ContractReceipt`\> - -Fulfill the transfer NFT condition. - -**`Remarks`** - -Only DID owner or DID provider can call this method. - -#### Parameters - -| Name | Type | Description | -| :--------------------- | :---------------------- | :--------------------------------------------- | -| `agreementId` | `string` | The agreement identifier. | -| `did` | `string` | The DID of the asset with NFTs. | -| `nftReceiver` | `string` | The address of the account to receive the NFT. | -| `nftAmount` | `default` | amount of NFTs to transfer. | -| `lockPaymentCondition` | `string` | lock payment condition identifier. | -| `from?` | [`Account`](Account.md) | | -| `txParams?` | `TxParameters` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -Condition state. - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[fulfill](conditions.ProviderCondition.md#fulfill) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L124) - ---- - -### fulfillForDelegate - -▸ **fulfillForDelegate**(`agreementId`, `did`, `nftHolder`, `nftReceiver`, `nftAmount`, `lockPaymentCondition`, `transferAsset?`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -Fulfill the transfer NFT condition. - -**`Remarks`** - -Only DID owner or DID provider can call this method. - -#### Parameters - -| Name | Type | Default value | Description | -| :--------------------- | :---------------------- | :------------ | :---------------------------------------------------- | -| `agreementId` | `string` | `undefined` | The agreement identifier. | -| `did` | `string` | `undefined` | The DID of the asset with NFTs. | -| `nftHolder` | `string` | `undefined` | The address of the account currently holding the NFT. | -| `nftReceiver` | `string` | `undefined` | The address of the account to receive the NFT. | -| `nftAmount` | `default` | `undefined` | The amount of NFTs to transfer. | -| `lockPaymentCondition` | `string` | `undefined` | The lock payment condition identifier. | -| `transferAsset` | `boolean` | `true` | - | -| `from?` | [`Account`](Account.md) | `undefined` | | -| `params?` | `TxParameters` | `undefined` | - | - -#### Returns - -`Promise`<`ContractReceipt`\> - -Condition state. - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:156](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L156) - ---- - -### fulfillGateway - -▸ **fulfillGateway**(`cond`, `additionalParams`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------------------------------------------------------------- | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | -| `additionalParams` | `Record`<`string`, `unknown`\> | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillGateway](conditions.ProviderCondition.md#fulfillgateway) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:204](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L204) - ---- - -### fulfillInstance - -▸ **fulfillInstance**(`cond`, `additionalParams`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :----------------- | :---------------------------------------------------------------------------------------------------- | :------------ | -| `cond` | [`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\> | `undefined` | -| `additionalParams` | `Record`<`string`, `unknown`\> | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillInstance](conditions.ProviderCondition.md#fulfillinstance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L162) - ---- - -### fulfillPlain - -▸ **fulfillPlain**(`agreementId`, `args`, `from?`, `params?`, `method?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | Default value | -| :------------ | :------------------------------------------------------------ | :------------ | -| `agreementId` | `string` | `undefined` | -| `args` | `any`[] | `undefined` | -| `from?` | [`Account`](Account.md) | `undefined` | -| `params?` | `TxParameters` | `undefined` | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | `'fulfill'` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[fulfillPlain](conditions.ProviderCondition.md#fulfillplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L69) - ---- - -### gatewayMethod - -▸ **gatewayMethod**(): [`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Returns - -[`ConditionMethod`](../modules/conditions.md#conditionmethod) - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[gatewayMethod](conditions.ProviderCondition.md#gatewaymethod) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L183) - ---- - -### generateId - -▸ **generateId**(`agreementId`, `valueHash`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateId](conditions.ProviderCondition.md#generateid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:83](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L83) - ---- - -### generateIdHash - -▸ **generateIdHash**(`agreementId`, ...`values`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `...values` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdHash](conditions.ProviderCondition.md#generateidhash) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L79) - ---- - -### generateIdWithSeed - -▸ **generateIdWithSeed**(`agreementId`, `valueHash`): `Promise`<[`string`, `string`]\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `valueHash` | `string` | - -#### Returns - -`Promise`<[`string`, `string`]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[generateIdWithSeed](conditions.ProviderCondition.md#generateidwithseed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L87) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getAddress](conditions.ProviderCondition.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getConditionFulfilledEvent - -▸ **getConditionFulfilledEvent**(`agreementId`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getConditionFulfilledEvent](conditions.ProviderCondition.md#getconditionfulfilledevent) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:101](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L101) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getContract](conditions.ProviderCondition.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getFromAddress](conditions.ProviderCondition.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getInputsOfMethod](conditions.ProviderCondition.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[getSignatureOfMethod](conditions.ProviderCondition.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### hashValues - -▸ **hashValues**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValues](conditions.ProviderCondition.md#hashvalues) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:141](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L141) - ---- - -### hashValuesPlain - -▸ **hashValuesPlain**(...`args`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[hashValuesPlain](conditions.ProviderCondition.md#hashvaluesplain) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:145](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L145) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[init](conditions.ProviderCondition.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instance - -▸ **instance**(`agreementId`, `params`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :-------------------------------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `params` | [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instance](conditions.ProviderCondition.md#instance) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L184) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementId`, `ctx`, ...`args`): `Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------- | -| `agreementId` | `string` | -| `ctx` | `TransferNFTConditionContext` | -| `...args` | [`ConditionInstanceSmall`](../interfaces/conditions.ConditionInstanceSmall.md)[] | - -#### Returns - -`Promise`<[`ConditionInstance`](../interfaces/conditions.ConditionInstance.md)<`Record`<`string`, `unknown`\>\>\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[instanceFromDDO](conditions.ProviderCondition.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:154](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L154) - ---- - -### params - -▸ **params**(`did`, `nftHolder`, `nftReceiver`, `nftAmount`, `lockCondition`, `nftContractAddress?`, `willBeTransferred?`): [`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Generates the hash of condition inputs. - -#### Parameters - -| Name | Type | Default value | Description | -| :-------------------- | :-------- | :------------ | :--------------------------------------------------- | -| `did` | `string` | `undefined` | The DID of the asset with NFTs. | -| `nftHolder` | `string` | `undefined` | The address of the holder of the NFT. | -| `nftReceiver` | `string` | `undefined` | The address of the granted user or the DID provider. | -| `nftAmount` | `default` | `undefined` | Amount of NFTs to transfer. | -| `lockCondition` | `string` | `undefined` | Lock condition identifier. | -| `nftContractAddress?` | `string` | `undefined` | The address of the NFT token to use. | -| `willBeTransferred` | `boolean` | `true` | Indicates if the asset will be transferred or minted | - -#### Returns - -[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\> - -Hash of all the values - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[params](conditions.ProviderCondition.md#params) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L42) - ---- - -### paramsFromDDO - -▸ **paramsFromDDO**(`__namedParameters`, `lockCondition`): `Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :---------------------------- | -| `__namedParameters` | `TransferNFTConditionContext` | -| `lockCondition` | `any` | - -#### Returns - -`Promise`<[`ConditionParameters`](../interfaces/conditions.ConditionParameters.md)<`Record`<`string`, `unknown`\>\>\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[paramsFromDDO](conditions.ProviderCondition.md#paramsfromddo) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L90) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[send](conditions.ProviderCondition.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[sendFrom](conditions.ProviderCondition.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[addressesStatic](conditions.ProviderCondition.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[findSignerStatic](conditions.ProviderCondition.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`TransferNFTCondition`](conditions.TransferNFTCondition.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`TransferNFTCondition`](conditions.TransferNFTCondition.md)\> - -#### Overrides - -[ProviderCondition](conditions.ProviderCondition.md).[getInstance](conditions.ProviderCondition.md#getinstance) - -#### Defined in - -[src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/NFTs/TransferNFTCondition.ts#L24) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[ProviderCondition](conditions.ProviderCondition.md).[setInstanceConfig](conditions.ProviderCondition.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/events.ContractEvent.md b/docs/api-reference/classes/events.ContractEvent.md deleted file mode 100644 index 12106d6db..000000000 --- a/docs/api-reference/classes/events.ContractEvent.md +++ /dev/null @@ -1,585 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / ContractEvent - -# Class: ContractEvent - -[events](../modules/events.md).ContractEvent - -## Hierarchy - -- [`NeverminedEvent`](events.NeverminedEvent.md) - - ↳ **`ContractEvent`** - -## Table of contents - -### Constructors - -- [constructor](events.ContractEvent.md#constructor) - -### Properties - -- [contract](events.ContractEvent.md#contract) -- [eventEmitter](events.ContractEvent.md#eventemitter) - -### Accessors - -- [artifactsFolder](events.ContractEvent.md#artifactsfolder) -- [config](events.ContractEvent.md#config) -- [instanceConfig](events.ContractEvent.md#instanceconfig) -- [instantiableConfig](events.ContractEvent.md#instantiableconfig) -- [logger](events.ContractEvent.md#logger) -- [nevermined](events.ContractEvent.md#nevermined) -- [web3](events.ContractEvent.md#web3) - -### Methods - -- [addresses](events.ContractEvent.md#addresses) -- [checkExists](events.ContractEvent.md#checkexists) -- [eventExists](events.ContractEvent.md#eventexists) -- [filterToArgs](events.ContractEvent.md#filtertoargs) -- [findSigner](events.ContractEvent.md#findsigner) -- [getBlockNumber](events.ContractEvent.md#getblocknumber) -- [getEventData](events.ContractEvent.md#geteventdata) -- [getPastEvents](events.ContractEvent.md#getpastevents) -- [once](events.ContractEvent.md#once) -- [setInstanceConfig](events.ContractEvent.md#setinstanceconfig) -- [subscribe](events.ContractEvent.md#subscribe) -- [addressesStatic](events.ContractEvent.md#addressesstatic) -- [findSignerStatic](events.ContractEvent.md#findsignerstatic) -- [getInstance](events.ContractEvent.md#getinstance) -- [setInstanceConfig](events.ContractEvent.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new ContractEvent**(`contract`, `eventEmitter`) - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------------------------------- | -| `contract` | `ContractBase` | -| `eventEmitter` | [`EventEmitter`](../interfaces/events.EventEmitter.md) | - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[constructor](events.NeverminedEvent.md#constructor) - -#### Defined in - -[src/events/NeverminedEvent.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L35) - -## Properties - -### contract - -• `Protected` **contract**: `ContractBase` = `null` - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[contract](events.NeverminedEvent.md#contract) - -#### Defined in - -[src/events/NeverminedEvent.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L30) - ---- - -### eventEmitter - -• `Protected` **eventEmitter**: [`EventEmitter`](../interfaces/events.EventEmitter.md) - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[eventEmitter](events.NeverminedEvent.md#eventemitter) - -#### Defined in - -[src/events/NeverminedEvent.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L29) - -## Accessors - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -NeverminedEvent.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -NeverminedEvent.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -NeverminedEvent.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -NeverminedEvent.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -NeverminedEvent.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -NeverminedEvent.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -NeverminedEvent.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[addresses](events.NeverminedEvent.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[checkExists](events.NeverminedEvent.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### eventExists - -▸ `Private` **eventExists**(`eventName`): `boolean` - -#### Parameters - -| Name | Type | -| :---------- | :------- | -| `eventName` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -[src/events/ContractEvent.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/ContractEvent.ts#L69) - ---- - -### filterToArgs - -▸ `Private` **filterToArgs**(`eventName`, `filter`): `any`[] - -#### Parameters - -| Name | Type | -| :---------- | :----------------------------------------- | -| `eventName` | `string` | -| `filter` | [`Filter`](../interfaces/events.Filter.md) | - -#### Returns - -`any`[] - -#### Defined in - -[src/events/ContractEvent.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/ContractEvent.ts#L73) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[findSigner](events.NeverminedEvent.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getBlockNumber - -▸ **getBlockNumber**(): `Promise`<`number`\> - -#### Returns - -`Promise`<`number`\> - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getBlockNumber](events.NeverminedEvent.md#getblocknumber) - -#### Defined in - -[src/events/ContractEvent.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/ContractEvent.ts#L65) - ---- - -### getEventData - -▸ **getEventData**(`options`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getEventData](events.NeverminedEvent.md#geteventdata) - -#### Defined in - -[src/events/ContractEvent.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/ContractEvent.ts#L29) - ---- - -### getPastEvents - -▸ **getPastEvents**(`options`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getPastEvents](events.NeverminedEvent.md#getpastevents) - -#### Defined in - -[src/events/ContractEvent.ts:47](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/ContractEvent.ts#L47) - ---- - -### once - -▸ **once**(`callback?`, `options?`): `Promise`<[`EventResult`](../modules/events.md#eventresult)\> - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------------------------------ | -| `callback?` | (`events`: [`EventResult`](../modules/events.md#eventresult)[]) => `void` | -| `options?` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -`Promise`<[`EventResult`](../modules/events.md#eventresult)\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[once](events.NeverminedEvent.md#once) - -#### Defined in - -[src/events/NeverminedEvent.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L55) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[setInstanceConfig](events.NeverminedEvent.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### subscribe - -▸ **subscribe**(`callback`, `options`): [`ContractEventSubscription`](../interfaces/events.ContractEventSubscription.md) - -#### Parameters - -| Name | Type | -| :--------- | :------------------------------------------------------------------------ | -| `callback` | (`events`: [`EventResult`](../modules/events.md#eventresult)[]) => `void` | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`ContractEventSubscription`](../interfaces/events.ContractEventSubscription.md) - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[subscribe](events.NeverminedEvent.md#subscribe) - -#### Defined in - -[src/events/NeverminedEvent.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L41) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[addressesStatic](events.NeverminedEvent.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[findSignerStatic](events.NeverminedEvent.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`contract`, `eventEmitter`, `nevermined`, `web3`): [`ContractEvent`](events.ContractEvent.md) - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------------------------------- | -| `contract` | `ContractBase` | -| `eventEmitter` | [`EventEmitter`](../interfaces/events.EventEmitter.md) | -| `nevermined` | [`Nevermined`](Nevermined.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -[`ContractEvent`](events.ContractEvent.md) - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getInstance](events.NeverminedEvent.md#getinstance) - -#### Defined in - -[src/events/ContractEvent.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/ContractEvent.ts#L14) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[setInstanceConfig](events.NeverminedEvent.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/events.NeverminedEvent.md b/docs/api-reference/classes/events.NeverminedEvent.md deleted file mode 100644 index 584bf15e9..000000000 --- a/docs/api-reference/classes/events.NeverminedEvent.md +++ /dev/null @@ -1,521 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / NeverminedEvent - -# Class: NeverminedEvent - -[events](../modules/events.md).NeverminedEvent - -## Hierarchy - -- `Instantiable` - - ↳ **`NeverminedEvent`** - - ↳↳ [`ContractEvent`](events.ContractEvent.md) - - ↳↳ [`SubgraphEvent`](events.SubgraphEvent.md) - -## Table of contents - -### Constructors - -- [constructor](events.NeverminedEvent.md#constructor) - -### Properties - -- [contract](events.NeverminedEvent.md#contract) -- [eventEmitter](events.NeverminedEvent.md#eventemitter) - -### Accessors - -- [artifactsFolder](events.NeverminedEvent.md#artifactsfolder) -- [config](events.NeverminedEvent.md#config) -- [instanceConfig](events.NeverminedEvent.md#instanceconfig) -- [instantiableConfig](events.NeverminedEvent.md#instantiableconfig) -- [logger](events.NeverminedEvent.md#logger) -- [nevermined](events.NeverminedEvent.md#nevermined) -- [web3](events.NeverminedEvent.md#web3) - -### Methods - -- [addresses](events.NeverminedEvent.md#addresses) -- [checkExists](events.NeverminedEvent.md#checkexists) -- [findSigner](events.NeverminedEvent.md#findsigner) -- [getBlockNumber](events.NeverminedEvent.md#getblocknumber) -- [getEventData](events.NeverminedEvent.md#geteventdata) -- [getPastEvents](events.NeverminedEvent.md#getpastevents) -- [once](events.NeverminedEvent.md#once) -- [setInstanceConfig](events.NeverminedEvent.md#setinstanceconfig) -- [subscribe](events.NeverminedEvent.md#subscribe) -- [addressesStatic](events.NeverminedEvent.md#addressesstatic) -- [findSignerStatic](events.NeverminedEvent.md#findsignerstatic) -- [getInstance](events.NeverminedEvent.md#getinstance) -- [setInstanceConfig](events.NeverminedEvent.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new NeverminedEvent**(`contract`, `eventEmitter`) - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------------------------------- | -| `contract` | `ContractBase` | -| `eventEmitter` | [`EventEmitter`](../interfaces/events.EventEmitter.md) | - -#### Overrides - -Instantiable.constructor - -#### Defined in - -[src/events/NeverminedEvent.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L35) - -## Properties - -### contract - -• `Protected` **contract**: `ContractBase` = `null` - -#### Defined in - -[src/events/NeverminedEvent.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L30) - ---- - -### eventEmitter - -• `Protected` **eventEmitter**: [`EventEmitter`](../interfaces/events.EventEmitter.md) - -#### Defined in - -[src/events/NeverminedEvent.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L29) - -## Accessors - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Instantiable.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -Instantiable.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -Instantiable.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -Instantiable.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -Instantiable.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -Instantiable.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addresses - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -Instantiable.checkExists - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSigner - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getBlockNumber - -▸ `Abstract` **getBlockNumber**(...`args`): `Promise`<`number`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Promise`<`number`\> - -#### Defined in - -[src/events/NeverminedEvent.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L33) - ---- - -### getEventData - -▸ `Abstract` **getEventData**(`options`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Defined in - -[src/events/NeverminedEvent.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L31) - ---- - -### getPastEvents - -▸ `Abstract` **getPastEvents**(`options`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Defined in - -[src/events/NeverminedEvent.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L32) - ---- - -### once - -▸ **once**(`callback?`, `options?`): `Promise`<[`EventResult`](../modules/events.md#eventresult)\> - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------------------------------ | -| `callback?` | (`events`: [`EventResult`](../modules/events.md#eventresult)[]) => `void` | -| `options?` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -`Promise`<[`EventResult`](../modules/events.md#eventresult)\> - -#### Defined in - -[src/events/NeverminedEvent.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L55) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### subscribe - -▸ **subscribe**(`callback`, `options`): [`ContractEventSubscription`](../interfaces/events.ContractEventSubscription.md) - -#### Parameters - -| Name | Type | -| :--------- | :------------------------------------------------------------------------ | -| `callback` | (`events`: [`EventResult`](../modules/events.md#eventresult)[]) => `void` | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`ContractEventSubscription`](../interfaces/events.ContractEventSubscription.md) - -#### Defined in - -[src/events/NeverminedEvent.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L41) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -Instantiable.addressesStatic - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -Instantiable.findSignerStatic - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(...`_args`): `any` - -#### Parameters - -| Name | Type | -| :--------- | :---- | -| `..._args` | `any` | - -#### Returns - -`any` - -#### Inherited from - -Instantiable.getInstance - -#### Defined in - -[src/Instantiable.abstract.ts:158](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L158) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -Instantiable.setInstanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/events.SubgraphEvent.md b/docs/api-reference/classes/events.SubgraphEvent.md deleted file mode 100644 index 85234943f..000000000 --- a/docs/api-reference/classes/events.SubgraphEvent.md +++ /dev/null @@ -1,590 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / SubgraphEvent - -# Class: SubgraphEvent - -[events](../modules/events.md).SubgraphEvent - -## Hierarchy - -- [`NeverminedEvent`](events.NeverminedEvent.md) - - ↳ **`SubgraphEvent`** - -## Table of contents - -### Constructors - -- [constructor](events.SubgraphEvent.md#constructor) - -### Properties - -- [contract](events.SubgraphEvent.md#contract) -- [eventEmitter](events.SubgraphEvent.md#eventemitter) -- [graphHttpUri](events.SubgraphEvent.md#graphhttpuri) -- [networkName](events.SubgraphEvent.md#networkname) -- [subgraph](events.SubgraphEvent.md#subgraph) - -### Accessors - -- [artifactsFolder](events.SubgraphEvent.md#artifactsfolder) -- [config](events.SubgraphEvent.md#config) -- [instanceConfig](events.SubgraphEvent.md#instanceconfig) -- [instantiableConfig](events.SubgraphEvent.md#instantiableconfig) -- [logger](events.SubgraphEvent.md#logger) -- [nevermined](events.SubgraphEvent.md#nevermined) -- [web3](events.SubgraphEvent.md#web3) - -### Methods - -- [addresses](events.SubgraphEvent.md#addresses) -- [checkExists](events.SubgraphEvent.md#checkexists) -- [findSigner](events.SubgraphEvent.md#findsigner) -- [getBlockNumber](events.SubgraphEvent.md#getblocknumber) -- [getEventData](events.SubgraphEvent.md#geteventdata) -- [getPastEvents](events.SubgraphEvent.md#getpastevents) -- [once](events.SubgraphEvent.md#once) -- [setInstanceConfig](events.SubgraphEvent.md#setinstanceconfig) -- [subgraphUrl](events.SubgraphEvent.md#subgraphurl) -- [subscribe](events.SubgraphEvent.md#subscribe) -- [addressesStatic](events.SubgraphEvent.md#addressesstatic) -- [findSignerStatic](events.SubgraphEvent.md#findsignerstatic) -- [getInstance](events.SubgraphEvent.md#getinstance) -- [setInstanceConfig](events.SubgraphEvent.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new SubgraphEvent**(`contract`, `eventEmitter`) - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------------------------------- | -| `contract` | `ContractBase` | -| `eventEmitter` | [`EventEmitter`](../interfaces/events.EventEmitter.md) | - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[constructor](events.NeverminedEvent.md#constructor) - -#### Defined in - -[src/events/NeverminedEvent.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L35) - -## Properties - -### contract - -• `Protected` **contract**: `ContractBase` = `null` - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[contract](events.NeverminedEvent.md#contract) - -#### Defined in - -[src/events/NeverminedEvent.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L30) - ---- - -### eventEmitter - -• `Protected` **eventEmitter**: [`EventEmitter`](../interfaces/events.EventEmitter.md) - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[eventEmitter](events.NeverminedEvent.md#eventemitter) - -#### Defined in - -[src/events/NeverminedEvent.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L29) - ---- - -### graphHttpUri - -• `Private` **graphHttpUri**: `string` - -#### Defined in - -[src/events/SubgraphEvent.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L14) - ---- - -### networkName - -• `Private` **networkName**: `string` - -#### Defined in - -[src/events/SubgraphEvent.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L16) - ---- - -### subgraph - -• **subgraph**: `any` - -#### Defined in - -[src/events/SubgraphEvent.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L15) - -## Accessors - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -NeverminedEvent.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -NeverminedEvent.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -NeverminedEvent.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -NeverminedEvent.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -NeverminedEvent.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -NeverminedEvent.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -NeverminedEvent.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[addresses](events.NeverminedEvent.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[checkExists](events.NeverminedEvent.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[findSigner](events.NeverminedEvent.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getBlockNumber - -▸ **getBlockNumber**(): `Promise`<`number`\> - -#### Returns - -`Promise`<`number`\> - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getBlockNumber](events.NeverminedEvent.md#getblocknumber) - -#### Defined in - -[src/events/SubgraphEvent.ts:56](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L56) - ---- - -### getEventData - -▸ **getEventData**(`options`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getEventData](events.NeverminedEvent.md#geteventdata) - -#### Defined in - -[src/events/SubgraphEvent.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L31) - ---- - -### getPastEvents - -▸ **getPastEvents**(`options`): [`EventResult`](../modules/events.md#eventresult) - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`EventResult`](../modules/events.md#eventresult) - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getPastEvents](events.NeverminedEvent.md#getpastevents) - -#### Defined in - -[src/events/SubgraphEvent.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L52) - ---- - -### once - -▸ **once**(`callback?`, `options?`): `Promise`<[`EventResult`](../modules/events.md#eventresult)\> - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------------------------------ | -| `callback?` | (`events`: [`EventResult`](../modules/events.md#eventresult)[]) => `void` | -| `options?` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -`Promise`<[`EventResult`](../modules/events.md#eventresult)\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[once](events.NeverminedEvent.md#once) - -#### Defined in - -[src/events/NeverminedEvent.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L55) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[setInstanceConfig](events.NeverminedEvent.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### subgraphUrl - -▸ `Private` **subgraphUrl**(): `Promise`<`string`\> - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[src/events/SubgraphEvent.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L63) - ---- - -### subscribe - -▸ **subscribe**(`callback`, `options`): [`ContractEventSubscription`](../interfaces/events.ContractEventSubscription.md) - -#### Parameters - -| Name | Type | -| :--------- | :------------------------------------------------------------------------ | -| `callback` | (`events`: [`EventResult`](../modules/events.md#eventresult)[]) => `void` | -| `options` | [`EventOptions`](../interfaces/events.EventOptions.md) | - -#### Returns - -[`ContractEventSubscription`](../interfaces/events.ContractEventSubscription.md) - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[subscribe](events.NeverminedEvent.md#subscribe) - -#### Defined in - -[src/events/NeverminedEvent.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L41) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[addressesStatic](events.NeverminedEvent.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[findSignerStatic](events.NeverminedEvent.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`contract`, `eventEmitter`, `graphHttpUri`, `networkName`): [`SubgraphEvent`](events.SubgraphEvent.md) - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------------------------------- | -| `contract` | `ContractBase` | -| `eventEmitter` | [`EventEmitter`](../interfaces/events.EventEmitter.md) | -| `graphHttpUri` | `string` | -| `networkName` | `string` | - -#### Returns - -[`SubgraphEvent`](events.SubgraphEvent.md) - -#### Overrides - -[NeverminedEvent](events.NeverminedEvent.md).[getInstance](events.NeverminedEvent.md#getinstance) - -#### Defined in - -[src/events/SubgraphEvent.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/SubgraphEvent.ts#L17) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[NeverminedEvent](events.NeverminedEvent.md).[setInstanceConfig](events.NeverminedEvent.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.AaveCreditTemplate.md b/docs/api-reference/classes/templates.AaveCreditTemplate.md deleted file mode 100644 index 37157cfc7..000000000 --- a/docs/api-reference/classes/templates.AaveCreditTemplate.md +++ /dev/null @@ -1,1723 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / AaveCreditTemplate - -# Class: AaveCreditTemplate - -[templates](../modules/templates.md).AaveCreditTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`AaveCreditTemplateParams`, `ServiceAaveCredit`\> - - ↳ **`AaveCreditTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.AaveCreditTemplate.md#constructor) - -### Properties - -- [aaveConfig](templates.AaveCreditTemplate.md#aaveconfig) -- [contract](templates.AaveCreditTemplate.md#contract) -- [contractName](templates.AaveCreditTemplate.md#contractname) -- [events](templates.AaveCreditTemplate.md#events) -- [version](templates.AaveCreditTemplate.md#version) - -### Accessors - -- [address](templates.AaveCreditTemplate.md#address) -- [artifactsFolder](templates.AaveCreditTemplate.md#artifactsfolder) -- [config](templates.AaveCreditTemplate.md#config) -- [instanceConfig](templates.AaveCreditTemplate.md#instanceconfig) -- [instantiableConfig](templates.AaveCreditTemplate.md#instantiableconfig) -- [logger](templates.AaveCreditTemplate.md#logger) -- [nevermined](templates.AaveCreditTemplate.md#nevermined) -- [web3](templates.AaveCreditTemplate.md#web3) - -### Methods - -- [\_createAgreement](templates.AaveCreditTemplate.md#_createagreement) -- [accept](templates.AaveCreditTemplate.md#accept) -- [addresses](templates.AaveCreditTemplate.md#addresses) -- [agreementId](templates.AaveCreditTemplate.md#agreementid) -- [call](templates.AaveCreditTemplate.md#call) -- [checkExists](templates.AaveCreditTemplate.md#checkexists) -- [conditions](templates.AaveCreditTemplate.md#conditions) -- [createAgreement](templates.AaveCreditTemplate.md#createagreement) -- [createAgreementAndDeployVault](templates.AaveCreditTemplate.md#createagreementanddeployvault) -- [createAgreementAndPay](templates.AaveCreditTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.AaveCreditTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.AaveCreditTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.AaveCreditTemplate.md#createservice) -- [deployVault](templates.AaveCreditTemplate.md#deployvault) -- [description](templates.AaveCreditTemplate.md#description) -- [extraGen](templates.AaveCreditTemplate.md#extragen) -- [findSigner](templates.AaveCreditTemplate.md#findsigner) -- [getAddress](templates.AaveCreditTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.AaveCreditTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.AaveCreditTemplate.md#getagreementdata) -- [getAgreementDid](templates.AaveCreditTemplate.md#getagreementdid) -- [getAgreementIdsFromDDO](templates.AaveCreditTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.AaveCreditTemplate.md#getagreementstatus) -- [getAgreementVaultAddress](templates.AaveCreditTemplate.md#getagreementvaultaddress) -- [getAgreementsForDID](templates.AaveCreditTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.AaveCreditTemplate.md#getconditiontypes) -- [getConditions](templates.AaveCreditTemplate.md#getconditions) -- [getContract](templates.AaveCreditTemplate.md#getcontract) -- [getFromAddress](templates.AaveCreditTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.AaveCreditTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.AaveCreditTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.AaveCreditTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.AaveCreditTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.AaveCreditTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.AaveCreditTemplate.md#getsignatureofmethod) -- [init](templates.AaveCreditTemplate.md#init) -- [instanceFromDDO](templates.AaveCreditTemplate.md#instancefromddo) -- [lockConditionIndex](templates.AaveCreditTemplate.md#lockconditionindex) -- [lockTokens](templates.AaveCreditTemplate.md#locktokens) -- [name](templates.AaveCreditTemplate.md#name) -- [params](templates.AaveCreditTemplate.md#params) -- [paramsGen](templates.AaveCreditTemplate.md#paramsgen) -- [paymentData](templates.AaveCreditTemplate.md#paymentdata) -- [printAgreementStatus](templates.AaveCreditTemplate.md#printagreementstatus) -- [process](templates.AaveCreditTemplate.md#process) -- [send](templates.AaveCreditTemplate.md#send) -- [sendFrom](templates.AaveCreditTemplate.md#sendfrom) -- [service](templates.AaveCreditTemplate.md#service) -- [serviceEndpoint](templates.AaveCreditTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.AaveCreditTemplate.md#setinstanceconfig) -- [standardContext](templates.AaveCreditTemplate.md#standardcontext) -- [validateAgreement](templates.AaveCreditTemplate.md#validateagreement) -- [addressesStatic](templates.AaveCreditTemplate.md#addressesstatic) -- [findSignerStatic](templates.AaveCreditTemplate.md#findsignerstatic) -- [getInstance](templates.AaveCreditTemplate.md#getinstance) -- [setInstanceConfig](templates.AaveCreditTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new AaveCreditTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### aaveConfig - -• **aaveConfig**: `AaveConfig` - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L52) - ---- - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### \_createAgreement - -▸ `Private` **\_createAgreement**(`agreementIdSeed`, `ddo`, `vaultAddress`, `nftTokenContract`, `nftAmount`, `collateralToken`, `collateralAmount`, `delegatedToken`, `delegatedAmount`, `interestRateMode`, `timeLocks`, `timeOuts`, `txParams?`, `from?`): `Promise`<[`ContractReceipt`, [`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AaveCreditTemplateParams`\>]\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `vaultAddress` | `string` | -| `nftTokenContract` | `string` | -| `nftAmount` | `number` | -| `collateralToken` | `string` | -| `collateralAmount` | `number` | -| `delegatedToken` | `string` | -| `delegatedAmount` | `number` | -| `interestRateMode` | `number` | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `txParams?` | `TxParameters` | -| `from?` | [`Account`](Account.md) | - -#### Returns - -`Promise`<[`ContractReceipt`, [`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AaveCreditTemplateParams`\>]\> - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:102](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L102) - ---- - -### accept - -▸ **accept**(`_params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L112) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`NFT721LockCondition`](conditions.NFT721LockCondition.md), [`AaveCollateralDepositCondition`](conditions.AaveCollateralDepositCondition.md), [`AaveBorrowCondition`](conditions.AaveBorrowCondition.md), [`AaveRepayCondition`](conditions.AaveRepayCondition.md), [`AaveCollateralWithdrawCondition`](conditions.AaveCollateralWithdrawCondition.md), [`DistributeNFTCollateralCondition`](conditions.DistributeNFTCollateralCondition.md)] - -#### Returns - -[[`NFT721LockCondition`](conditions.NFT721LockCondition.md), [`AaveCollateralDepositCondition`](conditions.AaveCollateralDepositCondition.md), [`AaveBorrowCondition`](conditions.AaveBorrowCondition.md), [`AaveRepayCondition`](conditions.AaveRepayCondition.md), [`AaveCollateralWithdrawCondition`](conditions.AaveCollateralWithdrawCondition.md), [`DistributeNFTCollateralCondition`](conditions.DistributeNFTCollateralCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:285](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L285) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndDeployVault - -▸ **createAgreementAndDeployVault**(`agreementIdSeed`, `ddo`, `nftTokenContract`, `nftAmount`, `collateralToken`, `collateralAmount`, `delegatedToken`, `delegatedAmount`, `interestRateMode`, `borrower`, `lender`, `timeLocks`, `timeOuts`, `txParams?`, `from?`): `Promise`<[`ContractReceipt`, `string`, [`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AaveCreditTemplateParams`\>]\> - -#### Parameters - -| Name | Type | -| :----------------- | :---------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `nftTokenContract` | `string` | -| `nftAmount` | `number` | -| `collateralToken` | `string` | -| `collateralAmount` | `number` | -| `delegatedToken` | `string` | -| `delegatedAmount` | `number` | -| `interestRateMode` | `number` | -| `borrower` | `string` | -| `lender` | `string` | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `txParams?` | `TxParameters` | -| `from?` | [`Account`](Account.md) | - -#### Returns - -`Promise`<[`ContractReceipt`, `string`, [`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AaveCreditTemplateParams`\>]\> - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:155](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L155) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :------------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `AaveCreditTemplateParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `AaveCreditTemplateParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`ServiceAaveCredit`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`ServiceAaveCredit`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### deployVault - -▸ **deployVault**(`lendingPool`, `dataProvider`, `weth`, `agreementFee`, `treasuryAddress`, `borrower`, `lender`, `from`): `Promise`<`string`\> - -Deploy a new credit vault that is required to facilitate an Aave credit agreement - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `lendingPool` | `string` | -| `dataProvider` | `string` | -| `weth` | `string` | -| `agreementFee` | `number` | -| `treasuryAddress` | `string` | -| `borrower` | `string` | -| `lender` | `string` | -| `from` | `string` | - -#### Returns - -`Promise`<`string`\> - -Agreement ID. - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L207) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:49](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L49) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementDid - -▸ **getAgreementDid**(`agreementId`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:318](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L318) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------------------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `AaveCreditTemplateParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementVaultAddress - -▸ **getAgreementVaultAddress**(`agreementId`, `from`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | -| `from` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:311](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L311) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:98](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L98) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AaveCreditTemplateParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `AaveCreditTemplateParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AaveCreditTemplateParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:233](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L233) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:46](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L46) - ---- - -### params - -▸ **params**(`vaultAddress`, `nftContractAddress`, `nftAmount`, `collateralAsset`, `collateralAmount`, `delegatedAsset`, `delegatedAmount`, `interestRateMode`): `AaveCreditTemplateParams` - -#### Parameters - -| Name | Type | -| :------------------- | :------- | -| `vaultAddress` | `string` | -| `nftContractAddress` | `string` | -| `nftAmount` | `number` | -| `collateralAsset` | `string` | -| `collateralAmount` | `string` | -| `delegatedAsset` | `string` | -| `delegatedAmount` | `string` | -| `interestRateMode` | `number` | - -#### Returns - -`AaveCreditTemplateParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:71](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L71) - ---- - -### paramsGen - -▸ **paramsGen**(`_params`): `Promise`<`AaveCreditTemplateParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :-------- | :----------------- | :----------------- | -| `_params` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`AaveCreditTemplateParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L43) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:67](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L67) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :------------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `AaveCreditTemplateParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`AaveCreditTemplate`](templates.AaveCreditTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`AaveCreditTemplate`](templates.AaveCreditTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/defi/AaveCreditTemplate.ts:54](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/defi/AaveCreditTemplate.ts#L54) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.AccessTemplate.md b/docs/api-reference/classes/templates.AccessTemplate.md deleted file mode 100644 index b99e93dab..000000000 --- a/docs/api-reference/classes/templates.AccessTemplate.md +++ /dev/null @@ -1,1562 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / AccessTemplate - -# Class: AccessTemplate - -[templates](../modules/templates.md).AccessTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`AccessTemplateParams`, `ServiceAccess`\> - - ↳ **`AccessTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.AccessTemplate.md#constructor) - -### Properties - -- [contract](templates.AccessTemplate.md#contract) -- [contractName](templates.AccessTemplate.md#contractname) -- [events](templates.AccessTemplate.md#events) -- [version](templates.AccessTemplate.md#version) - -### Accessors - -- [address](templates.AccessTemplate.md#address) -- [artifactsFolder](templates.AccessTemplate.md#artifactsfolder) -- [config](templates.AccessTemplate.md#config) -- [instanceConfig](templates.AccessTemplate.md#instanceconfig) -- [instantiableConfig](templates.AccessTemplate.md#instantiableconfig) -- [logger](templates.AccessTemplate.md#logger) -- [nevermined](templates.AccessTemplate.md#nevermined) -- [web3](templates.AccessTemplate.md#web3) - -### Methods - -- [accept](templates.AccessTemplate.md#accept) -- [addresses](templates.AccessTemplate.md#addresses) -- [agreementId](templates.AccessTemplate.md#agreementid) -- [call](templates.AccessTemplate.md#call) -- [checkExists](templates.AccessTemplate.md#checkexists) -- [conditions](templates.AccessTemplate.md#conditions) -- [createAgreement](templates.AccessTemplate.md#createagreement) -- [createAgreementAndPay](templates.AccessTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.AccessTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.AccessTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.AccessTemplate.md#createservice) -- [description](templates.AccessTemplate.md#description) -- [extraGen](templates.AccessTemplate.md#extragen) -- [findSigner](templates.AccessTemplate.md#findsigner) -- [getAddress](templates.AccessTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.AccessTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.AccessTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.AccessTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.AccessTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.AccessTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.AccessTemplate.md#getconditiontypes) -- [getConditions](templates.AccessTemplate.md#getconditions) -- [getContract](templates.AccessTemplate.md#getcontract) -- [getFromAddress](templates.AccessTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.AccessTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.AccessTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.AccessTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.AccessTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.AccessTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.AccessTemplate.md#getsignatureofmethod) -- [init](templates.AccessTemplate.md#init) -- [instanceFromDDO](templates.AccessTemplate.md#instancefromddo) -- [lockConditionIndex](templates.AccessTemplate.md#lockconditionindex) -- [lockTokens](templates.AccessTemplate.md#locktokens) -- [name](templates.AccessTemplate.md#name) -- [params](templates.AccessTemplate.md#params) -- [paramsGen](templates.AccessTemplate.md#paramsgen) -- [paymentData](templates.AccessTemplate.md#paymentdata) -- [printAgreementStatus](templates.AccessTemplate.md#printagreementstatus) -- [process](templates.AccessTemplate.md#process) -- [send](templates.AccessTemplate.md#send) -- [sendFrom](templates.AccessTemplate.md#sendfrom) -- [service](templates.AccessTemplate.md#service) -- [serviceEndpoint](templates.AccessTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.AccessTemplate.md#setinstanceconfig) -- [standardContext](templates.AccessTemplate.md#standardcontext) -- [validateAgreement](templates.AccessTemplate.md#validateagreement) -- [addressesStatic](templates.AccessTemplate.md#addressesstatic) -- [findSignerStatic](templates.AccessTemplate.md#findsignerstatic) -- [getInstance](templates.AccessTemplate.md#getinstance) -- [setInstanceConfig](templates.AccessTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new AccessTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :------- | :----------------- | -| `params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L112) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`AccessCondition`](conditions.AccessCondition.md), [`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Returns - -[[`AccessCondition`](conditions.AccessCondition.md), [`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:62](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L62) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `AccessTemplateParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `AccessTemplateParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`ServiceAccess`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`ServiceAccess`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L35) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :--------------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `AccessTemplateParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:46](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L46) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AccessTemplateParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :--------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `AccessTemplateParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`AccessTemplateParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:68](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L68) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L32) - ---- - -### params - -▸ **params**(`consumer`, `serviceType?`): `AccessTemplateParams` - -#### Parameters - -| Name | Type | Default value | -| :------------ | :---------------------- | :------------ | -| `consumer` | [`Account`](Account.md) | `undefined` | -| `serviceType` | `ServiceType` | `'access'` | - -#### Returns - -`AccessTemplateParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L50) - ---- - -### paramsGen - -▸ **paramsGen**(`__namedParameters`): `Promise`<`AccessTemplateParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------------------ | :----------------- | :----------------- | -| `__namedParameters` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`AccessTemplateParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:22](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L22) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L42) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `AccessTemplateParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`AccessTemplate`](templates.AccessTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`AccessTemplate`](templates.AccessTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/AccessTemplate.ts:38](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AccessTemplate.ts#L38) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.BaseTemplate.md b/docs/api-reference/classes/templates.BaseTemplate.md deleted file mode 100644 index 39ee460aa..000000000 --- a/docs/api-reference/classes/templates.BaseTemplate.md +++ /dev/null @@ -1,1594 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / BaseTemplate - -# Class: BaseTemplate - -[templates](../modules/templates.md).BaseTemplate - -## Type parameters - -| Name | Type | -| :------- | :---------------- | -| `Params` | `Params` | -| `S` | extends `Service` | - -## Hierarchy - -- [`AgreementTemplate`](AgreementTemplate.md)<`Params`\> - - ↳ **`BaseTemplate`** - - ↳↳ [`AccessTemplate`](templates.AccessTemplate.md) - - ↳↳ [`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md) - - ↳↳ [`DIDSalesTemplate`](templates.DIDSalesTemplate.md) - - ↳↳ [`NFTAccessTemplate`](templates.NFTAccessTemplate.md) - - ↳↳ [`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md) - - ↳↳ [`NFTSalesTemplate`](templates.NFTSalesTemplate.md) - - ↳↳ [`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md) - - ↳↳ [`AaveCreditTemplate`](templates.AaveCreditTemplate.md) - -## Implements - -- `ServicePlugin`<`S`\> - -## Table of contents - -### Constructors - -- [constructor](templates.BaseTemplate.md#constructor) - -### Properties - -- [contract](templates.BaseTemplate.md#contract) -- [contractName](templates.BaseTemplate.md#contractname) -- [events](templates.BaseTemplate.md#events) -- [version](templates.BaseTemplate.md#version) - -### Accessors - -- [address](templates.BaseTemplate.md#address) -- [artifactsFolder](templates.BaseTemplate.md#artifactsfolder) -- [config](templates.BaseTemplate.md#config) -- [instanceConfig](templates.BaseTemplate.md#instanceconfig) -- [instantiableConfig](templates.BaseTemplate.md#instantiableconfig) -- [logger](templates.BaseTemplate.md#logger) -- [nevermined](templates.BaseTemplate.md#nevermined) -- [web3](templates.BaseTemplate.md#web3) - -### Methods - -- [accept](templates.BaseTemplate.md#accept) -- [addresses](templates.BaseTemplate.md#addresses) -- [agreementId](templates.BaseTemplate.md#agreementid) -- [call](templates.BaseTemplate.md#call) -- [checkExists](templates.BaseTemplate.md#checkexists) -- [conditions](templates.BaseTemplate.md#conditions) -- [createAgreement](templates.BaseTemplate.md#createagreement) -- [createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.BaseTemplate.md#createservice) -- [description](templates.BaseTemplate.md#description) -- [extraGen](templates.BaseTemplate.md#extragen) -- [findSigner](templates.BaseTemplate.md#findsigner) -- [getAddress](templates.BaseTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.BaseTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.BaseTemplate.md#getconditiontypes) -- [getConditions](templates.BaseTemplate.md#getconditions) -- [getContract](templates.BaseTemplate.md#getcontract) -- [getFromAddress](templates.BaseTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) -- [getPriced](templates.BaseTemplate.md#getpriced) -- [getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) -- [init](templates.BaseTemplate.md#init) -- [instanceFromDDO](templates.BaseTemplate.md#instancefromddo) -- [lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) -- [lockTokens](templates.BaseTemplate.md#locktokens) -- [name](templates.BaseTemplate.md#name) -- [params](templates.BaseTemplate.md#params) -- [paramsGen](templates.BaseTemplate.md#paramsgen) -- [paymentData](templates.BaseTemplate.md#paymentdata) -- [printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) -- [process](templates.BaseTemplate.md#process) -- [send](templates.BaseTemplate.md#send) -- [sendFrom](templates.BaseTemplate.md#sendfrom) -- [service](templates.BaseTemplate.md#service) -- [serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) -- [standardContext](templates.BaseTemplate.md#standardcontext) -- [validateAgreement](templates.BaseTemplate.md#validateagreement) -- [addressesStatic](templates.BaseTemplate.md#addressesstatic) -- [findSignerStatic](templates.BaseTemplate.md#findsignerstatic) -- [getInstance](templates.BaseTemplate.md#getinstance) -- [setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new BaseTemplate**<`Params`, `S`\>(`contractName`) - -#### Type parameters - -| Name | Type | -| :------- | :---------------------- | -| `Params` | `Params` | -| `S` | extends `ServiceCommon` | - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[constructor](AgreementTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[contract](AgreementTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[contractName](AgreementTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[events](AgreementTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[version](AgreementTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -AgreementTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -AgreementTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -AgreementTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -AgreementTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -AgreementTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -AgreementTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -AgreementTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -AgreementTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`_params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Implementation of - -ServicePlugin.accept - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L112) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[addresses](AgreementTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[agreementId](AgreementTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[call](AgreementTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[checkExists](AgreementTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ `Abstract` **conditions**(): [`Condition`](Condition.md)<`any`, `any`\>[] - -#### Returns - -[`Condition`](Condition.md)<`any`, `any`\>[] - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L29) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[createAgreement](AgreementTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[createAgreementAndPay](AgreementTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `Params` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[createAgreementFromDDO](AgreementTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `Params` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[createAgreementWithPaymentFromDDO](AgreementTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`S`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`S`\> - -#### Implementation of - -ServicePlugin.createService - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ `Abstract` **description**(): `string` - -#### Returns - -`string` - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L28) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[findSigner](AgreementTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getAddress](AgreementTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getAgreementCreatedEvent](AgreementTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :-------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `Params` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getAgreementIdsFromDDO](AgreementTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getAgreementStatus](AgreementTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getAgreementsForDID](AgreementTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getConditionTypes](AgreementTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getConditions](AgreementTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getContract](AgreementTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getFromAddress](AgreementTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getInputsOfMethod](AgreementTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getPriced - -▸ `Private` **getPriced**(`assetPrice`, `erc20TokenAddress`): `Promise`<`Priced`\> - -#### Parameters - -| Name | Type | -| :------------------ | :-------- | -| `assetPrice` | `default` | -| `erc20TokenAddress` | `string` | - -#### Returns - -`Promise`<`Priced`\> - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L35) - ---- - -### getServiceAgreementTemplate - -▸ `Abstract` **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplate](AgreementTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:317](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L317) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplateConditionByRef](AgreementTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplateConditions](AgreementTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getServiceAgreementTemplateDependencies](AgreementTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getSignatureOfMethod](AgreementTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[init](AgreementTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ `Optional` `Abstract` **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`Params`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :-------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `Params` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`Params`\>\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[instanceFromDDO](AgreementTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:198](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L198) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[lockConditionIndex](AgreementTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[lockTokens](AgreementTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ `Abstract` **name**(): `string` - -#### Returns - -`string` - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:27](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L27) - ---- - -### params - -▸ `Abstract` **params**(...`args`): `Params` - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`Params` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[params](AgreementTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:79](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L79) - ---- - -### paramsGen - -▸ `Abstract` **paramsGen**(`params`): `Promise`<`Params`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------- | :----------------- | :----------------- | -| `params` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`Params`\> - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:106](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L106) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[paymentData](AgreementTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[printAgreementStatus](AgreementTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -ServicePlugin.process - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[send](AgreementTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[sendFrom](AgreementTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ `Abstract` **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[service](AgreementTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:205](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L205) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[setInstanceConfig](AgreementTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[standardContext](AgreementTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `Params` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[addressesStatic](AgreementTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[findSignerStatic](AgreementTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**<`Params`\>(`config`, `templateContractName`, `templateClass`, `optional?`): `Promise`<`any`\> - -#### Type parameters - -| Name | -| :------- | -| `Params` | - -#### Parameters - -| Name | Type | Default value | -| :--------------------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `templateContractName` | `string` | `undefined` | -| `templateClass` | `any` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[getInstance](AgreementTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:62](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L62) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[AgreementTemplate](AgreementTemplate.md).[setInstanceConfig](AgreementTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.DIDSalesTemplate.md b/docs/api-reference/classes/templates.DIDSalesTemplate.md deleted file mode 100644 index 1738260d2..000000000 --- a/docs/api-reference/classes/templates.DIDSalesTemplate.md +++ /dev/null @@ -1,1561 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / DIDSalesTemplate - -# Class: DIDSalesTemplate - -[templates](../modules/templates.md).DIDSalesTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`DIDSalesTemplateParams`, `any`\> - - ↳ **`DIDSalesTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.DIDSalesTemplate.md#constructor) - -### Properties - -- [contract](templates.DIDSalesTemplate.md#contract) -- [contractName](templates.DIDSalesTemplate.md#contractname) -- [events](templates.DIDSalesTemplate.md#events) -- [version](templates.DIDSalesTemplate.md#version) - -### Accessors - -- [address](templates.DIDSalesTemplate.md#address) -- [artifactsFolder](templates.DIDSalesTemplate.md#artifactsfolder) -- [config](templates.DIDSalesTemplate.md#config) -- [instanceConfig](templates.DIDSalesTemplate.md#instanceconfig) -- [instantiableConfig](templates.DIDSalesTemplate.md#instantiableconfig) -- [logger](templates.DIDSalesTemplate.md#logger) -- [nevermined](templates.DIDSalesTemplate.md#nevermined) -- [web3](templates.DIDSalesTemplate.md#web3) - -### Methods - -- [accept](templates.DIDSalesTemplate.md#accept) -- [addresses](templates.DIDSalesTemplate.md#addresses) -- [agreementId](templates.DIDSalesTemplate.md#agreementid) -- [call](templates.DIDSalesTemplate.md#call) -- [checkExists](templates.DIDSalesTemplate.md#checkexists) -- [conditions](templates.DIDSalesTemplate.md#conditions) -- [createAgreement](templates.DIDSalesTemplate.md#createagreement) -- [createAgreementAndPay](templates.DIDSalesTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.DIDSalesTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.DIDSalesTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.DIDSalesTemplate.md#createservice) -- [description](templates.DIDSalesTemplate.md#description) -- [extraGen](templates.DIDSalesTemplate.md#extragen) -- [findSigner](templates.DIDSalesTemplate.md#findsigner) -- [getAddress](templates.DIDSalesTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.DIDSalesTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.DIDSalesTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.DIDSalesTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.DIDSalesTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.DIDSalesTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.DIDSalesTemplate.md#getconditiontypes) -- [getConditions](templates.DIDSalesTemplate.md#getconditions) -- [getContract](templates.DIDSalesTemplate.md#getcontract) -- [getFromAddress](templates.DIDSalesTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.DIDSalesTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.DIDSalesTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.DIDSalesTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.DIDSalesTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.DIDSalesTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.DIDSalesTemplate.md#getsignatureofmethod) -- [init](templates.DIDSalesTemplate.md#init) -- [instanceFromDDO](templates.DIDSalesTemplate.md#instancefromddo) -- [lockConditionIndex](templates.DIDSalesTemplate.md#lockconditionindex) -- [lockTokens](templates.DIDSalesTemplate.md#locktokens) -- [name](templates.DIDSalesTemplate.md#name) -- [params](templates.DIDSalesTemplate.md#params) -- [paramsGen](templates.DIDSalesTemplate.md#paramsgen) -- [paymentData](templates.DIDSalesTemplate.md#paymentdata) -- [printAgreementStatus](templates.DIDSalesTemplate.md#printagreementstatus) -- [process](templates.DIDSalesTemplate.md#process) -- [send](templates.DIDSalesTemplate.md#send) -- [sendFrom](templates.DIDSalesTemplate.md#sendfrom) -- [service](templates.DIDSalesTemplate.md#service) -- [serviceEndpoint](templates.DIDSalesTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.DIDSalesTemplate.md#setinstanceconfig) -- [standardContext](templates.DIDSalesTemplate.md#standardcontext) -- [validateAgreement](templates.DIDSalesTemplate.md#validateagreement) -- [addressesStatic](templates.DIDSalesTemplate.md#addressesstatic) -- [findSignerStatic](templates.DIDSalesTemplate.md#findsignerstatic) -- [getInstance](templates.DIDSalesTemplate.md#getinstance) -- [setInstanceConfig](templates.DIDSalesTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new DIDSalesTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`_params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L112) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`TransferDIDOwnershipCondition`](conditions.TransferDIDOwnershipCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Returns - -[[`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`TransferDIDOwnershipCondition`](conditions.TransferDIDOwnershipCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L33) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :----------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `DIDSalesTemplateParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `DIDSalesTemplateParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L29) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :----------------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `DIDSalesTemplateParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L105) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`DIDSalesTemplateParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :----------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `DIDSalesTemplateParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`DIDSalesTemplateParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L50) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L26) - ---- - -### params - -▸ **params**(`receiverId`): `DIDSalesTemplateParams` - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `receiverId` | `string` | - -#### Returns - -`DIDSalesTemplateParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L23) - ---- - -### paramsGen - -▸ **paramsGen**(`params`): `Promise`<`DIDSalesTemplateParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------- | :----------------- | :----------------- | -| `params` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`DIDSalesTemplateParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L20) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L96) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :----------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `DIDSalesTemplateParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`DIDSalesTemplate`](templates.DIDSalesTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`DIDSalesTemplate`](templates.DIDSalesTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/DIDSalesTemplate.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/DIDSalesTemplate.ts#L99) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.EscrowComputeExecutionTemplate.md b/docs/api-reference/classes/templates.EscrowComputeExecutionTemplate.md deleted file mode 100644 index 55840a4ad..000000000 --- a/docs/api-reference/classes/templates.EscrowComputeExecutionTemplate.md +++ /dev/null @@ -1,1576 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / EscrowComputeExecutionTemplate - -# Class: EscrowComputeExecutionTemplate - -[templates](../modules/templates.md).EscrowComputeExecutionTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`EscrowComputeExecutionParams`, `ServiceCompute`\> - - ↳ **`EscrowComputeExecutionTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.EscrowComputeExecutionTemplate.md#constructor) - -### Properties - -- [contract](templates.EscrowComputeExecutionTemplate.md#contract) -- [contractName](templates.EscrowComputeExecutionTemplate.md#contractname) -- [events](templates.EscrowComputeExecutionTemplate.md#events) -- [version](templates.EscrowComputeExecutionTemplate.md#version) - -### Accessors - -- [address](templates.EscrowComputeExecutionTemplate.md#address) -- [artifactsFolder](templates.EscrowComputeExecutionTemplate.md#artifactsfolder) -- [config](templates.EscrowComputeExecutionTemplate.md#config) -- [instanceConfig](templates.EscrowComputeExecutionTemplate.md#instanceconfig) -- [instantiableConfig](templates.EscrowComputeExecutionTemplate.md#instantiableconfig) -- [logger](templates.EscrowComputeExecutionTemplate.md#logger) -- [nevermined](templates.EscrowComputeExecutionTemplate.md#nevermined) -- [web3](templates.EscrowComputeExecutionTemplate.md#web3) - -### Methods - -- [accept](templates.EscrowComputeExecutionTemplate.md#accept) -- [addresses](templates.EscrowComputeExecutionTemplate.md#addresses) -- [agreementId](templates.EscrowComputeExecutionTemplate.md#agreementid) -- [call](templates.EscrowComputeExecutionTemplate.md#call) -- [checkExists](templates.EscrowComputeExecutionTemplate.md#checkexists) -- [conditions](templates.EscrowComputeExecutionTemplate.md#conditions) -- [createAgreement](templates.EscrowComputeExecutionTemplate.md#createagreement) -- [createAgreementAndPay](templates.EscrowComputeExecutionTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.EscrowComputeExecutionTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.EscrowComputeExecutionTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.EscrowComputeExecutionTemplate.md#createservice) -- [description](templates.EscrowComputeExecutionTemplate.md#description) -- [extraGen](templates.EscrowComputeExecutionTemplate.md#extragen) -- [findSigner](templates.EscrowComputeExecutionTemplate.md#findsigner) -- [getAddress](templates.EscrowComputeExecutionTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.EscrowComputeExecutionTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.EscrowComputeExecutionTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.EscrowComputeExecutionTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.EscrowComputeExecutionTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.EscrowComputeExecutionTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.EscrowComputeExecutionTemplate.md#getconditiontypes) -- [getConditions](templates.EscrowComputeExecutionTemplate.md#getconditions) -- [getContract](templates.EscrowComputeExecutionTemplate.md#getcontract) -- [getFromAddress](templates.EscrowComputeExecutionTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.EscrowComputeExecutionTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.EscrowComputeExecutionTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.EscrowComputeExecutionTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.EscrowComputeExecutionTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.EscrowComputeExecutionTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.EscrowComputeExecutionTemplate.md#getsignatureofmethod) -- [init](templates.EscrowComputeExecutionTemplate.md#init) -- [instanceFromDDO](templates.EscrowComputeExecutionTemplate.md#instancefromddo) -- [lockConditionIndex](templates.EscrowComputeExecutionTemplate.md#lockconditionindex) -- [lockTokens](templates.EscrowComputeExecutionTemplate.md#locktokens) -- [name](templates.EscrowComputeExecutionTemplate.md#name) -- [params](templates.EscrowComputeExecutionTemplate.md#params) -- [paramsGen](templates.EscrowComputeExecutionTemplate.md#paramsgen) -- [paymentData](templates.EscrowComputeExecutionTemplate.md#paymentdata) -- [printAgreementStatus](templates.EscrowComputeExecutionTemplate.md#printagreementstatus) -- [process](templates.EscrowComputeExecutionTemplate.md#process) -- [providerConfig](templates.EscrowComputeExecutionTemplate.md#providerconfig) -- [send](templates.EscrowComputeExecutionTemplate.md#send) -- [sendFrom](templates.EscrowComputeExecutionTemplate.md#sendfrom) -- [service](templates.EscrowComputeExecutionTemplate.md#service) -- [serviceEndpoint](templates.EscrowComputeExecutionTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.EscrowComputeExecutionTemplate.md#setinstanceconfig) -- [standardContext](templates.EscrowComputeExecutionTemplate.md#standardcontext) -- [validateAgreement](templates.EscrowComputeExecutionTemplate.md#validateagreement) -- [addressesStatic](templates.EscrowComputeExecutionTemplate.md#addressesstatic) -- [findSignerStatic](templates.EscrowComputeExecutionTemplate.md#findsignerstatic) -- [getInstance](templates.EscrowComputeExecutionTemplate.md#getinstance) -- [setInstanceConfig](templates.EscrowComputeExecutionTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new EscrowComputeExecutionTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`_params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L112) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`ComputeExecutionCondition`](conditions.ComputeExecutionCondition.md), [`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Returns - -[[`ComputeExecutionCondition`](conditions.ComputeExecutionCondition.md), [`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:107](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L107) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :----------------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `EscrowComputeExecutionParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `EscrowComputeExecutionParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`ServiceCompute`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`ServiceCompute`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L42) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :----------------------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `EscrowComputeExecutionParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:95](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L95) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`EscrowComputeExecutionParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :----------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `EscrowComputeExecutionParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`EscrowComputeExecutionParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:120](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L120) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:39](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L39) - ---- - -### params - -▸ **params**(`consumer`): `EscrowComputeExecutionParams` - -#### Parameters - -| Name | Type | -| :--------- | :---------------------- | -| `consumer` | [`Account`](Account.md) | - -#### Returns - -`EscrowComputeExecutionParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:103](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L103) - ---- - -### paramsGen - -▸ **paramsGen**(`params`): `Promise`<`EscrowComputeExecutionParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------- | :----------------- | :----------------- | -| `params` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`EscrowComputeExecutionParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L23) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### providerConfig - -▸ **providerConfig**(): `Promise`<{ `description`: `string` = ''; `environment`: { `cluster`: { `type`: `string` = 'Kubernetes'; `url`: `string` = 'http://10.0.0.17/xxx' } ; `supportedContainers`: { `checksum`: `string` = 'sha256:cb57ecfa6ebbefd8ffc7f75c0f00e57a7fa739578a429b6f72a0df19315deadc'; `image`: `string` = 'tensorflow/tensorflow'; `tag`: `string` = 'latest' }[] ; `supportedServers`: { `cpu`: `string` = '16'; `disk`: `string` = '160gb'; `gpu`: `string` = '0'; `maxExecutionTime`: `number` = 86400; `memory`: `string` = '128gb'; `price`: `string` = '50'; `serverId`: `string` = '1'; `serverType`: `string` = 'xlsize' }[] } ; `type`: `string` = 'Azure' }\> - -#### Returns - -`Promise`<{ `description`: `string` = ''; `environment`: { `cluster`: { `type`: `string` = 'Kubernetes'; `url`: `string` = 'http://10.0.0.17/xxx' } ; `supportedContainers`: { `checksum`: `string` = 'sha256:cb57ecfa6ebbefd8ffc7f75c0f00e57a7fa739578a429b6f72a0df19315deadc'; `image`: `string` = 'tensorflow/tensorflow'; `tag`: `string` = 'latest' }[] ; `supportedServers`: { `cpu`: `string` = '16'; `disk`: `string` = '160gb'; `gpu`: `string` = '0'; `maxExecutionTime`: `number` = 86400; `memory`: `string` = '128gb'; `price`: `string` = '50'; `serverId`: `string` = '1'; `serverType`: `string` = 'xlsize' }[] } ; `type`: `string` = 'Azure' }\> - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:46](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L46) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L99) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `EscrowComputeExecutionParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`EscrowComputeExecutionTemplate`](templates.EscrowComputeExecutionTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts#L30) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.NFT721AccessTemplate.md b/docs/api-reference/classes/templates.NFT721AccessTemplate.md deleted file mode 100644 index 07d12efba..000000000 --- a/docs/api-reference/classes/templates.NFT721AccessTemplate.md +++ /dev/null @@ -1,1561 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / NFT721AccessTemplate - -# Class: NFT721AccessTemplate - -[templates](../modules/templates.md).NFT721AccessTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`NFT721AccessTemplateParams`, `ServiceNFTAccess`\> - - ↳ **`NFT721AccessTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.NFT721AccessTemplate.md#constructor) - -### Properties - -- [contract](templates.NFT721AccessTemplate.md#contract) -- [contractName](templates.NFT721AccessTemplate.md#contractname) -- [events](templates.NFT721AccessTemplate.md#events) -- [version](templates.NFT721AccessTemplate.md#version) - -### Accessors - -- [address](templates.NFT721AccessTemplate.md#address) -- [artifactsFolder](templates.NFT721AccessTemplate.md#artifactsfolder) -- [config](templates.NFT721AccessTemplate.md#config) -- [instanceConfig](templates.NFT721AccessTemplate.md#instanceconfig) -- [instantiableConfig](templates.NFT721AccessTemplate.md#instantiableconfig) -- [logger](templates.NFT721AccessTemplate.md#logger) -- [nevermined](templates.NFT721AccessTemplate.md#nevermined) -- [web3](templates.NFT721AccessTemplate.md#web3) - -### Methods - -- [accept](templates.NFT721AccessTemplate.md#accept) -- [addresses](templates.NFT721AccessTemplate.md#addresses) -- [agreementId](templates.NFT721AccessTemplate.md#agreementid) -- [call](templates.NFT721AccessTemplate.md#call) -- [checkExists](templates.NFT721AccessTemplate.md#checkexists) -- [conditions](templates.NFT721AccessTemplate.md#conditions) -- [createAgreement](templates.NFT721AccessTemplate.md#createagreement) -- [createAgreementAndPay](templates.NFT721AccessTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.NFT721AccessTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.NFT721AccessTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.NFT721AccessTemplate.md#createservice) -- [description](templates.NFT721AccessTemplate.md#description) -- [extraGen](templates.NFT721AccessTemplate.md#extragen) -- [findSigner](templates.NFT721AccessTemplate.md#findsigner) -- [getAddress](templates.NFT721AccessTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.NFT721AccessTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.NFT721AccessTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.NFT721AccessTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.NFT721AccessTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.NFT721AccessTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.NFT721AccessTemplate.md#getconditiontypes) -- [getConditions](templates.NFT721AccessTemplate.md#getconditions) -- [getContract](templates.NFT721AccessTemplate.md#getcontract) -- [getFromAddress](templates.NFT721AccessTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.NFT721AccessTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.NFT721AccessTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.NFT721AccessTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.NFT721AccessTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.NFT721AccessTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.NFT721AccessTemplate.md#getsignatureofmethod) -- [init](templates.NFT721AccessTemplate.md#init) -- [instanceFromDDO](templates.NFT721AccessTemplate.md#instancefromddo) -- [lockConditionIndex](templates.NFT721AccessTemplate.md#lockconditionindex) -- [lockTokens](templates.NFT721AccessTemplate.md#locktokens) -- [name](templates.NFT721AccessTemplate.md#name) -- [params](templates.NFT721AccessTemplate.md#params) -- [paramsGen](templates.NFT721AccessTemplate.md#paramsgen) -- [paymentData](templates.NFT721AccessTemplate.md#paymentdata) -- [printAgreementStatus](templates.NFT721AccessTemplate.md#printagreementstatus) -- [process](templates.NFT721AccessTemplate.md#process) -- [send](templates.NFT721AccessTemplate.md#send) -- [sendFrom](templates.NFT721AccessTemplate.md#sendfrom) -- [service](templates.NFT721AccessTemplate.md#service) -- [serviceEndpoint](templates.NFT721AccessTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.NFT721AccessTemplate.md#setinstanceconfig) -- [standardContext](templates.NFT721AccessTemplate.md#standardcontext) -- [validateAgreement](templates.NFT721AccessTemplate.md#validateagreement) -- [addressesStatic](templates.NFT721AccessTemplate.md#addressesstatic) -- [findSignerStatic](templates.NFT721AccessTemplate.md#findsignerstatic) -- [getInstance](templates.NFT721AccessTemplate.md#getinstance) -- [setInstanceConfig](templates.NFT721AccessTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new NFT721AccessTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :------- | :----------------- | -| `params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:93](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L93) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`NFT721HolderCondition`](conditions.NFT721HolderCondition.md), [`NFTAccessCondition`](conditions.NFTAccessCondition.md)] - -#### Returns - -[[`NFT721HolderCondition`](conditions.NFT721HolderCondition.md), [`NFTAccessCondition`](conditions.NFTAccessCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L52) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :--------------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `NFT721AccessTemplateParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `NFT721AccessTemplateParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`ServiceNFTAccess`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`ServiceNFTAccess`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L37) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :--------------------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `NFT721AccessTemplateParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:89](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L89) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFT721AccessTemplateParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :--------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `NFT721AccessTemplateParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFT721AccessTemplateParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:58](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L58) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:34](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L34) - ---- - -### params - -▸ **params**(`holderAddress`): `NFT721AccessTemplateParams` - -#### Parameters - -| Name | Type | -| :-------------- | :------- | -| `holderAddress` | `string` | - -#### Returns - -`NFT721AccessTemplateParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:48](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L48) - ---- - -### paramsGen - -▸ **paramsGen**(`__namedParameters`): `Promise`<`NFT721AccessTemplateParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------------------ | :----------------- | :----------------- | -| `__namedParameters` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`NFT721AccessTemplateParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L19) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L41) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L44) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :--------------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `NFT721AccessTemplateParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFT721AccessTemplate`](templates.NFT721AccessTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/NFT721AccessTemplate.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721AccessTemplate.ts#L24) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.NFT721SalesTemplate.md b/docs/api-reference/classes/templates.NFT721SalesTemplate.md deleted file mode 100644 index 08bf325f8..000000000 --- a/docs/api-reference/classes/templates.NFT721SalesTemplate.md +++ /dev/null @@ -1,1562 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / NFT721SalesTemplate - -# Class: NFT721SalesTemplate - -[templates](../modules/templates.md).NFT721SalesTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`NFT721SalesTemplateParams`, `ServiceNFTSales`\> - - ↳ **`NFT721SalesTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.NFT721SalesTemplate.md#constructor) - -### Properties - -- [contract](templates.NFT721SalesTemplate.md#contract) -- [contractName](templates.NFT721SalesTemplate.md#contractname) -- [events](templates.NFT721SalesTemplate.md#events) -- [version](templates.NFT721SalesTemplate.md#version) - -### Accessors - -- [address](templates.NFT721SalesTemplate.md#address) -- [artifactsFolder](templates.NFT721SalesTemplate.md#artifactsfolder) -- [config](templates.NFT721SalesTemplate.md#config) -- [instanceConfig](templates.NFT721SalesTemplate.md#instanceconfig) -- [instantiableConfig](templates.NFT721SalesTemplate.md#instantiableconfig) -- [logger](templates.NFT721SalesTemplate.md#logger) -- [nevermined](templates.NFT721SalesTemplate.md#nevermined) -- [web3](templates.NFT721SalesTemplate.md#web3) - -### Methods - -- [accept](templates.NFT721SalesTemplate.md#accept) -- [addresses](templates.NFT721SalesTemplate.md#addresses) -- [agreementId](templates.NFT721SalesTemplate.md#agreementid) -- [call](templates.NFT721SalesTemplate.md#call) -- [checkExists](templates.NFT721SalesTemplate.md#checkexists) -- [conditions](templates.NFT721SalesTemplate.md#conditions) -- [createAgreement](templates.NFT721SalesTemplate.md#createagreement) -- [createAgreementAndPay](templates.NFT721SalesTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.NFT721SalesTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.NFT721SalesTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.NFT721SalesTemplate.md#createservice) -- [description](templates.NFT721SalesTemplate.md#description) -- [extraGen](templates.NFT721SalesTemplate.md#extragen) -- [findSigner](templates.NFT721SalesTemplate.md#findsigner) -- [getAddress](templates.NFT721SalesTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.NFT721SalesTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.NFT721SalesTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.NFT721SalesTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.NFT721SalesTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.NFT721SalesTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.NFT721SalesTemplate.md#getconditiontypes) -- [getConditions](templates.NFT721SalesTemplate.md#getconditions) -- [getContract](templates.NFT721SalesTemplate.md#getcontract) -- [getFromAddress](templates.NFT721SalesTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.NFT721SalesTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.NFT721SalesTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.NFT721SalesTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.NFT721SalesTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.NFT721SalesTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.NFT721SalesTemplate.md#getsignatureofmethod) -- [init](templates.NFT721SalesTemplate.md#init) -- [instanceFromDDO](templates.NFT721SalesTemplate.md#instancefromddo) -- [lockConditionIndex](templates.NFT721SalesTemplate.md#lockconditionindex) -- [lockTokens](templates.NFT721SalesTemplate.md#locktokens) -- [name](templates.NFT721SalesTemplate.md#name) -- [params](templates.NFT721SalesTemplate.md#params) -- [paramsGen](templates.NFT721SalesTemplate.md#paramsgen) -- [paymentData](templates.NFT721SalesTemplate.md#paymentdata) -- [printAgreementStatus](templates.NFT721SalesTemplate.md#printagreementstatus) -- [process](templates.NFT721SalesTemplate.md#process) -- [send](templates.NFT721SalesTemplate.md#send) -- [sendFrom](templates.NFT721SalesTemplate.md#sendfrom) -- [service](templates.NFT721SalesTemplate.md#service) -- [serviceEndpoint](templates.NFT721SalesTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.NFT721SalesTemplate.md#setinstanceconfig) -- [standardContext](templates.NFT721SalesTemplate.md#standardcontext) -- [validateAgreement](templates.NFT721SalesTemplate.md#validateagreement) -- [addressesStatic](templates.NFT721SalesTemplate.md#addressesstatic) -- [findSignerStatic](templates.NFT721SalesTemplate.md#findsignerstatic) -- [getInstance](templates.NFT721SalesTemplate.md#getinstance) -- [setInstanceConfig](templates.NFT721SalesTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new NFT721SalesTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`_params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L112) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`TransferNFT721Condition`](conditions.TransferNFT721Condition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Returns - -[[`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`TransferNFT721Condition`](conditions.TransferNFT721Condition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:61](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L61) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :-------------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `NFT721SalesTemplateParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `NFT721SalesTemplateParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`ServiceNFTSales`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`ServiceNFTSales`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L44) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :-------------------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `NFT721SalesTemplateParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:114](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L114) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFT721SalesTemplateParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :-------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `NFT721SalesTemplateParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFT721SalesTemplateParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:71](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L71) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:57](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L57) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L41) - ---- - -### params - -▸ **params**(`consumerId`, `expiration?`): `NFT721SalesTemplateParams` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `consumerId` | `string` | `undefined` | -| `expiration` | `number` | `0` | - -#### Returns - -`NFT721SalesTemplateParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:48](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L48) - ---- - -### paramsGen - -▸ **paramsGen**(`__namedParameters`): `Promise`<`NFT721SalesTemplateParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------------------ | :----------------- | :----------------- | -| `__namedParameters` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`NFT721SalesTemplateParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:51](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L51) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:34](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L34) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L37) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :-------------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `NFT721SalesTemplateParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFT721SalesTemplate`](templates.NFT721SalesTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/NFT721SalesTemplate.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFT721SalesTemplate.ts#L23) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.NFTAccessTemplate.md b/docs/api-reference/classes/templates.NFTAccessTemplate.md deleted file mode 100644 index 718d48c95..000000000 --- a/docs/api-reference/classes/templates.NFTAccessTemplate.md +++ /dev/null @@ -1,1562 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / NFTAccessTemplate - -# Class: NFTAccessTemplate - -[templates](../modules/templates.md).NFTAccessTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`NFTAccessTemplateParams`, `ServiceNFTAccess`\> - - ↳ **`NFTAccessTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.NFTAccessTemplate.md#constructor) - -### Properties - -- [contract](templates.NFTAccessTemplate.md#contract) -- [contractName](templates.NFTAccessTemplate.md#contractname) -- [events](templates.NFTAccessTemplate.md#events) -- [version](templates.NFTAccessTemplate.md#version) - -### Accessors - -- [address](templates.NFTAccessTemplate.md#address) -- [artifactsFolder](templates.NFTAccessTemplate.md#artifactsfolder) -- [config](templates.NFTAccessTemplate.md#config) -- [instanceConfig](templates.NFTAccessTemplate.md#instanceconfig) -- [instantiableConfig](templates.NFTAccessTemplate.md#instantiableconfig) -- [logger](templates.NFTAccessTemplate.md#logger) -- [nevermined](templates.NFTAccessTemplate.md#nevermined) -- [web3](templates.NFTAccessTemplate.md#web3) - -### Methods - -- [accept](templates.NFTAccessTemplate.md#accept) -- [addresses](templates.NFTAccessTemplate.md#addresses) -- [agreementId](templates.NFTAccessTemplate.md#agreementid) -- [call](templates.NFTAccessTemplate.md#call) -- [checkExists](templates.NFTAccessTemplate.md#checkexists) -- [conditions](templates.NFTAccessTemplate.md#conditions) -- [createAgreement](templates.NFTAccessTemplate.md#createagreement) -- [createAgreementAndPay](templates.NFTAccessTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.NFTAccessTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.NFTAccessTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.NFTAccessTemplate.md#createservice) -- [description](templates.NFTAccessTemplate.md#description) -- [extraGen](templates.NFTAccessTemplate.md#extragen) -- [findSigner](templates.NFTAccessTemplate.md#findsigner) -- [getAddress](templates.NFTAccessTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.NFTAccessTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.NFTAccessTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.NFTAccessTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.NFTAccessTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.NFTAccessTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.NFTAccessTemplate.md#getconditiontypes) -- [getConditions](templates.NFTAccessTemplate.md#getconditions) -- [getContract](templates.NFTAccessTemplate.md#getcontract) -- [getFromAddress](templates.NFTAccessTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.NFTAccessTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.NFTAccessTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.NFTAccessTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.NFTAccessTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.NFTAccessTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.NFTAccessTemplate.md#getsignatureofmethod) -- [init](templates.NFTAccessTemplate.md#init) -- [instanceFromDDO](templates.NFTAccessTemplate.md#instancefromddo) -- [lockConditionIndex](templates.NFTAccessTemplate.md#lockconditionindex) -- [lockTokens](templates.NFTAccessTemplate.md#locktokens) -- [name](templates.NFTAccessTemplate.md#name) -- [params](templates.NFTAccessTemplate.md#params) -- [paramsGen](templates.NFTAccessTemplate.md#paramsgen) -- [paymentData](templates.NFTAccessTemplate.md#paymentdata) -- [printAgreementStatus](templates.NFTAccessTemplate.md#printagreementstatus) -- [process](templates.NFTAccessTemplate.md#process) -- [send](templates.NFTAccessTemplate.md#send) -- [sendFrom](templates.NFTAccessTemplate.md#sendfrom) -- [service](templates.NFTAccessTemplate.md#service) -- [serviceEndpoint](templates.NFTAccessTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.NFTAccessTemplate.md#setinstanceconfig) -- [standardContext](templates.NFTAccessTemplate.md#standardcontext) -- [validateAgreement](templates.NFTAccessTemplate.md#validateagreement) -- [addressesStatic](templates.NFTAccessTemplate.md#addressesstatic) -- [findSignerStatic](templates.NFTAccessTemplate.md#findsignerstatic) -- [getInstance](templates.NFTAccessTemplate.md#getinstance) -- [setInstanceConfig](templates.NFTAccessTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new NFTAccessTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :------- | :----------------- | -| `params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:91](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L91) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`NFTHolderCondition`](conditions.NFTHolderCondition.md), [`NFTAccessCondition`](conditions.NFTAccessCondition.md)] - -#### Returns - -[[`NFTHolderCondition`](conditions.NFTHolderCondition.md), [`NFTAccessCondition`](conditions.NFTAccessCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L50) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :------------------------ | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `NFTAccessTemplateParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `NFTAccessTemplateParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`ServiceNFTAccess`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`ServiceNFTAccess`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L37) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------------------------ | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `NFTAccessTemplateParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L87) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFTAccessTemplateParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------ | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `NFTAccessTemplateParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFTAccessTemplateParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:56](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L56) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L81) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:34](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L34) - ---- - -### params - -▸ **params**(`holderAddress`, `amount?`): `NFTAccessTemplateParams` - -#### Parameters - -| Name | Type | -| :-------------- | :-------- | -| `holderAddress` | `string` | -| `amount?` | `default` | - -#### Returns - -`NFTAccessTemplateParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L41) - ---- - -### paramsGen - -▸ **paramsGen**(`__namedParameters`): `Promise`<`NFTAccessTemplateParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------------------ | :----------------- | :----------------- | -| `__namedParameters` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`NFTAccessTemplateParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L44) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L31) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :------------------------ | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `NFTAccessTemplateParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFTAccessTemplate`](templates.NFTAccessTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFTAccessTemplate`](templates.NFTAccessTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/NFTAccessTemplate.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTAccessTemplate.ts#L21) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/templates.NFTSalesTemplate.md b/docs/api-reference/classes/templates.NFTSalesTemplate.md deleted file mode 100644 index c0a3732a7..000000000 --- a/docs/api-reference/classes/templates.NFTSalesTemplate.md +++ /dev/null @@ -1,1563 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / NFTSalesTemplate - -# Class: NFTSalesTemplate - -[templates](../modules/templates.md).NFTSalesTemplate - -## Hierarchy - -- [`BaseTemplate`](templates.BaseTemplate.md)<`NFTSalesTemplateParams`, `ServiceNFTSales`\> - - ↳ **`NFTSalesTemplate`** - -## Table of contents - -### Constructors - -- [constructor](templates.NFTSalesTemplate.md#constructor) - -### Properties - -- [contract](templates.NFTSalesTemplate.md#contract) -- [contractName](templates.NFTSalesTemplate.md#contractname) -- [events](templates.NFTSalesTemplate.md#events) -- [version](templates.NFTSalesTemplate.md#version) - -### Accessors - -- [address](templates.NFTSalesTemplate.md#address) -- [artifactsFolder](templates.NFTSalesTemplate.md#artifactsfolder) -- [config](templates.NFTSalesTemplate.md#config) -- [instanceConfig](templates.NFTSalesTemplate.md#instanceconfig) -- [instantiableConfig](templates.NFTSalesTemplate.md#instantiableconfig) -- [logger](templates.NFTSalesTemplate.md#logger) -- [nevermined](templates.NFTSalesTemplate.md#nevermined) -- [web3](templates.NFTSalesTemplate.md#web3) - -### Methods - -- [accept](templates.NFTSalesTemplate.md#accept) -- [addresses](templates.NFTSalesTemplate.md#addresses) -- [agreementId](templates.NFTSalesTemplate.md#agreementid) -- [call](templates.NFTSalesTemplate.md#call) -- [checkExists](templates.NFTSalesTemplate.md#checkexists) -- [conditions](templates.NFTSalesTemplate.md#conditions) -- [createAgreement](templates.NFTSalesTemplate.md#createagreement) -- [createAgreementAndPay](templates.NFTSalesTemplate.md#createagreementandpay) -- [createAgreementFromDDO](templates.NFTSalesTemplate.md#createagreementfromddo) -- [createAgreementWithPaymentFromDDO](templates.NFTSalesTemplate.md#createagreementwithpaymentfromddo) -- [createService](templates.NFTSalesTemplate.md#createservice) -- [description](templates.NFTSalesTemplate.md#description) -- [extraGen](templates.NFTSalesTemplate.md#extragen) -- [findSigner](templates.NFTSalesTemplate.md#findsigner) -- [getAddress](templates.NFTSalesTemplate.md#getaddress) -- [getAgreementCreatedEvent](templates.NFTSalesTemplate.md#getagreementcreatedevent) -- [getAgreementData](templates.NFTSalesTemplate.md#getagreementdata) -- [getAgreementIdsFromDDO](templates.NFTSalesTemplate.md#getagreementidsfromddo) -- [getAgreementStatus](templates.NFTSalesTemplate.md#getagreementstatus) -- [getAgreementsForDID](templates.NFTSalesTemplate.md#getagreementsfordid) -- [getConditionTypes](templates.NFTSalesTemplate.md#getconditiontypes) -- [getConditions](templates.NFTSalesTemplate.md#getconditions) -- [getContract](templates.NFTSalesTemplate.md#getcontract) -- [getFromAddress](templates.NFTSalesTemplate.md#getfromaddress) -- [getInputsOfMethod](templates.NFTSalesTemplate.md#getinputsofmethod) -- [getServiceAgreementTemplate](templates.NFTSalesTemplate.md#getserviceagreementtemplate) -- [getServiceAgreementTemplateConditionByRef](templates.NFTSalesTemplate.md#getserviceagreementtemplateconditionbyref) -- [getServiceAgreementTemplateConditions](templates.NFTSalesTemplate.md#getserviceagreementtemplateconditions) -- [getServiceAgreementTemplateDependencies](templates.NFTSalesTemplate.md#getserviceagreementtemplatedependencies) -- [getSignatureOfMethod](templates.NFTSalesTemplate.md#getsignatureofmethod) -- [init](templates.NFTSalesTemplate.md#init) -- [instanceFromDDO](templates.NFTSalesTemplate.md#instancefromddo) -- [lockConditionIndex](templates.NFTSalesTemplate.md#lockconditionindex) -- [lockTokens](templates.NFTSalesTemplate.md#locktokens) -- [name](templates.NFTSalesTemplate.md#name) -- [params](templates.NFTSalesTemplate.md#params) -- [paramsGen](templates.NFTSalesTemplate.md#paramsgen) -- [paymentData](templates.NFTSalesTemplate.md#paymentdata) -- [printAgreementStatus](templates.NFTSalesTemplate.md#printagreementstatus) -- [process](templates.NFTSalesTemplate.md#process) -- [send](templates.NFTSalesTemplate.md#send) -- [sendFrom](templates.NFTSalesTemplate.md#sendfrom) -- [service](templates.NFTSalesTemplate.md#service) -- [serviceEndpoint](templates.NFTSalesTemplate.md#serviceendpoint) -- [setInstanceConfig](templates.NFTSalesTemplate.md#setinstanceconfig) -- [standardContext](templates.NFTSalesTemplate.md#standardcontext) -- [validateAgreement](templates.NFTSalesTemplate.md#validateagreement) -- [addressesStatic](templates.NFTSalesTemplate.md#addressesstatic) -- [findSignerStatic](templates.NFTSalesTemplate.md#findsignerstatic) -- [getInstance](templates.NFTSalesTemplate.md#getinstance) -- [setInstanceConfig](templates.NFTSalesTemplate.md#setinstanceconfig-1) - -## Constructors - -### constructor - -• `Protected` **new NFTSalesTemplate**(`contractName`) - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `contractName` | `string` | - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[constructor](templates.BaseTemplate.md#constructor) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:75](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L75) - -## Properties - -### contract - -• **contract**: `Contract` = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contract](templates.BaseTemplate.md#contract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L24) - ---- - -### contractName - -• **contractName**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[contractName](templates.BaseTemplate.md#contractname) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L23) - ---- - -### events - -• **events**: [`ContractEvent`](events.ContractEvent.md) \| [`SubgraphEvent`](events.SubgraphEvent.md) = `null` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[events](templates.BaseTemplate.md#events) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L25) - ---- - -### version - -• **version**: `string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[version](templates.BaseTemplate.md#version) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L26) - -## Accessors - -### address - -• `get` **address**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.address - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L28) - ---- - -### artifactsFolder - -• `Protected` `get` **artifactsFolder**(): `string` - -#### Returns - -`string` - -#### Inherited from - -BaseTemplate.artifactsFolder - -#### Defined in - -[src/Instantiable.abstract.ts:96](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L96) - ---- - -### config - -• `Protected` `get` **config**(): [`Config`](Config.md) - -#### Returns - -[`Config`](Config.md) - -#### Inherited from - -BaseTemplate.config - -#### Defined in - -[src/Instantiable.abstract.ts:80](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L80) - ---- - -### instanceConfig - -• `Protected` `get` **instanceConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instanceConfig - -#### Defined in - -[src/Instantiable.abstract.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L100) - ---- - -### instantiableConfig - -• `Protected` `get` **instantiableConfig**(): `InstantiableConfig` - -#### Returns - -`InstantiableConfig` - -#### Inherited from - -BaseTemplate.instantiableConfig - -#### Defined in - -[src/Instantiable.abstract.ts:73](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L73) - ---- - -### logger - -• `Protected` `get` **logger**(): [`Logger`](utils.Logger.md) - -#### Returns - -[`Logger`](utils.Logger.md) - -#### Inherited from - -BaseTemplate.logger - -#### Defined in - -[src/Instantiable.abstract.ts:87](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L87) - ---- - -### nevermined - -• `Protected` `get` **nevermined**(): [`Nevermined`](Nevermined.md) - -#### Returns - -[`Nevermined`](Nevermined.md) - -#### Inherited from - -BaseTemplate.nevermined - -#### Defined in - -[src/Instantiable.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L33) - ---- - -### web3 - -• `Protected` `get` **web3**(): `JsonRpcProvider` - -#### Returns - -`JsonRpcProvider` - -#### Inherited from - -BaseTemplate.web3 - -#### Defined in - -[src/Instantiable.abstract.ts:63](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L63) - -## Methods - -### accept - -▸ **accept**(`_params`): `Promise`<`boolean`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`boolean`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[accept](templates.BaseTemplate.md#accept) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L112) - ---- - -### addresses - -▸ **addresses**(): `Promise`<`string`[]\> - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addresses](templates.BaseTemplate.md#addresses) - -#### Defined in - -[src/Instantiable.abstract.ts:129](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L129) - ---- - -### agreementId - -▸ **agreementId**(`agreementIdSeed`, `creator`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------- | -| `agreementIdSeed` | `string` | -| `creator` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[agreementId](templates.BaseTemplate.md#agreementid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:213](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L213) - ---- - -### call - -▸ **call**<`T`\>(`name`, `args`, `from?`): `Promise`<`T`\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | `string` | - -#### Returns - -`Promise`<`T`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[call](templates.BaseTemplate.md#call) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:244](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L244) - ---- - -### checkExists - -▸ `Protected` **checkExists**(`address`): `Promise`<`boolean`\> - -Returns true of contract exists else it throws. - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true if the contract exists. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[checkExists](templates.BaseTemplate.md#checkexists) - -#### Defined in - -[src/Instantiable.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L44) - ---- - -### conditions - -▸ **conditions**(): [[`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`TransferNFTCondition`](conditions.TransferNFTCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Returns - -[[`LockPaymentCondition`](conditions.LockPaymentCondition.md), [`TransferNFTCondition`](conditions.TransferNFTCondition.md), [`EscrowPaymentCondition`](conditions.EscrowPaymentCondition.md)] - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[conditions](templates.BaseTemplate.md#conditions) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:61](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L61) - ---- - -### createAgreement - -▸ **createAgreement**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `extraArgs`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `extraArgs` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreement](templates.BaseTemplate.md#createagreement) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:99](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L99) - ---- - -### createAgreementAndPay - -▸ **createAgreementAndPay**(`agreementId`, `did`, `conditionIds`, `timeLocks`, `timeOuts`, `accessConsumer`, `condIdx`, `rewardAddress`, `tokenAddress`, `amounts`, `receivers`, `from?`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :--------------- | :---------------------- | -| `agreementId` | `string` | -| `did` | `string` | -| `conditionIds` | `string`[] | -| `timeLocks` | `number`[] | -| `timeOuts` | `number`[] | -| `accessConsumer` | `string` | -| `condIdx` | `number` | -| `rewardAddress` | `string` | -| `tokenAddress` | `string` | -| `amounts` | `default`[] | -| `receivers` | `string`[] | -| `from?` | [`Account`](Account.md) | -| `params?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementAndPay](templates.BaseTemplate.md#createagreementandpay) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L124) - ---- - -### createAgreementFromDDO - -▸ **createAgreementFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `params?`): `Promise`<`string`\> - -Create a new agreement using the data of a DDO. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :----------------------- | :---------- | -| `agreementIdSeed` | `string` | - | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `parameters` | `NFTSalesTemplateParams` | | -| `consumer` | [`Account`](Account.md) | - | -| `from` | [`Account`](Account.md) | - | -| `timeOuts?` | `number`[] | - | -| `params?` | `TxParameters` | - | - -#### Returns - -`Promise`<`string`\> - -true if the call was successful. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementFromDDO](templates.BaseTemplate.md#createagreementfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:225](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L225) - ---- - -### createAgreementWithPaymentFromDDO - -▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `parameters`, `consumer`, `from`, `timeOuts?`, `txParams?`, `observer?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `parameters` | `NFTSalesTemplateParams` | -| `consumer` | [`Account`](Account.md) | -| `from` | [`Account`](Account.md) | -| `timeOuts?` | `number`[] | -| `txParams?` | `TxParameters` | -| `observer?` | (`OrderProgressStep`: `any`) => `void` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createAgreementWithPaymentFromDDO](templates.BaseTemplate.md#createagreementwithpaymentfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:255](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L255) - ---- - -### createService - -▸ **createService**(`publisher`, `metadata`, `assetPrice?`, `erc20TokenAddress?`, `priced?`): `Promise`<`ServiceNFTSales`\> - -#### Parameters - -| Name | Type | Default value | -| :------------------- | :-------------------------------------- | :------------ | -| `publisher` | [`Account`](Account.md) | `undefined` | -| `metadata` | [`MetaData`](../interfaces/MetaData.md) | `undefined` | -| `assetPrice?` | `default` | `undefined` | -| `erc20TokenAddress?` | `string` | `undefined` | -| `priced` | `boolean` | `false` | - -#### Returns - -`Promise`<`ServiceNFTSales`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[createService](templates.BaseTemplate.md#createservice) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:65](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L65) - ---- - -### description - -▸ **description**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[description](templates.BaseTemplate.md#description) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:38](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L38) - ---- - -### extraGen - -▸ **extraGen**(`_params`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------- | -| `_params` | `ValidationParams` | - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[extraGen](templates.BaseTemplate.md#extragen) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:108](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L108) - ---- - -### findSigner - -▸ **findSigner**(`from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSigner](templates.BaseTemplate.md#findsigner) - -#### Defined in - -[src/Instantiable.abstract.ts:105](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L105) - ---- - -### getAddress - -▸ **getAddress**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAddress](templates.BaseTemplate.md#getaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L41) - ---- - -### getAgreementCreatedEvent - -▸ **getAgreementCreatedEvent**(`agreementId`): `Promise`<`any`[]\> - -Generates and returns the agreement creation event. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`any`[]\> - -Agreement created event. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementCreatedEvent](templates.BaseTemplate.md#getagreementcreatedevent) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:469](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L469) - ---- - -### getAgreementData - -▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `agreementId` | `string` | - -#### Returns - -`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementData](templates.BaseTemplate.md#getagreementdata) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L21) - ---- - -### getAgreementIdsFromDDO - -▸ **getAgreementIdsFromDDO**(`agreementId`, `ddo`, `creator`, `params`): `Promise`<`string`[]\> - -Get agreement conditions IDs. - -#### Parameters - -| Name | Type | Description | -| :------------ | :----------------------- | :------------ | -| `agreementId` | `string` | Agreement ID. | -| `ddo` | [`DDO`](DDO.md) | DDO. | -| `creator` | `string` | - | -| `params` | `NFTSalesTemplateParams` | - | - -#### Returns - -`Promise`<`string`[]\> - -The condition IDs. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementIdsFromDDO](templates.BaseTemplate.md#getagreementidsfromddo) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:183](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L183) - ---- - -### getAgreementStatus - -▸ **getAgreementStatus**(`agreementId`): `Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -Returns the status of the conditions. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`false` \| [`AgreementConditionsStatus`](../interfaces/templates.AgreementConditionsStatus.md)\> - -The conditions status. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementStatus](templates.BaseTemplate.md#getagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:343](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L343) - ---- - -### getAgreementsForDID - -▸ **getAgreementsForDID**(`did`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `did` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getAgreementsForDID](templates.BaseTemplate.md#getagreementsfordid) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:496](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L496) - ---- - -### getConditionTypes - -▸ **getConditionTypes**(): `Promise`<`string`[]\> - -Conditions address list. - -#### Returns - -`Promise`<`string`[]\> - -A list of condition addresses. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditionTypes](templates.BaseTemplate.md#getconditiontypes) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:163](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L163) - ---- - -### getConditions - -▸ **getConditions**(): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -List of condition contracts. - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)[]\> - -A list of condition contracts. - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getConditions](templates.BaseTemplate.md#getconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L171) - ---- - -### getContract - -▸ **getContract**(): `Contract` - -#### Returns - -`Contract` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getContract](templates.BaseTemplate.md#getcontract) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L37) - ---- - -### getFromAddress - -▸ `Protected` **getFromAddress**(`from?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `from?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getFromAddress](templates.BaseTemplate.md#getfromaddress) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:90](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L90) - ---- - -### getInputsOfMethod - -▸ **getInputsOfMethod**(`methodName`): `any`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `methodName` | `string` | - -#### Returns - -`any`[] - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getInputsOfMethod](templates.BaseTemplate.md#getinputsofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L50) - ---- - -### getServiceAgreementTemplate - -▸ **getServiceAgreementTemplate**(): `Promise`<`ServiceAgreementTemplate`\> - -#### Returns - -`Promise`<`ServiceAgreementTemplate`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplate](templates.BaseTemplate.md#getserviceagreementtemplate) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:114](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L114) - ---- - -### getServiceAgreementTemplateConditionByRef - -▸ **getServiceAgreementTemplateConditionByRef**(`ref`): `Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `ref` | `string` | - -#### Returns - -`Promise`<[`ConditionSmall`](conditions.ConditionSmall.md)\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditionByRef](templates.BaseTemplate.md#getserviceagreementtemplateconditionbyref) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:324](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L324) - ---- - -### getServiceAgreementTemplateConditions - -▸ **getServiceAgreementTemplateConditions**(): `Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Returns - -`Promise`<`ServiceAgreementTemplateCondition`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateConditions](templates.BaseTemplate.md#getserviceagreementtemplateconditions) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:319](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L319) - ---- - -### getServiceAgreementTemplateDependencies - -▸ **getServiceAgreementTemplateDependencies**(): `Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Returns - -`Promise`<{ `[condition: string]`: `string`[]; }\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getServiceAgreementTemplateDependencies](templates.BaseTemplate.md#getserviceagreementtemplatedependencies) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L333) - ---- - -### getSignatureOfMethod - -▸ **getSignatureOfMethod**(`methodName`, `args?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------- | :------------ | -| `methodName` | `string` | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -`string` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[getSignatureOfMethod](templates.BaseTemplate.md#getsignatureofmethod) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L45) - ---- - -### init - -▸ `Protected` **init**(`config`, `optional?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | Default value | -| :--------- | :------------------- | :------------ | -| `config` | `InstantiableConfig` | `undefined` | -| `optional` | `boolean` | `false` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[init](templates.BaseTemplate.md#init) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L55) - ---- - -### instanceFromDDO - -▸ **instanceFromDDO**(`agreementIdSeed`, `ddo`, `creator`, `parameters`): `Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFTSalesTemplateParams`\>\> - -#### Parameters - -| Name | Type | -| :---------------- | :----------------------- | -| `agreementIdSeed` | `string` | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | -| `parameters` | `NFTSalesTemplateParams` | - -#### Returns - -`Promise`<[`AgreementInstance`](../interfaces/templates.AgreementInstance.md)<`NFTSalesTemplateParams`\>\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[instanceFromDDO](templates.BaseTemplate.md#instancefromddo) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:71](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L71) - ---- - -### lockConditionIndex - -▸ **lockConditionIndex**(): `number` - -#### Returns - -`number` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[lockConditionIndex](templates.BaseTemplate.md#lockconditionindex) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:57](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L57) - ---- - -### lockTokens - -▸ **lockTokens**(`tokenAddress`, `amounts`, `from`, `txParams`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :---------------------- | -| `tokenAddress` | `any` | -| `amounts` | `any` | -| `from` | [`Account`](Account.md) | -| `txParams` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[lockTokens](templates.BaseTemplate.md#locktokens) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:398](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L398) - ---- - -### name - -▸ **name**(): `string` - -#### Returns - -`string` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[name](templates.BaseTemplate.md#name) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L35) - ---- - -### params - -▸ **params**(`consumerId`, `nftAmount`, `providerId?`): `NFTSalesTemplateParams` - -#### Parameters - -| Name | Type | -| :------------ | :-------- | -| `consumerId` | `string` | -| `nftAmount` | `default` | -| `providerId?` | `string` | - -#### Returns - -`NFTSalesTemplateParams` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[params](templates.BaseTemplate.md#params) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L42) - ---- - -### paramsGen - -▸ **paramsGen**(`__namedParameters`): `Promise`<`NFTSalesTemplateParams`\> - -Specialize params - -#### Parameters - -| Name | Type | Description | -| :------------------ | :----------------- | :----------------- | -| `__namedParameters` | `ValidationParams` | Generic parameters | - -#### Returns - -`Promise`<`NFTSalesTemplateParams`\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[paramsGen](templates.BaseTemplate.md#paramsgen) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L50) - ---- - -### paymentData - -▸ **paymentData**(`service`): [`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -[`PaymentData`](../interfaces/templates.PaymentData.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[paymentData](templates.BaseTemplate.md#paymentdata) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:85](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L85) - ---- - -### printAgreementStatus - -▸ **printAgreementStatus**(`agreementId`): `Promise`<`void`\> - -Prints the agreement status. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :------------ | -| `agreementId` | `string` | Agreement ID. | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[printAgreementStatus](templates.BaseTemplate.md#printagreementstatus) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:439](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L439) - ---- - -### process - -▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------- | -| `params` | `ValidationParams` | -| `from` | [`Account`](Account.md) | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[process](templates.BaseTemplate.md#process) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L116) - ---- - -### send - -▸ **send**(`name`, `from`, `args`, `params?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :------------- | -| `name` | `string` | -| `from` | `string` | -| `args` | `any`[] | -| `params` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[send](templates.BaseTemplate.md#send) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:117](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L117) - ---- - -### sendFrom - -▸ **sendFrom**(`name`, `args`, `from?`, `value?`): `Promise`<`ContractReceipt`\> - -#### Parameters - -| Name | Type | -| :------- | :---------------------- | -| `name` | `string` | -| `args` | `any`[] | -| `from?` | [`Account`](Account.md) | -| `value?` | `TxParameters` | - -#### Returns - -`Promise`<`ContractReceipt`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[sendFrom](templates.BaseTemplate.md#sendfrom) - -#### Defined in - -[src/keeper/contracts/ContractBase.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/ContractBase.ts#L97) - ---- - -### service - -▸ **service**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[service](templates.BaseTemplate.md#service) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L31) - ---- - -### serviceEndpoint - -▸ **serviceEndpoint**(): `ServiceType` - -#### Returns - -`ServiceType` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[serviceEndpoint](templates.BaseTemplate.md#serviceendpoint) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L31) - ---- - -### setInstanceConfig - -▸ `Protected` **setInstanceConfig**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig) - -#### Defined in - -[src/Instantiable.abstract.ts:171](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L171) - ---- - -### standardContext - -▸ **standardContext**(`ddo`, `creator`): [`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `ddo` | [`DDO`](DDO.md) | -| `creator` | `string` | - -#### Returns - -[`ConditionContext`](../interfaces/conditions.ConditionContext.md) - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[standardContext](templates.BaseTemplate.md#standardcontext) - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:207](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L207) - ---- - -### validateAgreement - -▸ **validateAgreement**(`agreement_id`, `did`, `params`, `from`, `extra?`, `txparams?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------------- | :----------------------- | -| `agreement_id` | `string` | -| `did` | `string` | -| `params` | `NFTSalesTemplateParams` | -| `from` | [`Account`](Account.md) | -| `extra` | `any` | -| `txparams?` | `TxParameters` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[validateAgreement](templates.BaseTemplate.md#validateagreement) - -#### Defined in - -[src/keeper/contracts/templates/BaseTemplate.abstract.ts:131](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/BaseTemplate.abstract.ts#L131) - ---- - -### addressesStatic - -▸ `Static` **addressesStatic**(`config`, `web3`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | - -#### Returns - -`Promise`<`string`[]\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[addressesStatic](templates.BaseTemplate.md#addressesstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:142](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L142) - ---- - -### findSignerStatic - -▸ `Static` **findSignerStatic**(`config`, `web3`, `from`): `Promise`<`Signer`\> - -#### Parameters - -| Name | Type | -| :------- | :-------------------- | -| `config` | [`Config`](Config.md) | -| `web3` | `JsonRpcProvider` | -| `from` | `string` | - -#### Returns - -`Promise`<`Signer`\> - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[findSignerStatic](templates.BaseTemplate.md#findsignerstatic) - -#### Defined in - -[src/Instantiable.abstract.ts:115](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L115) - ---- - -### getInstance - -▸ `Static` **getInstance**(`config`): `Promise`<[`NFTSalesTemplate`](templates.NFTSalesTemplate.md)\> - -#### Parameters - -| Name | Type | -| :------- | :------------------- | -| `config` | `InstantiableConfig` | - -#### Returns - -`Promise`<[`NFTSalesTemplate`](templates.NFTSalesTemplate.md)\> - -#### Overrides - -[BaseTemplate](templates.BaseTemplate.md).[getInstance](templates.BaseTemplate.md#getinstance) - -#### Defined in - -[src/keeper/contracts/templates/NFTSalesTemplate.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/NFTSalesTemplate.ts#L25) - ---- - -### setInstanceConfig - -▸ `Static` `Protected` **setInstanceConfig**<`T`\>(`instance`, `instantiableConfig`): `void` - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------- | -| `T` | extends `Instantiable`<`T`\> | - -#### Parameters - -| Name | Type | -| :------------------- | :------------------- | -| `instance` | `T` | -| `instantiableConfig` | `InstantiableConfig` | - -#### Returns - -`void` - -#### Inherited from - -[BaseTemplate](templates.BaseTemplate.md).[setInstanceConfig](templates.BaseTemplate.md#setinstanceconfig-1) - -#### Defined in - -[src/Instantiable.abstract.ts:162](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/Instantiable.abstract.ts#L162) diff --git a/docs/api-reference/classes/utils.Logger.md b/docs/api-reference/classes/utils.Logger.md deleted file mode 100644 index 218d1053a..000000000 --- a/docs/api-reference/classes/utils.Logger.md +++ /dev/null @@ -1,193 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [utils](../modules/utils.md) / Logger - -# Class: Logger - -[utils](../modules/utils.md).Logger - -## Table of contents - -### Constructors - -- [constructor](utils.Logger.md#constructor) - -### Properties - -- [logLevel](utils.Logger.md#loglevel) - -### Methods - -- [bypass](utils.Logger.md#bypass) -- [debug](utils.Logger.md#debug) -- [dispatch](utils.Logger.md#dispatch) -- [error](utils.Logger.md#error) -- [log](utils.Logger.md#log) -- [setLevel](utils.Logger.md#setlevel) -- [warn](utils.Logger.md#warn) - -## Constructors - -### constructor - -• **new Logger**(`logLevel?`) - -#### Parameters - -| Name | Type | Default value | -| :--------- | :--------------------------------------- | :-------------- | -| `logLevel` | [`LogLevel`](../enums/utils.LogLevel.md) | `LogLevel.Warn` | - -#### Defined in - -[src/utils/Logger.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L10) - -## Properties - -### logLevel - -• `Private` **logLevel**: [`LogLevel`](../enums/utils.LogLevel.md) = `LogLevel.Warn` - -#### Defined in - -[src/utils/Logger.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L10) - -## Methods - -### bypass - -▸ **bypass**(...`args`): `void` - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`void` - -#### Defined in - -[src/utils/Logger.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L16) - ---- - -### debug - -▸ **debug**(...`args`): `void` - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`void` - -#### Defined in - -[src/utils/Logger.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L20) - ---- - -### dispatch - -▸ `Private` **dispatch**(`verb`, `level`, ...`args`): `void` - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------- | -| `verb` | `string` | -| `level` | [`LogLevel`](../enums/utils.LogLevel.md) | -| `...args` | `any`[] | - -#### Returns - -`void` - -#### Defined in - -[src/utils/Logger.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L36) - ---- - -### error - -▸ **error**(...`args`): `void` - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`void` - -#### Defined in - -[src/utils/Logger.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L32) - ---- - -### log - -▸ **log**(...`args`): `void` - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`void` - -#### Defined in - -[src/utils/Logger.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L24) - ---- - -### setLevel - -▸ **setLevel**(`logLevel`): `void` - -#### Parameters - -| Name | Type | -| :--------- | :--------------------------------------- | -| `logLevel` | [`LogLevel`](../enums/utils.LogLevel.md) | - -#### Returns - -`void` - -#### Defined in - -[src/utils/Logger.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L12) - ---- - -### warn - -▸ **warn**(...`args`): `void` - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `...args` | `any`[] | - -#### Returns - -`void` - -#### Defined in - -[src/utils/Logger.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L28) diff --git a/docs/api-reference/code-reference.md b/docs/api-reference/code-reference.md index ae90f390e..1f2d67811 100644 --- a/docs/api-reference/code-reference.md +++ b/docs/api-reference/code-reference.md @@ -4,78 +4,1245 @@ ## Table of contents -### Namespaces +### References -- [KeyTransfer](modules/KeyTransfer.md) -- [conditions](modules/conditions.md) -- [events](modules/events.md) -- [subgraphs](modules/subgraphs.md) -- [templates](modules/templates.md) -- [utils](modules/utils.md) +- [LoggerInstance](code-reference.md#loggerinstance) ### Enumerations +- [AccessStatus](enums/AccessStatus.md) +- [AssetResult](enums/AssetResult.md) - [ConditionState](enums/ConditionState.md) - [CreateProgressStep](enums/CreateProgressStep.md) +- [DIDResolvePolicy](enums/DIDResolvePolicy.md) +- [ERCType](enums/ERCType.md) +- [ExecuteProgressStep](enums/ExecuteProgressStep.md) +- [ExternalResourceFileType](enums/ExternalResourceFileType.md) +- [ImmutableBackends](enums/ImmutableBackends.md) +- [LogLevel](enums/LogLevel.md) +- [NeverminedNFT1155Type](enums/NeverminedNFT1155Type.md) +- [NeverminedNFT721Type](enums/NeverminedNFT721Type.md) +- [NodeUploadBackends](enums/NodeUploadBackends.md) - [OrderProgressStep](enums/OrderProgressStep.md) - [PermissionType](enums/PermissionType.md) - [PlatformTechStatus](enums/PlatformTechStatus.md) - [ProvenanceMethod](enums/ProvenanceMethod.md) +- [PublishMetadataOptions](enums/PublishMetadataOptions.md) +- [PublishOnChainOptions](enums/PublishOnChainOptions.md) +- [RoyaltyKind](enums/RoyaltyKind.md) - [State](enums/State.md) +- [TemplateState](enums/TemplateState.md) +- [UpdateProgressStep](enums/UpdateProgressStep.md) +- [ValueType](enums/ValueType.md) ### Classes +- [AaveBorrowCondition](classes/AaveBorrowCondition.md) +- [AaveCollateralDepositCondition](classes/AaveCollateralDepositCondition.md) +- [AaveCollateralWithdrawCondition](classes/AaveCollateralWithdrawCondition.md) +- [AaveCredit](classes/AaveCredit.md) +- [AaveCreditTemplate](classes/AaveCreditTemplate.md) +- [AaveRepayCondition](classes/AaveRepayCondition.md) +- [AccessCondition](classes/AccessCondition.md) +- [AccessService](classes/AccessService.md) +- [AccessTemplate](classes/AccessTemplate.md) - [Account](classes/Account.md) -- [Accounts](classes/Accounts.md) +- [AccountsApi](classes/AccountsApi.md) +- [AgreementStoreManager](classes/AgreementStoreManager.md) - [AgreementTemplate](classes/AgreementTemplate.md) +- [AgreementsApi](classes/AgreementsApi.md) +- [ApiError](classes/ApiError.md) +- [AssetAttributes](classes/AssetAttributes.md) +- [AssetError](classes/AssetError.md) +- [AssetPrice](classes/AssetPrice.md) +- [AssetPublicationOptions](classes/AssetPublicationOptions.md) +- [AssetsApi](classes/AssetsApi.md) +- [BabyjubPublicKey](classes/BabyjubPublicKey.md) +- [BaseTemplate](classes/BaseTemplate.md) +- [Bookmarks](classes/Bookmarks.md) - [ClientError](classes/ClientError.md) +- [ComputeApi](classes/ComputeApi.md) +- [ComputeExecutionCondition](classes/ComputeExecutionCondition.md) - [Condition](classes/Condition.md) -- [Config](classes/Config.md) +- [ConditionSmall](classes/ConditionSmall.md) +- [ConditionStoreManager](classes/ConditionStoreManager.md) +- [ConsumerCondition](classes/ConsumerCondition.md) +- [ContractBase](classes/ContractBase.md) +- [ContractEvent](classes/ContractEvent.md) +- [ContractHandler](classes/ContractHandler.md) +- [CurveRoyalties](classes/CurveRoyalties.md) +- [CustomToken](classes/CustomToken.md) - [DDO](classes/DDO.md) +- [DDOError](classes/DDOError.md) +- [DDOPriceNotFoundError](classes/DDOPriceNotFoundError.md) +- [DDOServiceNotFoundError](classes/DDOServiceNotFoundError.md) - [DID](classes/DID.md) +- [DIDRegistry](classes/DIDRegistry.md) +- [DIDSalesTemplate](classes/DIDSalesTemplate.md) +- [Dispenser](classes/Dispenser.md) +- [DistributeNFTCollateralCondition](classes/DistributeNFTCollateralCondition.md) +- [EscrowComputeExecutionTemplate](classes/EscrowComputeExecutionTemplate.md) +- [EscrowPaymentCondition](classes/EscrowPaymentCondition.md) +- [EthSignJWT](classes/EthSignJWT.md) +- [EventHandler](classes/EventHandler.md) +- [Files](classes/Files.md) +- [GenericContract](classes/GenericContract.md) +- [GraphError](classes/GraphError.md) +- [HttpError](classes/HttpError.md) +- [Instantiable](classes/Instantiable.md) +- [JwtUtils](classes/JwtUtils.md) - [Keeper](classes/Keeper.md) +- [KeeperError](classes/KeeperError.md) +- [LockPaymentCondition](classes/LockPaymentCondition.md) +- [MarketplaceApi](classes/MarketplaceApi.md) +- [MetadataService](classes/MetadataService.md) +- [MimcCipher](classes/MimcCipher.md) +- [NFT1155Api](classes/NFT1155Api.md) +- [NFT721AccessTemplate](classes/NFT721AccessTemplate.md) +- [NFT721Api](classes/NFT721Api.md) +- [NFT721HolderCondition](classes/NFT721HolderCondition.md) +- [NFT721LockCondition](classes/NFT721LockCondition.md) +- [NFT721SalesTemplate](classes/NFT721SalesTemplate.md) +- [NFTAccessCondition](classes/NFTAccessCondition.md) +- [NFTAccessService](classes/NFTAccessService.md) +- [NFTAccessTemplate](classes/NFTAccessTemplate.md) +- [NFTAttributes](classes/NFTAttributes.md) +- [NFTContractsBase](classes/NFTContractsBase.md) +- [NFTError](classes/NFTError.md) +- [NFTHolderCondition](classes/NFTHolderCondition.md) +- [NFTLockCondition](classes/NFTLockCondition.md) +- [NFTSalesService](classes/NFTSalesService.md) +- [NFTSalesTemplate](classes/NFTSalesTemplate.md) +- [NFTServiceAttributes](classes/NFTServiceAttributes.md) +- [NFTsBaseApi](classes/NFTsBaseApi.md) - [Nevermined](classes/Nevermined.md) -- [Nft721](classes/Nft721.md) -- [Nfts](classes/Nfts.md) +- [NeverminedEvent](classes/NeverminedEvent.md) +- [NeverminedNode](classes/NeverminedNode.md) +- [NeverminedNodeError](classes/NeverminedNodeError.md) +- [NeverminedOptions](classes/NeverminedOptions.md) +- [Nft1155Contract](classes/Nft1155Contract.md) +- [Nft721Contract](classes/Nft721Contract.md) +- [Permissions](classes/Permissions.md) +- [Profiles](classes/Profiles.md) +- [ProvenanceApi](classes/ProvenanceApi.md) +- [ProviderCondition](classes/ProviderCondition.md) +- [Providers](classes/Providers.md) +- [RegistryBaseApi](classes/RegistryBaseApi.md) +- [RewardsDistributor](classes/RewardsDistributor.md) +- [RoyaltyScheme](classes/RoyaltyScheme.md) +- [SearchApi](classes/SearchApi.md) +- [ServiceAgreement](classes/ServiceAgreement.md) +- [ServicesApi](classes/ServicesApi.md) +- [SignatureUtils](classes/SignatureUtils.md) +- [StandardRoyalties](classes/StandardRoyalties.md) +- [SubgraphEvent](classes/SubgraphEvent.md) +- [SubscribableObserver](classes/SubscribableObserver.md) +- [SubscribablePromise](classes/SubscribablePromise.md) +- [SubscriptionCreditsNFTApi](classes/SubscriptionCreditsNFTApi.md) +- [SubscriptionNFTApi](classes/SubscriptionNFTApi.md) +- [TemplateStoreManager](classes/TemplateStoreManager.md) +- [Token](classes/Token.md) +- [TokenUtils](classes/TokenUtils.md) +- [TransferDIDOwnershipCondition](classes/TransferDIDOwnershipCondition.md) +- [TransferNFT721Condition](classes/TransferNFT721Condition.md) +- [TransferNFTCondition](classes/TransferNFTCondition.md) +- [UtilsApi](classes/UtilsApi.md) +- [Versions](classes/Versions.md) +- [Web3Error](classes/Web3Error.md) +- [Web3Provider](classes/Web3Provider.md) +- [Web3ProviderWrapper](classes/Web3ProviderWrapper.md) +- [WebServiceConnector](classes/WebServiceConnector.md) ### Interfaces +- [AaveConfig](interfaces/AaveConfig.md) +- [AaveCreditTemplateParams](interfaces/AaveCreditTemplateParams.md) +- [AccessProofTemplateParams](interfaces/AccessProofTemplateParams.md) +- [ActedOnBehalfEvent](interfaces/ActedOnBehalfEvent.md) - [AdditionalInformation](interfaces/AdditionalInformation.md) +- [AgreementConditionsStatus](interfaces/AgreementConditionsStatus.md) +- [AgreementData](interfaces/AgreementData.md) +- [AgreementInstance](interfaces/AgreementInstance.md) +- [AgreementPrepareResult](interfaces/AgreementPrepareResult.md) - [Algorithm](interfaces/Algorithm.md) +- [AuthToken](interfaces/AuthToken.md) +- [Authentication](interfaces/Authentication.md) +- [Babysig](interfaces/Babysig.md) +- [Balance](interfaces/Balance.md) - [Bookmark](interfaces/Bookmark.md) +- [ConditionContext](interfaces/ConditionContext.md) +- [ConditionData](interfaces/ConditionData.md) +- [ConditionInstance](interfaces/ConditionInstance.md) +- [ConditionInstanceSmall](interfaces/ConditionInstanceSmall.md) +- [ConditionParameters](interfaces/ConditionParameters.md) +- [ContractEventSubscription](interfaces/ContractEventSubscription.md) - [Curation](interfaces/Curation.md) -- [File](interfaces/File.md) +- [DDOStatus](interfaces/DDOStatus.md) +- [Eip712Data](interfaces/Eip712Data.md) +- [EventEmitter](interfaces/EventEmitter.md) +- [EventOptions](interfaces/EventOptions.md) +- [Filter](interfaces/Filter.md) +- [GenericAccess](interfaces/GenericAccess.md) +- [InputType](interfaces/InputType.md) +- [InstantiableConfig](interfaces/InstantiableConfig.md) +- [JsonRpcPayload](interfaces/JsonRpcPayload.md) +- [JsonRpcResponse](interfaces/JsonRpcResponse.md) +- [MarketplaceResults](interfaces/MarketplaceResults.md) - [MetaData](interfaces/MetaData.md) +- [MetaDataExternalResource](interfaces/MetaDataExternalResource.md) - [MetaDataMain](interfaces/MetaDataMain.md) +- [MethodReflection](interfaces/MethodReflection.md) +- [MintedEntry](interfaces/MintedEntry.md) - [NewBookmark](interfaces/NewBookmark.md) - [NewPermission](interfaces/NewPermission.md) - [NewProfile](interfaces/NewProfile.md) +- [NvmConfig](interfaces/NvmConfig.md) +- [NvmConfigVersions](interfaces/NvmConfigVersions.md) +- [PaymentData](interfaces/PaymentData.md) - [Permission](interfaces/Permission.md) - [PlatformKeeperTech](interfaces/PlatformKeeperTech.md) - [PlatformTech](interfaces/PlatformTech.md) - [PlatformVersions](interfaces/PlatformVersions.md) - [Profile](interfaces/Profile.md) +- [Proof](interfaces/Proof.md) +- [ProvenanceAttributeRegisteredEvent](interfaces/ProvenanceAttributeRegisteredEvent.md) +- [ProvenanceBaseEvent](interfaces/ProvenanceBaseEvent.md) - [ProvenanceRegistry](interfaces/ProvenanceRegistry.md) +- [Provider](interfaces/Provider.md) +- [PublicKey](interfaces/PublicKey.md) +- [QueryResult](interfaces/QueryResult.md) +- [ResourceAuthentication](interfaces/ResourceAuthentication.md) +- [RoyaltyAttributes](interfaces/RoyaltyAttributes.md) - [SearchQuery](interfaces/SearchQuery.md) -- [Service](interfaces/Service.md) +- [ServiceAaveCredit](interfaces/ServiceAaveCredit.md) +- [ServiceAccess](interfaces/ServiceAccess.md) +- [ServiceAgreementTemplate](interfaces/ServiceAgreementTemplate.md) +- [ServiceAgreementTemplateCondition](interfaces/ServiceAgreementTemplateCondition.md) +- [ServiceAgreementTemplateEvent](interfaces/ServiceAgreementTemplateEvent.md) +- [ServiceAgreementTemplateParameter](interfaces/ServiceAgreementTemplateParameter.md) +- [ServiceAttributes](interfaces/ServiceAttributes.md) +- [ServiceAuthorization](interfaces/ServiceAuthorization.md) +- [ServiceCommon](interfaces/ServiceCommon.md) +- [ServiceCompute](interfaces/ServiceCompute.md) - [ServiceDefinition](interfaces/ServiceDefinition.md) +- [ServiceMetadata](interfaces/ServiceMetadata.md) +- [ServiceNFTAccess](interfaces/ServiceNFTAccess.md) +- [ServiceNFTSales](interfaces/ServiceNFTSales.md) +- [ServicePlugin](interfaces/ServicePlugin.md) +- [ServiceSecondary](interfaces/ServiceSecondary.md) - [Stage](interfaces/Stage.md) - [StageInput](interfaces/StageInput.md) - [StageOutput](interfaces/StageOutput.md) -- [StageRequirements](interfaces/StageRequirements.md) - [StageTransformation](interfaces/StageTransformation.md) +- [SubscriptionToken](interfaces/SubscriptionToken.md) +- [TemplateMetadata](interfaces/TemplateMetadata.md) +- [TxParameters](interfaces/TxParameters.md) +- [TypedDataDomain](interfaces/TypedDataDomain.md) +- [TypedDataTypes](interfaces/TypedDataTypes.md) +- [UsedEvent](interfaces/UsedEvent.md) +- [ValidationParams](interfaces/ValidationParams.md) +- [ValuePair](interfaces/ValuePair.md) +- [WasAssociatedWithEvent](interfaces/WasAssociatedWithEvent.md) +- [WasDerivedFromEvent](interfaces/WasDerivedFromEvent.md) +- [WasGeneratedByEvent](interfaces/WasGeneratedByEvent.md) +- [WebService](interfaces/WebService.md) +- [WebServiceInternalAttributes](interfaces/WebServiceInternalAttributes.md) - [Workflow](interfaces/Workflow.md) +### Type Aliases + +- [AaveConditionType](code-reference.md#aaveconditiontype) +- [BigNumberish](code-reference.md#bignumberish) +- [ConditionMethod](code-reference.md#conditionmethod) +- [ConditionType](code-reference.md#conditiontype) +- [EncryptionMethod](code-reference.md#encryptionmethod) +- [EventResult](code-reference.md#eventresult) +- [NeverminedNFTType](code-reference.md#neverminednfttype) +- [ParameterType](code-reference.md#parametertype) +- [PricedMetadataInformation](code-reference.md#pricedmetadatainformation) +- [ProvenanceEvent](code-reference.md#provenanceevent) +- [Service](code-reference.md#service) +- [ServiceType](code-reference.md#servicetype) + ### Variables +- [AaveCreditConditions](code-reference.md#aavecreditconditions) +- [DEFAULT_REGISTRATION_ACTIVITY_ID](code-reference.md#default_registration_activity_id) +- [DEPENDENCIES_RELEASE_CONDITION](code-reference.md#dependencies_release_condition) - [Logger](code-reference.md#logger) +- [SALES_SERVICES](code-reference.md#sales_services) +- [ZeroAddress](code-reference.md#zeroaddress) +- [aaveCreditTemplateServiceAgreementTemplate](code-reference.md#aavecredittemplateserviceagreementtemplate) +- [apiPath](code-reference.md#apipath) +- [conditionStateNames](code-reference.md#conditionstatenames) +- [defaultNeverminedNFTType](code-reference.md#defaultneverminednfttype) +- [ercOfNeverminedNFTType](code-reference.md#ercofneverminednfttype) +- [serviceIndex](code-reference.md#serviceindex) +- [servicePath](code-reference.md#servicepath) + +### Functions + +- [buildQuery](code-reference.md#buildquery) +- [convertEthersV6SignerToAccountSigner](code-reference.md#convertethersv6signertoaccountsigner) +- [didPrefixed](code-reference.md#didprefixed) +- [didTransformer](code-reference.md#didtransformer) +- [didZeroX](code-reference.md#didzerox) +- [eventToObject](code-reference.md#eventtoobject) +- [formatEther](code-reference.md#formatether) +- [formatUnits](code-reference.md#formatunits) +- [generateId](code-reference.md#generateid) +- [generateInstantiableConfigFromConfig](code-reference.md#generateinstantiableconfigfromconfig) +- [getCircularReplacer](code-reference.md#getcircularreplacer) +- [getConditionsByParams](code-reference.md#getconditionsbyparams) +- [getNetworkName](code-reference.md#getnetworkname) +- [getRoyaltyAttributes](code-reference.md#getroyaltyattributes) +- [getRoyaltyScheme](code-reference.md#getroyaltyscheme) +- [jsonReplacer](code-reference.md#jsonreplacer) +- [makeAccount](code-reference.md#makeaccount) +- [makeAccounts](code-reference.md#makeaccounts) +- [makeBuffer](code-reference.md#makebuffer) +- [noDidPrefixed](code-reference.md#nodidprefixed) +- [noZeroX](code-reference.md#nozerox) +- [objectPromiseAll](code-reference.md#objectpromiseall) +- [parseEther](code-reference.md#parseether) +- [parseUnits](code-reference.md#parseunits) +- [zeroX](code-reference.md#zerox) +- [zeroXTransformer](code-reference.md#zeroxtransformer) + +## References + +### LoggerInstance + +Renames and re-exports [Logger](code-reference.md#logger) + +## Type Aliases + +### AaveConditionType + +Ƭ **AaveConditionType**: `"lockNft"` \| `"depositCollateral"` \| `"borrowCredit"` \| `"repayCredit"` \| `"withdrawCollateral"` \| `"distributeNft"` + +#### Defined in + +[src/keeper/contracts/defi/Service.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/Service.ts#L19) + +--- + +### BigNumberish + +Ƭ **BigNumberish**: `string` \| `Numeric` + +Any type that can be used where a big number is needed. + +#### Defined in + +node_modules/ethers/lib.commonjs/utils/maths.d.ts:9 + +--- + +### ConditionMethod + +Ƭ **ConditionMethod**: `"fulfill"` \| `"fulfillForDelegate"` + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L16) + +--- + +### ConditionType + +Ƭ **ConditionType**: `"lockPayment"` \| `"escrowPayment"` \| `"nftHolder"` \| `"transferNFT"` \| [`AaveConditionType`](code-reference.md#aaveconditiontype) + +#### Defined in + +[src/ddo/types.ts:555](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L555) + +--- + +### EncryptionMethod + +Ƭ **EncryptionMethod**: `"PSK-RSA"` \| `"PSK-ECDSA"` + +#### Defined in + +[src/services/metadata/MetadataService.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L16) + +--- + +### EventResult + +Ƭ **EventResult**: `Promise`<`any`[]\> + +#### Defined in + +[src/events/NeverminedEvent.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L25) + +--- + +### NeverminedNFTType + +Ƭ **NeverminedNFTType**: [`NeverminedNFT721Type`](enums/NeverminedNFT721Type.md) \| [`NeverminedNFT1155Type`](enums/NeverminedNFT1155Type.md) + +#### Defined in + +[src/models/types.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L40) + +--- + +### ParameterType + +Ƭ **ParameterType**: `string` \| `number` \| `number`[] \| [`Account`](classes/Account.md) \| [`BabyjubPublicKey`](classes/BabyjubPublicKey.md) \| [`Service`](code-reference.md#service) \| [`ServiceType`](code-reference.md#servicetype) \| [`TxParameters`](interfaces/TxParameters.md) + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L27) + +--- + +### PricedMetadataInformation + +Ƭ **PricedMetadataInformation**: `Object` + +#### Type declaration + +| Name | Type | +| :---------------------------------------------------------- | :---------------------------------------------------------------------------------------------------- | +| `attributes` | { `additionalInformation`: { `priceHighestDenomination`: `number` } ; `main`: { `price`: `string` } } | +| `attributes.additionalInformation` | { `priceHighestDenomination`: `number` } | +| `attributes.additionalInformation.priceHighestDenomination` | `number` | +| `attributes.main` | { `price`: `string` } | +| `attributes.main.price` | `string` | + +#### Defined in + +[src/ddo/types.ts:600](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L600) + +--- + +### ProvenanceEvent + +Ƭ **ProvenanceEvent**<`T`\>: `T` extends [`WAS_GENERATED_BY`](enums/ProvenanceMethod.md#was_generated_by) ? [`WasGeneratedByEvent`](interfaces/WasGeneratedByEvent.md) : `T` extends [`USED`](enums/ProvenanceMethod.md#used) ? [`UsedEvent`](interfaces/UsedEvent.md) : `T` extends [`WAS_DERIVED_FROM`](enums/ProvenanceMethod.md#was_derived_from) ? [`WasDerivedFromEvent`](interfaces/WasDerivedFromEvent.md) : `T` extends [`WAS_ASSOCIATED_WITH`](enums/ProvenanceMethod.md#was_associated_with) ? [`WasAssociatedWithEvent`](interfaces/WasAssociatedWithEvent.md) : `T` extends [`ACTED_ON_BEHALF`](enums/ProvenanceMethod.md#acted_on_behalf) ? [`ActedOnBehalfEvent`](interfaces/ActedOnBehalfEvent.md) : [`WasGeneratedByEvent`](interfaces/WasGeneratedByEvent.md) \| [`UsedEvent`](interfaces/UsedEvent.md) \| [`WasDerivedFromEvent`](interfaces/WasDerivedFromEvent.md) \| [`WasAssociatedWithEvent`](interfaces/WasAssociatedWithEvent.md) \| [`ActedOnBehalfEvent`](interfaces/ActedOnBehalfEvent.md) + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------------------------------------------- | +| `T` | extends [`ProvenanceMethod`](enums/ProvenanceMethod.md) \| `any` = `any` | + +#### Defined in + +[src/keeper/contracts/Provenance.ts:82](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L82) + +--- + +### Service + +Ƭ **Service**<`T`\>: `T` extends `"authorization"` ? [`ServiceAuthorization`](interfaces/ServiceAuthorization.md) : `T` extends `"metadata"` ? [`ServiceMetadata`](interfaces/ServiceMetadata.md) : `T` extends `"nft-access"` ? [`ServiceNFTAccess`](interfaces/ServiceNFTAccess.md) : `T` extends `"nft-sales"` ? [`ServiceNFTSales`](interfaces/ServiceNFTSales.md) : `T` extends `"access"` ? [`ServiceAccess`](interfaces/ServiceAccess.md) : `T` extends `"compute"` ? [`ServiceCompute`](interfaces/ServiceCompute.md) : `T` extends `"aave-credit"` ? [`ServiceAaveCredit`](interfaces/ServiceAaveCredit.md) : `T` extends `"default"` ? [`ServiceCommon`](interfaces/ServiceCommon.md) : [`ServiceCommon`](interfaces/ServiceCommon.md) + +#### Type parameters + +| Name | Type | +| :--- | :---------------------------------------------------------------------------------- | +| `T` | extends [`ServiceType`](code-reference.md#servicetype) \| `"default"` = `"default"` | + +#### Defined in + +[src/ddo/types.ts:719](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L719) + +--- + +### ServiceType + +Ƭ **ServiceType**: `"authorization"` \| `"metadata"` \| `"access"` \| `"compute"` \| `"workflow"` \| `"nft-access"` \| `"nft-sales"` \| `"aave-credit"` \| `"nft-sales-proof"` + +#### Defined in + +[src/ddo/types.ts:562](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L562) ## Variables +### AaveCreditConditions + +• `Const` **AaveCreditConditions**: `string`[] + +#### Defined in + +[src/keeper/contracts/defi/Service.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/Service.ts#L10) + +--- + +### DEFAULT_REGISTRATION_ACTIVITY_ID + +• `Const` **DEFAULT_REGISTRATION_ACTIVITY_ID**: `string` + +Identifies the default Provenance Activity Id to be recorded on-chain in the DIDRegistry Smart Contract when +an asset is registered. It associates to the new DID created the 'Asset Registration' activity. +(@see https://docs.nevermined.io/docs/architecture/specs/Spec-PROVENANCE#provenance-relations) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L9) + +--- + +### DEPENDENCIES_RELEASE_CONDITION + +• `Const` **DEPENDENCIES_RELEASE_CONDITION**: `string`[] + +#### Defined in + +[src/ddo/DDO.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L31) + +--- + ### Logger -• `Const` **Logger**: [`Logger`](classes/utils.Logger.md) +• `Const` **Logger**: `Logger` + +#### Defined in + +[src/utils/Logger.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/Logger.ts#L43) + +--- + +### SALES_SERVICES + +• `Const` **SALES_SERVICES**: `string`[] + +#### Defined in + +[src/ddo/DDO.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/DDO.ts#L29) + +--- + +### ZeroAddress + +• `Const` **ZeroAddress**: `"0x0000000000000000000000000000000000000000"` + +#### Defined in + +[src/utils/ConversionTypeHelpers.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L43) + +--- + +### aaveCreditTemplateServiceAgreementTemplate + +• `Const` **aaveCreditTemplateServiceAgreementTemplate**: [`ServiceAgreementTemplate`](interfaces/ServiceAgreementTemplate.md) + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.serviceAgreementTemplate.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.serviceAgreementTemplate.ts#L3) + +--- + +### apiPath + +• `Const` **apiPath**: `"/api/v1/metadata/assets/ddo"` + +#### Defined in + +[src/services/metadata/MetadataService.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L6) + +--- + +### conditionStateNames + +• `Const` **conditionStateNames**: `string`[] + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L42) + +--- + +### defaultNeverminedNFTType + +• `Const` **defaultNeverminedNFTType**: `Object` + +#### Type declaration + +| Name | Type | +| :----- | :-------------------------------------------------------- | +| `1155` | [`NeverminedNFT1155Type`](enums/NeverminedNFT1155Type.md) | +| `721` | [`NeverminedNFT721Type`](enums/NeverminedNFT721Type.md) | + +#### Defined in + +[src/models/types.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L49) + +--- + +### ercOfNeverminedNFTType + +• `Const` **ercOfNeverminedNFTType**: `Object` + +#### Type declaration + +| Name | Type | +| :-------------------- | :---------------------------- | +| `nft1155` | [`ERCType`](enums/ERCType.md) | +| `nft1155-credit` | [`ERCType`](enums/ERCType.md) | +| `nft721` | [`ERCType`](enums/ERCType.md) | +| `nft721-subscription` | [`ERCType`](enums/ERCType.md) | + +#### Defined in + +[src/models/types.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L42) + +--- + +### serviceIndex + +• `Const` **serviceIndex**: `Object` + +#### Type declaration + +| Name | Type | +| :-------------------- | :------- | +| `aave-credit` | `number` | +| `access` | `number` | +| `access-proof` | `number` | +| `authorization` | `number` | +| `compute` | `number` | +| `metadata` | `number` | +| `nft-access` | `number` | +| `nft-access-proof` | `number` | +| `nft-sales` | `number` | +| `nft-sales-proof` | `number` | +| `nft721-access` | `number` | +| `nft721-access-proof` | `number` | +| `nft721-sales` | `number` | +| `nft721-sales-proof` | `number` | +| `workflow` | `number` | + +#### Defined in + +[src/ddo/types.ts:573](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L573) + +--- + +### servicePath + +• `Const` **servicePath**: `"/api/v1/metadata/assets/service"` + +#### Defined in + +[src/services/metadata/MetadataService.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L7) + +## Functions + +### buildQuery + +▸ **buildQuery**(`url`, `query`): `any` + +#### Parameters + +| Name | Type | +| :------ | :----------------------------------------- | +| `url` | `string` | +| `query` | [`SearchQuery`](interfaces/SearchQuery.md) | + +#### Returns + +`any` + +#### Defined in + +[src/common/helpers.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/helpers.ts#L4) + +--- + +### convertEthersV6SignerToAccountSigner + +▸ **convertEthersV6SignerToAccountSigner**(`signer`): `SmartAccountSigner` + +#### Parameters + +| Name | Type | +| :------- | :------------------- | +| `signer` | `Signer` \| `Wallet` | + +#### Returns + +`SmartAccountSigner` + +#### Defined in + +[src/keeper/utils.ts:100](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L100) + +--- + +### didPrefixed + +▸ **didPrefixed**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `input` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/ConversionTypeHelpers.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L13) + +--- + +### didTransformer + +▸ **didTransformer**(`input?`, `prefixOutput`): `string` + +#### Parameters + +| Name | Type | Default value | +| :------------- | :-------- | :------------ | +| `input` | `string` | `''` | +| `prefixOutput` | `boolean` | `undefined` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/ConversionTypeHelpers.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L16) + +--- + +### didZeroX + +▸ **didZeroX**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `input` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/ConversionTypeHelpers.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L22) + +--- + +### eventToObject + +▸ **eventToObject**(`event`): `any` + +#### Parameters + +| Name | Type | +| :------ | :---- | +| `event` | `any` | + +#### Returns + +`any` + +#### Defined in + +[src/utils/Events.ts:1](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/Events.ts#L1) + +--- + +### formatEther + +▸ **formatEther**(`value`): `string` + +Converts a _wei_ value into _ether_. + +#### Parameters + +| Name | Type | Description | +| :------ | :----------------------------------------------- | :------------------- | +| `value` | [`BigNumberish`](code-reference.md#bignumberish) | The value to format. | + +#### Returns + +`string` + +The string of the formatted value + +**`Example`** + +```ts +const value = 1000000000000000000n + +formatEther(value) +// '1.0' +``` + +#### Defined in + +[src/utils/UnitConversion.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/UnitConversion.ts#L57) + +--- + +### formatUnits + +▸ **formatUnits**(`value`, `decimals?`): `string` + +Returns a string representation of value formatted with _decimal_ digits. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------- | :----------------------------------------------- | :------------ | :------------------- | +| `value` | [`BigNumberish`](code-reference.md#bignumberish) | `undefined` | The value to format. | +| `decimals` | `number` | `18` | - | + +#### Returns + +`string` + +The string of the formatted value + +**`Example`** + +```ts +const oneEther = 1000000000000000000n + +formatUnits(oneEther, 18) +// '1.0' +``` + +#### Defined in + +[src/utils/UnitConversion.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/UnitConversion.ts#L75) + +--- + +### generateId + +▸ **generateId**(`length?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :------- | :------- | :------------ | +| `length` | `number` | `64` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/GeneratorHelpers.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/GeneratorHelpers.ts#L3) + +--- + +### generateInstantiableConfigFromConfig + +▸ **generateInstantiableConfigFromConfig**(`config`): `Promise`<`Partial`<[`InstantiableConfig`](interfaces/InstantiableConfig.md)\>\> + +#### Parameters + +| Name | Type | +| :------- | :-------------------------------------------------- | +| `config` | [`NeverminedOptions`](classes/NeverminedOptions.md) | + +#### Returns + +`Promise`<`Partial`<[`InstantiableConfig`](interfaces/InstantiableConfig.md)\>\> + +#### Defined in + +[src/Instantiable.abstract.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L16) + +--- + +### getCircularReplacer + +▸ **getCircularReplacer**(): (`key`: `any`, `value`: `any`) => `any` + +#### Returns + +`fn` + +▸ (`key`, `value`): `any` + +##### Parameters + +| Name | Type | +| :------ | :---- | +| `key` | `any` | +| `value` | `any` | + +##### Returns + +`any` + +#### Defined in + +[src/common/helpers.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/helpers.ts#L18) + +--- + +### getConditionsByParams + +▸ **getConditionsByParams**(`serviceType`, `conditions`, `owner`, `assetPrice?`, `did?`, `erc20TokenContract?`, `nftTokenContract?`, `nftHolder?`, `nftAmount?`, `nftTransfer?`, `duration?`, `fulfillAccessTimeout?`, `fulfillAccessTimelock?`, `tokenId?`): [`ServiceAgreementTemplateCondition`](interfaces/ServiceAgreementTemplateCondition.md)[] + +Fill some static parameters that depends on the metadata. + +#### Parameters + +| Name | Type | Default value | Description | +| :---------------------- | :------------------------------------------------------------------------------------------------ | :------------ | :----------------------- | +| `serviceType` | [`ServiceType`](code-reference.md#servicetype) | `undefined` | - | +| `conditions` | readonly [`ServiceAgreementTemplateCondition`](interfaces/ServiceAgreementTemplateCondition.md)[] | `undefined` | Conditions to fill. | +| `owner` | `string` | `undefined` | - | +| `assetPrice` | [`AssetPrice`](classes/AssetPrice.md) | `undefined` | Rewards distribution | +| `did?` | `string` | `undefined` | - | +| `erc20TokenContract?` | `string` | `undefined` | Number of nfts to handle | +| `nftTokenContract?` | `string` | `undefined` | Number of nfts to handle | +| `nftHolder?` | `string` | `undefined` | - | +| `nftAmount` | `bigint` | `undefined` | Number of nfts to handle | +| `nftTransfer` | `boolean` | `false` | - | +| `duration` | `number` | `0` | - | +| `fulfillAccessTimeout` | `number` | `0` | - | +| `fulfillAccessTimelock` | `number` | `0` | - | +| `tokenId` | `string` | `''` | - | + +#### Returns + +[`ServiceAgreementTemplateCondition`](interfaces/ServiceAgreementTemplateCondition.md)[] + +Filled conditions. + +#### Defined in + +[src/utils/DDOHelpers.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/DDOHelpers.ts#L25) + +--- + +### getNetworkName + +▸ **getNetworkName**(`networkId`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `networkId` | `number` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/utils.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L5) + +--- + +### getRoyaltyAttributes + +▸ **getRoyaltyAttributes**(`nvm`, `kind`, `amount`): [`RoyaltyAttributes`](interfaces/RoyaltyAttributes.md) + +It gets a `RoyaltyAttributes` instance + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------ | :----------------------------------------------------- | +| `nvm` | [`Nevermined`](classes/Nevermined.md) | Nevermined instance | +| `kind` | [`RoyaltyKind`](enums/RoyaltyKind.md) | The type of royalty | +| `amount` | `number` | The amount of royalties to get in the secondary market | + +#### Returns + +[`RoyaltyAttributes`](interfaces/RoyaltyAttributes.md) + +The RoyaltyAttributes instance + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:96](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L96) + +--- + +### getRoyaltyScheme + +▸ **getRoyaltyScheme**(`nvm`, `kind`): [`RoyaltyScheme`](classes/RoyaltyScheme.md) + +It gets the on-chain royalties scheme + +#### Parameters + +| Name | Type | Description | +| :----- | :------------------------------------ | :------------------ | +| `nvm` | [`Nevermined`](classes/Nevermined.md) | Nevermined instance | +| `kind` | [`RoyaltyKind`](enums/RoyaltyKind.md) | The type of royalty | + +#### Returns + +[`RoyaltyScheme`](classes/RoyaltyScheme.md) + +The royalty scheme + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:81](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L81) + +--- + +### jsonReplacer + +▸ **jsonReplacer**(`key`, `value`): `any` + +#### Parameters + +| Name | Type | +| :------ | :---- | +| `key` | `any` | +| `value` | `any` | + +#### Returns + +`any` + +#### Defined in + +[src/common/helpers.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/helpers.ts#L31) + +--- + +### makeAccount + +▸ **makeAccount**(`seedphrase`, `accountIndex?`): `ethers.Wallet` + +#### Parameters + +| Name | Type | Default value | +| :------------- | :------- | :------------ | +| `seedphrase` | `string` | `undefined` | +| `accountIndex` | `number` | `0` | + +#### Returns + +`ethers.Wallet` + +#### Defined in + +[src/utils/MakeAccounts.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/MakeAccounts.ts#L16) + +--- + +### makeAccounts + +▸ **makeAccounts**(`seedphrase`, `numAccounts?`): `ethers.Wallet`[] + +#### Parameters + +| Name | Type | Default value | +| :------------ | :------- | :------------ | +| `seedphrase` | `string` | `undefined` | +| `numAccounts` | `number` | `10` | + +#### Returns + +`ethers.Wallet`[] + +#### Defined in + +[src/utils/MakeAccounts.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/MakeAccounts.ts#L3) + +--- + +### makeBuffer + +▸ **makeBuffer**(`a`, `b`): `Buffer` + +#### Parameters + +| Name | Type | +| :--- | :---- | +| `a` | `any` | +| `b` | `any` | + +#### Returns + +`Buffer` + +#### Defined in + +[src/utils/index.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/index.ts#L12) + +--- + +### noDidPrefixed + +▸ **noDidPrefixed**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `input` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/ConversionTypeHelpers.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L14) + +--- + +### noZeroX + +▸ **noZeroX**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `input` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/ConversionTypeHelpers.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L5) + +--- + +### objectPromiseAll + +▸ **objectPromiseAll**(`obj`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :---- | :------- | +| `obj` | `Object` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[src/utils/PromiseResolver.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/PromiseResolver.ts#L11) + +--- + +### parseEther + +▸ **parseEther**(`value`): `bigint` + +Converts a ether _value_ into _wei_. + +#### Parameters + +| Name | Type | Description | +| :------ | :------- | :-------------------------- | +| `value` | `string` | The string value to convert | + +#### Returns + +`bigint` + +The BigInt representation of _value_ in _wei_ + +**`Example`** + +```ts +parseEther('1.0') +// 1000000000000000000n + +parseEther('-0.5') +// -500000000000000000n +``` + +#### Defined in + +[src/utils/UnitConversion.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/UnitConversion.ts#L19) + +--- + +### parseUnits + +▸ **parseUnits**(`value`, `decimals?`): `bigint` + +Returns a BigInt representation of value, parsed with _decimal_ digits. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------- | :------- | :------------ | :-------------------------- | +| `value` | `string` | `undefined` | The string value to convert | +| `decimals` | `number` | `18` | The number of decimals | + +#### Returns + +`bigint` + +The BigInt representation of _value_ parsed with _decimals_ + +**`Example`** + +```ts +parseUnits('1.0', 18) +// 1000000000000000000n + +parseUnits('121.0', 9) +// 121000000000n +``` + +#### Defined in + +[src/utils/UnitConversion.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/UnitConversion.ts#L39) + +--- + +### zeroX + +▸ **zeroX**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------- | +| `input` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/ConversionTypeHelpers.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L4) + +--- + +### zeroXTransformer + +▸ **zeroXTransformer**(`input?`, `zeroOutput`): `string` + +#### Parameters + +| Name | Type | Default value | +| :----------- | :-------- | :------------ | +| `input` | `string` | `''` | +| `zeroOutput` | `boolean` | `undefined` | + +#### Returns + +`string` #### Defined in -[src/utils/Logger.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L43) +[src/utils/ConversionTypeHelpers.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/ConversionTypeHelpers.ts#L7) diff --git a/docs/api-reference/enums/AccessStatus.md b/docs/api-reference/enums/AccessStatus.md new file mode 100644 index 000000000..247c97797 --- /dev/null +++ b/docs/api-reference/enums/AccessStatus.md @@ -0,0 +1,63 @@ +[@nevermined-io/sdk](../code-reference.md) / AccessStatus + +# Enumeration: AccessStatus + +## Table of contents + +### Enumeration Members + +- [Committed](AccessStatus.md#committed) +- [Delivered](AccessStatus.md#delivered) +- [Requested](AccessStatus.md#requested) +- [Revoked](AccessStatus.md#revoked) +- [Verified](AccessStatus.md#verified) + +## Enumeration Members + +### Committed + +• **Committed** = `1` + +#### Defined in + +[src/models/types.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L11) + +--- + +### Delivered + +• **Delivered** = `2` + +#### Defined in + +[src/models/types.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L12) + +--- + +### Requested + +• **Requested** = `0` + +#### Defined in + +[src/models/types.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L10) + +--- + +### Revoked + +• **Revoked** = `4` + +#### Defined in + +[src/models/types.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L14) + +--- + +### Verified + +• **Verified** = `3` + +#### Defined in + +[src/models/types.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L13) diff --git a/docs/api-reference/enums/AssetResult.md b/docs/api-reference/enums/AssetResult.md new file mode 100644 index 000000000..2a0627615 --- /dev/null +++ b/docs/api-reference/enums/AssetResult.md @@ -0,0 +1,41 @@ +[@nevermined-io/sdk](../code-reference.md) / AssetResult + +# Enumeration: AssetResult + +## Table of contents + +### Enumeration Members + +- [DATA](AssetResult.md#data) +- [DECRYPTED](AssetResult.md#decrypted) +- [URL](AssetResult.md#url) + +## Enumeration Members + +### DATA + +• **DATA** = `"data"` + +#### Defined in + +[src/services/node/NeverminedNode.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L19) + +--- + +### DECRYPTED + +• **DECRYPTED** = `"decrypted"` + +#### Defined in + +[src/services/node/NeverminedNode.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L20) + +--- + +### URL + +• **URL** = `"url"` + +#### Defined in + +[src/services/node/NeverminedNode.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L21) diff --git a/docs/api-reference/enums/ConditionState.md b/docs/api-reference/enums/ConditionState.md index 8c620ae6e..59cfd47b6 100644 --- a/docs/api-reference/enums/ConditionState.md +++ b/docs/api-reference/enums/ConditionState.md @@ -19,7 +19,7 @@ #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L14) +[src/keeper/contracts/conditions/Condition.abstract.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L13) --- @@ -29,7 +29,7 @@ #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L13) +[src/keeper/contracts/conditions/Condition.abstract.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L12) --- @@ -39,7 +39,7 @@ #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L12) +[src/keeper/contracts/conditions/Condition.abstract.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L11) --- @@ -49,4 +49,4 @@ #### Defined in -[src/keeper/contracts/conditions/Condition.abstract.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L11) +[src/keeper/contracts/conditions/Condition.abstract.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L10) diff --git a/docs/api-reference/enums/CreateProgressStep.md b/docs/api-reference/enums/CreateProgressStep.md index 4b1465254..fc872002d 100644 --- a/docs/api-reference/enums/CreateProgressStep.md +++ b/docs/api-reference/enums/CreateProgressStep.md @@ -8,6 +8,7 @@ - [ConditionsFilled](CreateProgressStep.md#conditionsfilled) - [DdoStored](CreateProgressStep.md#ddostored) +- [DdoStoredImmutable](CreateProgressStep.md#ddostoredimmutable) - [DidRegistered](CreateProgressStep.md#didregistered) - [EncryptingFiles](CreateProgressStep.md#encryptingfiles) - [FilesEncrypted](CreateProgressStep.md#filesencrypted) @@ -27,7 +28,7 @@ #### Defined in -[src/nevermined/Assets.ts:38](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L38) +[src/nevermined/ProgressSteps.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L5) --- @@ -37,17 +38,27 @@ #### Defined in -[src/nevermined/Assets.ts:45](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L45) +[src/nevermined/ProgressSteps.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L12) + +--- + +### DdoStoredImmutable + +• **DdoStoredImmutable** = `11` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L13) --- ### DidRegistered -• **DidRegistered** = `11` +• **DidRegistered** = `12` #### Defined in -[src/nevermined/Assets.ts:46](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L46) +[src/nevermined/ProgressSteps.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L14) --- @@ -57,7 +68,7 @@ #### Defined in -[src/nevermined/Assets.ts:39](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L39) +[src/nevermined/ProgressSteps.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L6) --- @@ -67,7 +78,7 @@ #### Defined in -[src/nevermined/Assets.ts:40](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L40) +[src/nevermined/ProgressSteps.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L7) --- @@ -77,7 +88,7 @@ #### Defined in -[src/nevermined/Assets.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L36) +[src/nevermined/ProgressSteps.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L3) --- @@ -87,7 +98,7 @@ #### Defined in -[src/nevermined/Assets.ts:37](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L37) +[src/nevermined/ProgressSteps.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L4) --- @@ -97,7 +108,7 @@ #### Defined in -[src/nevermined/Assets.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L41) +[src/nevermined/ProgressSteps.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L8) --- @@ -107,7 +118,7 @@ #### Defined in -[src/nevermined/Assets.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L35) +[src/nevermined/ProgressSteps.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L2) --- @@ -117,7 +128,7 @@ #### Defined in -[src/nevermined/Assets.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L43) +[src/nevermined/ProgressSteps.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L10) --- @@ -127,7 +138,7 @@ #### Defined in -[src/nevermined/Assets.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L42) +[src/nevermined/ProgressSteps.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L9) --- @@ -137,4 +148,4 @@ #### Defined in -[src/nevermined/Assets.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L44) +[src/nevermined/ProgressSteps.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L11) diff --git a/docs/api-reference/enums/DIDResolvePolicy.md b/docs/api-reference/enums/DIDResolvePolicy.md new file mode 100644 index 000000000..bab33380e --- /dev/null +++ b/docs/api-reference/enums/DIDResolvePolicy.md @@ -0,0 +1,71 @@ +[@nevermined-io/sdk](../code-reference.md) / DIDResolvePolicy + +# Enumeration: DIDResolvePolicy + +It described the policy to be used when resolving an asset. It has the following options: + +- ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API +- MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url +- OnlyImmutable - Try to resolve the metadata only from the immutable data store URL +- OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry +- NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain + +## Table of contents + +### Enumeration Members + +- [ImmutableFirst](DIDResolvePolicy.md#immutablefirst) +- [MetadataAPIFirst](DIDResolvePolicy.md#metadataapifirst) +- [NoRegistry](DIDResolvePolicy.md#noregistry) +- [OnlyImmutable](DIDResolvePolicy.md#onlyimmutable) +- [OnlyMetadataAPI](DIDResolvePolicy.md#onlymetadataapi) + +## Enumeration Members + +### ImmutableFirst + +• **ImmutableFirst** = `0` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L50) + +--- + +### MetadataAPIFirst + +• **MetadataAPIFirst** = `1` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:51](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L51) + +--- + +### NoRegistry + +• **NoRegistry** = `4` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L54) + +--- + +### OnlyImmutable + +• **OnlyImmutable** = `2` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:52](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L52) + +--- + +### OnlyMetadataAPI + +• **OnlyMetadataAPI** = `3` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L53) diff --git a/docs/api-reference/enums/ERCType.md b/docs/api-reference/enums/ERCType.md new file mode 100644 index 000000000..354dab75b --- /dev/null +++ b/docs/api-reference/enums/ERCType.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / ERCType + +# Enumeration: ERCType + +## Table of contents + +### Enumeration Members + +- [nft1155](ERCType.md#nft1155) +- [nft721](ERCType.md#nft721) + +## Enumeration Members + +### nft1155 + +• **nft1155** = `1155` + +#### Defined in + +[src/models/types.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L25) + +--- + +### nft721 + +• **nft721** = `721` + +#### Defined in + +[src/models/types.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L24) diff --git a/docs/api-reference/enums/ExecuteProgressStep.md b/docs/api-reference/enums/ExecuteProgressStep.md new file mode 100644 index 000000000..41517f46c --- /dev/null +++ b/docs/api-reference/enums/ExecuteProgressStep.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / ExecuteProgressStep + +# Enumeration: ExecuteProgressStep + +## Table of contents + +### Enumeration Members + +- [AgreementInitialized](ExecuteProgressStep.md#agreementinitialized) +- [CreatingAgreement](ExecuteProgressStep.md#creatingagreement) +- [LockedPayment](ExecuteProgressStep.md#lockedpayment) +- [LockingPayment](ExecuteProgressStep.md#lockingpayment) + +## Enumeration Members + +### AgreementInitialized + +• **AgreementInitialized** = `1` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L39) + +--- + +### CreatingAgreement + +• **CreatingAgreement** = `0` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L38) + +--- + +### LockedPayment + +• **LockedPayment** = `3` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L41) + +--- + +### LockingPayment + +• **LockingPayment** = `2` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L40) diff --git a/docs/api-reference/enums/ExternalResourceFileType.md b/docs/api-reference/enums/ExternalResourceFileType.md new file mode 100644 index 000000000..ddd425b2a --- /dev/null +++ b/docs/api-reference/enums/ExternalResourceFileType.md @@ -0,0 +1,74 @@ +[@nevermined-io/sdk](../code-reference.md) / ExternalResourceFileType + +# Enumeration: ExternalResourceFileType + +## Table of contents + +### Enumeration Members + +- [Avatar](ExternalResourceFileType.md#avatar) +- [CoverImage](ExternalResourceFileType.md#coverimage) +- [Other](ExternalResourceFileType.md#other) +- [Private](ExternalResourceFileType.md#private) +- [SampleData](ExternalResourceFileType.md#sampledata) +- [TermsAndConditions](ExternalResourceFileType.md#termsandconditions) + +## Enumeration Members + +### Avatar + +• **Avatar** = `"Avatar"` + +#### Defined in + +[src/ddo/types.ts:105](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L105) + +--- + +### CoverImage + +• **CoverImage** = `"CoverImage"` + +#### Defined in + +[src/ddo/types.ts:107](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L107) + +--- + +### Other + +• **Other** = `"Other"` + +#### Defined in + +[src/ddo/types.ts:110](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L110) + +--- + +### Private + +• **Private** = `"Private"` + +#### Defined in + +[src/ddo/types.ts:106](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L106) + +--- + +### SampleData + +• **SampleData** = `"SampleData"` + +#### Defined in + +[src/ddo/types.ts:109](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L109) + +--- + +### TermsAndConditions + +• **TermsAndConditions** = `"TermsAndConditions"` + +#### Defined in + +[src/ddo/types.ts:108](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L108) diff --git a/docs/api-reference/enums/ImmutableBackends.md b/docs/api-reference/enums/ImmutableBackends.md new file mode 100644 index 000000000..d9c8dbe0e --- /dev/null +++ b/docs/api-reference/enums/ImmutableBackends.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / ImmutableBackends + +# Enumeration: ImmutableBackends + +## Table of contents + +### Enumeration Members + +- [Filecoin](ImmutableBackends.md#filecoin) +- [IPFS](ImmutableBackends.md#ipfs) + +## Enumeration Members + +### Filecoin + +• **Filecoin** = `"filecoin"` + +#### Defined in + +[src/ddo/types.ts:523](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L523) + +--- + +### IPFS + +• **IPFS** = `"ipfs"` + +#### Defined in + +[src/ddo/types.ts:524](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L524) diff --git a/docs/api-reference/enums/utils.LogLevel.md b/docs/api-reference/enums/LogLevel.md similarity index 58% rename from docs/api-reference/enums/utils.LogLevel.md rename to docs/api-reference/enums/LogLevel.md index ed555f79d..12561dc9f 100644 --- a/docs/api-reference/enums/utils.LogLevel.md +++ b/docs/api-reference/enums/LogLevel.md @@ -1,18 +1,16 @@ -[@nevermined-io/sdk](../code-reference.md) / [utils](../modules/utils.md) / LogLevel +[@nevermined-io/sdk](../code-reference.md) / LogLevel # Enumeration: LogLevel -[utils](../modules/utils.md).LogLevel - ## Table of contents ### Enumeration Members -- [Error](utils.LogLevel.md#error) -- [Log](utils.LogLevel.md#log) -- [None](utils.LogLevel.md#none) -- [Verbose](utils.LogLevel.md#verbose) -- [Warn](utils.LogLevel.md#warn) +- [Error](LogLevel.md#error) +- [Log](LogLevel.md#log) +- [None](LogLevel.md#none) +- [Verbose](LogLevel.md#verbose) +- [Warn](LogLevel.md#warn) ## Enumeration Members @@ -22,7 +20,7 @@ #### Defined in -[src/utils/Logger.ts:3](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L3) +[src/utils/Logger.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/Logger.ts#L3) --- @@ -32,7 +30,7 @@ #### Defined in -[src/utils/Logger.ts:5](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L5) +[src/utils/Logger.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/Logger.ts#L5) --- @@ -42,7 +40,7 @@ #### Defined in -[src/utils/Logger.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L2) +[src/utils/Logger.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/Logger.ts#L2) --- @@ -52,7 +50,7 @@ #### Defined in -[src/utils/Logger.ts:6](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L6) +[src/utils/Logger.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/Logger.ts#L6) --- @@ -62,4 +60,4 @@ #### Defined in -[src/utils/Logger.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Logger.ts#L4) +[src/utils/Logger.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/utils/Logger.ts#L4) diff --git a/docs/api-reference/enums/NeverminedNFT1155Type.md b/docs/api-reference/enums/NeverminedNFT1155Type.md new file mode 100644 index 000000000..42feba082 --- /dev/null +++ b/docs/api-reference/enums/NeverminedNFT1155Type.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / NeverminedNFT1155Type + +# Enumeration: NeverminedNFT1155Type + +## Table of contents + +### Enumeration Members + +- [nft1155](NeverminedNFT1155Type.md#nft1155) +- [nft1155Credit](NeverminedNFT1155Type.md#nft1155credit) + +## Enumeration Members + +### nft1155 + +• **nft1155** = `"nft1155"` + +#### Defined in + +[src/models/types.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L36) + +--- + +### nft1155Credit + +• **nft1155Credit** = `"nft1155-credit"` + +#### Defined in + +[src/models/types.ts:37](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L37) diff --git a/docs/api-reference/enums/NeverminedNFT721Type.md b/docs/api-reference/enums/NeverminedNFT721Type.md new file mode 100644 index 000000000..ff8bc5e61 --- /dev/null +++ b/docs/api-reference/enums/NeverminedNFT721Type.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / NeverminedNFT721Type + +# Enumeration: NeverminedNFT721Type + +## Table of contents + +### Enumeration Members + +- [nft721](NeverminedNFT721Type.md#nft721) +- [nft721POAP](NeverminedNFT721Type.md#nft721poap) +- [nft721SoulBound](NeverminedNFT721Type.md#nft721soulbound) +- [nft721Subscription](NeverminedNFT721Type.md#nft721subscription) + +## Enumeration Members + +### nft721 + +• **nft721** = `"nft721"` + +#### Defined in + +[src/models/types.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L29) + +--- + +### nft721POAP + +• **nft721POAP** = `"nft721-poap"` + +#### Defined in + +[src/models/types.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L31) + +--- + +### nft721SoulBound + +• **nft721SoulBound** = `"nft721-soulbound"` + +#### Defined in + +[src/models/types.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L32) + +--- + +### nft721Subscription + +• **nft721Subscription** = `"nft721-subscription"` + +#### Defined in + +[src/models/types.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L30) diff --git a/docs/api-reference/enums/NodeUploadBackends.md b/docs/api-reference/enums/NodeUploadBackends.md new file mode 100644 index 000000000..acb30c0fa --- /dev/null +++ b/docs/api-reference/enums/NodeUploadBackends.md @@ -0,0 +1,41 @@ +[@nevermined-io/sdk](../code-reference.md) / NodeUploadBackends + +# Enumeration: NodeUploadBackends + +## Table of contents + +### Enumeration Members + +- [AmazonS3](NodeUploadBackends.md#amazons3) +- [Filecoin](NodeUploadBackends.md#filecoin) +- [IPFS](NodeUploadBackends.md#ipfs) + +## Enumeration Members + +### AmazonS3 + +• **AmazonS3** = `"s3"` + +#### Defined in + +[src/services/node/NeverminedNode.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L15) + +--- + +### Filecoin + +• **Filecoin** = `"filecoin"` + +#### Defined in + +[src/services/node/NeverminedNode.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L13) + +--- + +### IPFS + +• **IPFS** = `"ipfs"` + +#### Defined in + +[src/services/node/NeverminedNode.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L14) diff --git a/docs/api-reference/enums/OrderProgressStep.md b/docs/api-reference/enums/OrderProgressStep.md index 1affbfe2f..53f9a83c5 100644 --- a/docs/api-reference/enums/OrderProgressStep.md +++ b/docs/api-reference/enums/OrderProgressStep.md @@ -7,6 +7,8 @@ ### Enumeration Members - [AgreementInitialized](OrderProgressStep.md#agreementinitialized) +- [ApprovedPayment](OrderProgressStep.md#approvedpayment) +- [ApprovingPayment](OrderProgressStep.md#approvingpayment) - [CreatingAgreement](OrderProgressStep.md#creatingagreement) - [LockedPayment](OrderProgressStep.md#lockedpayment) - [LockingPayment](OrderProgressStep.md#lockingpayment) @@ -15,38 +17,58 @@ ### AgreementInitialized -• **AgreementInitialized** = `1` +• **AgreementInitialized** = `5` #### Defined in -[src/nevermined/Assets.ts:51](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L51) +[src/nevermined/ProgressSteps.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L34) + +--- + +### ApprovedPayment + +• **ApprovedPayment** = `3` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L32) + +--- + +### ApprovingPayment + +• **ApprovingPayment** = `2` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L31) --- ### CreatingAgreement -• **CreatingAgreement** = `0` +• **CreatingAgreement** = `4` #### Defined in -[src/nevermined/Assets.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L50) +[src/nevermined/ProgressSteps.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L33) --- ### LockedPayment -• **LockedPayment** = `3` +• **LockedPayment** = `1` #### Defined in -[src/nevermined/Assets.ts:53](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L53) +[src/nevermined/ProgressSteps.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L30) --- ### LockingPayment -• **LockingPayment** = `2` +• **LockingPayment** = `0` #### Defined in -[src/nevermined/Assets.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Assets.ts#L52) +[src/nevermined/ProgressSteps.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L29) diff --git a/docs/api-reference/enums/PermissionType.md b/docs/api-reference/enums/PermissionType.md index 9ddecd8a4..11fb48347 100644 --- a/docs/api-reference/enums/PermissionType.md +++ b/docs/api-reference/enums/PermissionType.md @@ -19,7 +19,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:5](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L5) +[src/services/metadata/types.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L16) --- @@ -29,7 +29,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L4) +[src/services/metadata/types.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L15) --- @@ -39,7 +39,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L2) +[src/services/metadata/types.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L13) --- @@ -49,4 +49,4 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:3](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L3) +[src/services/metadata/types.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L14) diff --git a/docs/api-reference/enums/PlatformTechStatus.md b/docs/api-reference/enums/PlatformTechStatus.md index 571652294..e108b0060 100644 --- a/docs/api-reference/enums/PlatformTechStatus.md +++ b/docs/api-reference/enums/PlatformTechStatus.md @@ -19,7 +19,7 @@ #### Defined in -[src/nevermined/Versions.ts:6](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L6) +[src/nevermined/Versions.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L6) --- @@ -29,7 +29,7 @@ #### Defined in -[src/nevermined/Versions.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L8) +[src/nevermined/Versions.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L8) --- @@ -39,7 +39,7 @@ #### Defined in -[src/nevermined/Versions.ts:7](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L7) +[src/nevermined/Versions.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L7) --- @@ -49,4 +49,4 @@ #### Defined in -[src/nevermined/Versions.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L9) +[src/nevermined/Versions.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L9) diff --git a/docs/api-reference/enums/ProvenanceMethod.md b/docs/api-reference/enums/ProvenanceMethod.md index 07d1e9d1c..824c64150 100644 --- a/docs/api-reference/enums/ProvenanceMethod.md +++ b/docs/api-reference/enums/ProvenanceMethod.md @@ -28,7 +28,7 @@ #### Defined in -[src/keeper.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L20) +[src/keeper/contracts/Provenance.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L24) --- @@ -38,7 +38,7 @@ #### Defined in -[src/keeper.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L9) +[src/keeper/contracts/Provenance.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L13) --- @@ -48,7 +48,7 @@ #### Defined in -[src/keeper.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L17) +[src/keeper/contracts/Provenance.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L21) --- @@ -58,7 +58,7 @@ #### Defined in -[src/keeper.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L8) +[src/keeper/contracts/Provenance.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L12) --- @@ -68,7 +68,7 @@ #### Defined in -[src/keeper.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L11) +[src/keeper/contracts/Provenance.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L15) --- @@ -78,7 +78,7 @@ #### Defined in -[src/keeper.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L19) +[src/keeper/contracts/Provenance.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L23) --- @@ -88,7 +88,7 @@ #### Defined in -[src/keeper.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L18) +[src/keeper/contracts/Provenance.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L22) --- @@ -98,7 +98,7 @@ #### Defined in -[src/keeper.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L16) +[src/keeper/contracts/Provenance.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L20) --- @@ -108,7 +108,7 @@ #### Defined in -[src/keeper.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L14) +[src/keeper/contracts/Provenance.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L18) --- @@ -118,7 +118,7 @@ #### Defined in -[src/keeper.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L10) +[src/keeper/contracts/Provenance.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L14) --- @@ -128,7 +128,7 @@ #### Defined in -[src/keeper.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L12) +[src/keeper/contracts/Provenance.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L16) --- @@ -138,7 +138,7 @@ #### Defined in -[src/keeper.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L15) +[src/keeper/contracts/Provenance.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L19) --- @@ -148,4 +148,4 @@ #### Defined in -[src/keeper.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L13) +[src/keeper/contracts/Provenance.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L17) diff --git a/docs/api-reference/enums/PublishMetadataOptions.md b/docs/api-reference/enums/PublishMetadataOptions.md new file mode 100644 index 000000000..80b01519f --- /dev/null +++ b/docs/api-reference/enums/PublishMetadataOptions.md @@ -0,0 +1,59 @@ +[@nevermined-io/sdk](../code-reference.md) / PublishMetadataOptions + +# Enumeration: PublishMetadataOptions + +Where the metadata will be published. Options: + +- OnlyMetadataAPI, The metadata will be stored only in the Metadata/Marketplace API +- IPFS, The metadata will be stored in the Metadata/Marketplace API and IPFS +- Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin +- Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave + +## Table of contents + +### Enumeration Members + +- [Arweave](PublishMetadataOptions.md#arweave) +- [Filecoin](PublishMetadataOptions.md#filecoin) +- [IPFS](PublishMetadataOptions.md#ipfs) +- [OnlyMetadataAPI](PublishMetadataOptions.md#onlymetadataapi) + +## Enumeration Members + +### Arweave + +• **Arweave** = `3` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L25) + +--- + +### Filecoin + +• **Filecoin** = `2` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L24) + +--- + +### IPFS + +• **IPFS** = `1` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L23) + +--- + +### OnlyMetadataAPI + +• **OnlyMetadataAPI** = `0` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L22) diff --git a/docs/api-reference/enums/PublishOnChainOptions.md b/docs/api-reference/enums/PublishOnChainOptions.md new file mode 100644 index 000000000..6ff4fc108 --- /dev/null +++ b/docs/api-reference/enums/PublishOnChainOptions.md @@ -0,0 +1,32 @@ +[@nevermined-io/sdk](../code-reference.md) / PublishOnChainOptions + +# Enumeration: PublishOnChainOptions + +It specifies if the DID will be published on-chain initially or not. + +## Table of contents + +### Enumeration Members + +- [DIDRegistry](PublishOnChainOptions.md#didregistry) +- [OnlyOffchain](PublishOnChainOptions.md#onlyoffchain) + +## Enumeration Members + +### DIDRegistry + +• **DIDRegistry** = `0` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L32) + +--- + +### OnlyOffchain + +• **OnlyOffchain** = `1` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L33) diff --git a/docs/api-reference/enums/RoyaltyKind.md b/docs/api-reference/enums/RoyaltyKind.md new file mode 100644 index 000000000..43f404559 --- /dev/null +++ b/docs/api-reference/enums/RoyaltyKind.md @@ -0,0 +1,43 @@ +[@nevermined-io/sdk](../code-reference.md) / RoyaltyKind + +# Enumeration: RoyaltyKind + +The type of royalty + +## Table of contents + +### Enumeration Members + +- [Curve](RoyaltyKind.md#curve) +- [Legacy](RoyaltyKind.md#legacy) +- [Standard](RoyaltyKind.md#standard) + +## Enumeration Members + +### Curve + +• **Curve** = `1` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:71](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L71) + +--- + +### Legacy + +• **Legacy** = `2` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:72](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L72) + +--- + +### Standard + +• **Standard** = `0` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:70](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L70) diff --git a/docs/api-reference/enums/State.md b/docs/api-reference/enums/State.md index c360c9f09..8aa17e0b2 100644 --- a/docs/api-reference/enums/State.md +++ b/docs/api-reference/enums/State.md @@ -18,7 +18,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L4) +[src/services/metadata/types.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L34) --- @@ -28,7 +28,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L2) +[src/services/metadata/types.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L32) --- @@ -38,4 +38,4 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:3](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L3) +[src/services/metadata/types.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L33) diff --git a/docs/api-reference/enums/TemplateState.md b/docs/api-reference/enums/TemplateState.md new file mode 100644 index 000000000..08a5fac73 --- /dev/null +++ b/docs/api-reference/enums/TemplateState.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / TemplateState + +# Enumeration: TemplateState + +## Table of contents + +### Enumeration Members + +- [Approved](TemplateState.md#approved) +- [Proposed](TemplateState.md#proposed) +- [Revoked](TemplateState.md#revoked) +- [Uninitialized](TemplateState.md#uninitialized) + +## Enumeration Members + +### Approved + +• **Approved** = `2` + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L9) + +--- + +### Proposed + +• **Proposed** = `1` + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L8) + +--- + +### Revoked + +• **Revoked** = `3` + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L10) + +--- + +### Uninitialized + +• **Uninitialized** = `0` + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L7) diff --git a/docs/api-reference/enums/UpdateProgressStep.md b/docs/api-reference/enums/UpdateProgressStep.md new file mode 100644 index 000000000..a43d67282 --- /dev/null +++ b/docs/api-reference/enums/UpdateProgressStep.md @@ -0,0 +1,96 @@ +[@nevermined-io/sdk](../code-reference.md) / UpdateProgressStep + +# Enumeration: UpdateProgressStep + +## Table of contents + +### Enumeration Members + +- [AddVersionInDDO](UpdateProgressStep.md#addversioninddo) +- [AssetUpdated](UpdateProgressStep.md#assetupdated) +- [CalculateChecksum](UpdateProgressStep.md#calculatechecksum) +- [ResolveAsset](UpdateProgressStep.md#resolveasset) +- [StoringDDOMarketplaceAPI](UpdateProgressStep.md#storingddomarketplaceapi) +- [StoringImmutableDDO](UpdateProgressStep.md#storingimmutableddo) +- [UpdateMetadataInDDO](UpdateProgressStep.md#updatemetadatainddo) +- [UpdatingAssetOnChain](UpdateProgressStep.md#updatingassetonchain) + +## Enumeration Members + +### AddVersionInDDO + +• **AddVersionInDDO** = `2` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L20) + +--- + +### AssetUpdated + +• **AssetUpdated** = `7` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L25) + +--- + +### CalculateChecksum + +• **CalculateChecksum** = `3` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L21) + +--- + +### ResolveAsset + +• **ResolveAsset** = `0` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L18) + +--- + +### StoringDDOMarketplaceAPI + +• **StoringDDOMarketplaceAPI** = `6` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L24) + +--- + +### StoringImmutableDDO + +• **StoringImmutableDDO** = `4` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L22) + +--- + +### UpdateMetadataInDDO + +• **UpdateMetadataInDDO** = `1` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L19) + +--- + +### UpdatingAssetOnChain + +• **UpdatingAssetOnChain** = `5` + +#### Defined in + +[src/nevermined/ProgressSteps.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/ProgressSteps.ts#L23) diff --git a/docs/api-reference/enums/ValueType.md b/docs/api-reference/enums/ValueType.md new file mode 100644 index 000000000..e762704c0 --- /dev/null +++ b/docs/api-reference/enums/ValueType.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / ValueType + +# Enumeration: ValueType + +## Table of contents + +### Enumeration Members + +- [DDO](ValueType.md#ddo) +- [DID](ValueType.md#did) +- [DIDRef](ValueType.md#didref) +- [URL](ValueType.md#url) + +## Enumeration Members + +### DDO + +• **DDO** = `3` + +#### Defined in + +[src/models/types.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L58) + +--- + +### DID + +• **DID** = `0` + +#### Defined in + +[src/models/types.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L55) + +--- + +### DIDRef + +• **DIDRef** = `1` + +#### Defined in + +[src/models/types.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L56) + +--- + +### URL + +• **URL** = `2` + +#### Defined in + +[src/models/types.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L57) diff --git a/docs/api-reference/enums/utils.OrderProgressStep.md b/docs/api-reference/enums/utils.OrderProgressStep.md deleted file mode 100644 index 062d67956..000000000 --- a/docs/api-reference/enums/utils.OrderProgressStep.md +++ /dev/null @@ -1,54 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [utils](../modules/utils.md) / OrderProgressStep - -# Enumeration: OrderProgressStep - -[utils](../modules/utils.md).OrderProgressStep - -## Table of contents - -### Enumeration Members - -- [AgreementInitialized](utils.OrderProgressStep.md#agreementinitialized) -- [ApprovedPayment](utils.OrderProgressStep.md#approvedpayment) -- [ApprovingPayment](utils.OrderProgressStep.md#approvingpayment) -- [CreatingAgreement](utils.OrderProgressStep.md#creatingagreement) - -## Enumeration Members - -### AgreementInitialized - -• **AgreementInitialized** = `3` - -#### Defined in - -[src/utils/index.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/index.ts#L20) - ---- - -### ApprovedPayment - -• **ApprovedPayment** = `1` - -#### Defined in - -[src/utils/index.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/index.ts#L18) - ---- - -### ApprovingPayment - -• **ApprovingPayment** = `0` - -#### Defined in - -[src/utils/index.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/index.ts#L17) - ---- - -### CreatingAgreement - -• **CreatingAgreement** = `2` - -#### Defined in - -[src/utils/index.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/index.ts#L19) diff --git a/docs/api-reference/interfaces/AaveConfig.md b/docs/api-reference/interfaces/AaveConfig.md new file mode 100644 index 000000000..09b90fe38 --- /dev/null +++ b/docs/api-reference/interfaces/AaveConfig.md @@ -0,0 +1,63 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveConfig + +# Interface: AaveConfig + +## Table of contents + +### Properties + +- [agreementFee](AaveConfig.md#agreementfee) +- [dataProviderAddress](AaveConfig.md#dataprovideraddress) +- [lendingPoolAddress](AaveConfig.md#lendingpooladdress) +- [treasuryAddress](AaveConfig.md#treasuryaddress) +- [wethAddress](AaveConfig.md#wethaddress) + +## Properties + +### agreementFee + +• **agreementFee**: `number` + +#### Defined in + +[src/models/types.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L6) + +--- + +### dataProviderAddress + +• **dataProviderAddress**: `string` + +#### Defined in + +[src/models/types.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L3) + +--- + +### lendingPoolAddress + +• **lendingPoolAddress**: `string` + +#### Defined in + +[src/models/types.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L2) + +--- + +### treasuryAddress + +• **treasuryAddress**: `string` + +#### Defined in + +[src/models/types.ts:5](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L5) + +--- + +### wethAddress + +• **wethAddress**: `string` + +#### Defined in + +[src/models/types.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L4) diff --git a/docs/api-reference/interfaces/AaveCreditTemplateParams.md b/docs/api-reference/interfaces/AaveCreditTemplateParams.md new file mode 100644 index 000000000..499c610c3 --- /dev/null +++ b/docs/api-reference/interfaces/AaveCreditTemplateParams.md @@ -0,0 +1,151 @@ +[@nevermined-io/sdk](../code-reference.md) / AaveCreditTemplateParams + +# Interface: AaveCreditTemplateParams + +## Table of contents + +### Properties + +- [amountToBorrow](AaveCreditTemplateParams.md#amounttoborrow) +- [amountToRepay](AaveCreditTemplateParams.md#amounttorepay) +- [assetToBorrow](AaveCreditTemplateParams.md#assettoborrow) +- [assetToRepay](AaveCreditTemplateParams.md#assettorepay) +- [collateralAmount](AaveCreditTemplateParams.md#collateralamount) +- [collateralAsset](AaveCreditTemplateParams.md#collateralasset) +- [delegatedAmount](AaveCreditTemplateParams.md#delegatedamount) +- [delegatedAsset](AaveCreditTemplateParams.md#delegatedasset) +- [interestRateMode](AaveCreditTemplateParams.md#interestratemode) +- [lockAddress](AaveCreditTemplateParams.md#lockaddress) +- [nftAmount](AaveCreditTemplateParams.md#nftamount) +- [nftContractAddress](AaveCreditTemplateParams.md#nftcontractaddress) +- [vaultAddress](AaveCreditTemplateParams.md#vaultaddress) + +## Properties + +### amountToBorrow + +• **amountToBorrow**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L25) + +--- + +### amountToRepay + +• **amountToRepay**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L32) + +--- + +### assetToBorrow + +• **assetToBorrow**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L24) + +--- + +### assetToRepay + +• **assetToRepay**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L31) + +--- + +### collateralAmount + +• **collateralAmount**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L28) + +--- + +### collateralAsset + +• **collateralAsset**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L27) + +--- + +### delegatedAmount + +• **delegatedAmount**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L30) + +--- + +### delegatedAsset + +• **delegatedAsset**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L29) + +--- + +### interestRateMode + +• **interestRateMode**: `number` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L26) + +--- + +### lockAddress + +• **lockAddress**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L34) + +--- + +### nftAmount + +• **nftAmount**: `number` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L35) + +--- + +### nftContractAddress + +• **nftContractAddress**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L33) + +--- + +### vaultAddress + +• **vaultAddress**: `string` + +#### Defined in + +[src/keeper/contracts/defi/AaveCreditTemplate.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/AaveCreditTemplate.ts#L23) diff --git a/docs/api-reference/interfaces/AccessProofTemplateParams.md b/docs/api-reference/interfaces/AccessProofTemplateParams.md new file mode 100644 index 000000000..4dd038955 --- /dev/null +++ b/docs/api-reference/interfaces/AccessProofTemplateParams.md @@ -0,0 +1,41 @@ +[@nevermined-io/sdk](../code-reference.md) / AccessProofTemplateParams + +# Interface: AccessProofTemplateParams + +## Table of contents + +### Properties + +- [consumer](AccessProofTemplateParams.md#consumer) +- [consumerId](AccessProofTemplateParams.md#consumerid) +- [type](AccessProofTemplateParams.md#type) + +## Properties + +### consumer + +• **consumer**: [`Account`](../classes/Account.md) + +#### Defined in + +[src/nevermined/AccessService.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L26) + +--- + +### consumerId + +• **consumerId**: `string` + +#### Defined in + +[src/nevermined/AccessService.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L27) + +--- + +### type + +• **type**: `"access-proof"` + +#### Defined in + +[src/nevermined/AccessService.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/AccessService.ts#L25) diff --git a/docs/api-reference/interfaces/ActedOnBehalfEvent.md b/docs/api-reference/interfaces/ActedOnBehalfEvent.md new file mode 100644 index 000000000..2c74d5cd9 --- /dev/null +++ b/docs/api-reference/interfaces/ActedOnBehalfEvent.md @@ -0,0 +1,137 @@ +[@nevermined-io/sdk](../code-reference.md) / ActedOnBehalfEvent + +# Interface: ActedOnBehalfEvent + +## Hierarchy + +- [`ProvenanceBaseEvent`](ProvenanceBaseEvent.md) + + ↳ **`ActedOnBehalfEvent`** + +## Table of contents + +### Properties + +- [activityId](ActedOnBehalfEvent.md#activityid) +- [attributes](ActedOnBehalfEvent.md#attributes) +- [blockNumberUpdated](ActedOnBehalfEvent.md#blocknumberupdated) +- [delegateAgentId](ActedOnBehalfEvent.md#delegateagentid) +- [entityDid](ActedOnBehalfEvent.md#entitydid) +- [event](ActedOnBehalfEvent.md#event) +- [method](ActedOnBehalfEvent.md#method) +- [provId](ActedOnBehalfEvent.md#provid) +- [responsibleAgentId](ActedOnBehalfEvent.md#responsibleagentid) + +## Properties + +### activityId + +• **activityId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[activityId](ProvenanceBaseEvent.md#activityid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L55) + +--- + +### attributes + +• `Optional` **attributes**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[attributes](ProvenanceBaseEvent.md#attributes) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L57) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[blockNumberUpdated](ProvenanceBaseEvent.md#blocknumberupdated) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L58) + +--- + +### delegateAgentId + +• **delegateAgentId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:79](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L79) + +--- + +### entityDid + +• **entityDid**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:78](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L78) + +--- + +### event + +• **event**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[event](ProvenanceBaseEvent.md#event) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L53) + +--- + +### method + +• **method**: [`ProvenanceMethod`](../enums/ProvenanceMethod.md) + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[method](ProvenanceBaseEvent.md#method) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L54) + +--- + +### provId + +• **provId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[provId](ProvenanceBaseEvent.md#provid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L56) + +--- + +### responsibleAgentId + +• **responsibleAgentId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L80) diff --git a/docs/api-reference/interfaces/AdditionalInformation.md b/docs/api-reference/interfaces/AdditionalInformation.md index f75b5fc81..031dbe7dc 100644 --- a/docs/api-reference/interfaces/AdditionalInformation.md +++ b/docs/api-reference/interfaces/AdditionalInformation.md @@ -13,6 +13,7 @@ https://github.com/nevermined-io/docs/blob/master/docs/architecture/specs/metada ### Properties - [categories](AdditionalInformation.md#categories) +- [cipher](AdditionalInformation.md#cipher) - [copyrightHolder](AdditionalInformation.md#copyrightholder) - [customData](AdditionalInformation.md#customdata) - [description](AdditionalInformation.md#description) @@ -21,6 +22,7 @@ https://github.com/nevermined-io/docs/blob/master/docs/architecture/specs/metada - [poseidonHash](AdditionalInformation.md#poseidonhash) - [priceHighestDenomination](AdditionalInformation.md#pricehighestdenomination) - [providerKey](AdditionalInformation.md#providerkey) +- [secretId](AdditionalInformation.md#secretid) - [structuredMarkup](AdditionalInformation.md#structuredmarkup) - [tags](AdditionalInformation.md#tags) - [updateFrequency](AdditionalInformation.md#updatefrequency) @@ -42,7 +44,17 @@ Categories used to describe this content. Empty by default. #### Defined in -[src/ddo/MetaData.ts:285](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L285) +[src/ddo/types.ts:374](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L374) + +--- + +### cipher + +• `Optional` **cipher**: `string` + +#### Defined in + +[src/ddo/types.ts:408](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L408) --- @@ -60,7 +72,7 @@ The party holding the legal copyright. Empty by default. #### Defined in -[src/ddo/MetaData.ts:245](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L245) +[src/ddo/types.ts:334](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L334) --- @@ -77,7 +89,7 @@ Can be used to store any non-default data, needs to be checked #### Defined in -[src/ddo/MetaData.ts:314](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L314) +[src/ddo/types.ts:403](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L403) --- @@ -96,7 +108,7 @@ explains what the data represents and what it can be used for. #### Defined in -[src/ddo/MetaData.ts:239](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L239) +[src/ddo/types.ts:328](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L328) --- @@ -115,7 +127,7 @@ codes from the [IETF BCP 47 standard](https://tools.ietf.org/html/bcp47). #### Defined in -[src/ddo/MetaData.ts:279](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L279) +[src/ddo/types.ts:368](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L368) --- @@ -145,7 +157,7 @@ to be domain-specific. #### Defined in -[src/ddo/MetaData.ts:272](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L272) +[src/ddo/types.ts:361](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L361) --- @@ -155,7 +167,7 @@ to be domain-specific. #### Defined in -[src/ddo/MetaData.ts:318](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L318) +[src/ddo/types.ts:407](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L407) --- @@ -173,7 +185,7 @@ BigNumbers #### Defined in -[src/ddo/MetaData.ts:333](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L333) +[src/ddo/types.ts:428](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L428) --- @@ -190,7 +202,24 @@ BigNumbers #### Defined in -[src/ddo/MetaData.ts:320](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L320) +[src/ddo/types.ts:410](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L410) + +--- + +### secretId + +• `Optional` **secretId**: `Object` + +#### Type declaration + +| Name | Type | +| :--- | :------- | +| `x` | `string` | +| `y` | `string` | + +#### Defined in + +[src/ddo/types.ts:415](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L415) --- @@ -203,7 +232,7 @@ describing the dataset. #### Defined in -[src/ddo/MetaData.ts:305](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L305) +[src/ddo/types.ts:394](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L394) --- @@ -221,7 +250,7 @@ Keywords or tags used to describe this content. Empty by default. #### Defined in -[src/ddo/MetaData.ts:291](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L291) +[src/ddo/types.ts:380](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L380) --- @@ -241,7 +270,7 @@ to get updated. #### Defined in -[src/ddo/MetaData.ts:299](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L299) +[src/ddo/types.ts:388](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L388) --- @@ -260,4 +289,4 @@ of the metadata, not an external link. #### Defined in -[src/ddo/MetaData.ts:252](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L252) +[src/ddo/types.ts:341](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L341) diff --git a/docs/api-reference/interfaces/templates.AgreementConditionsStatus.md b/docs/api-reference/interfaces/AgreementConditionsStatus.md similarity index 58% rename from docs/api-reference/interfaces/templates.AgreementConditionsStatus.md rename to docs/api-reference/interfaces/AgreementConditionsStatus.md index 2b5c3afab..03ba84eb7 100644 --- a/docs/api-reference/interfaces/templates.AgreementConditionsStatus.md +++ b/docs/api-reference/interfaces/AgreementConditionsStatus.md @@ -1,9 +1,7 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / AgreementConditionsStatus +[@nevermined-io/sdk](../code-reference.md) / AgreementConditionsStatus # Interface: AgreementConditionsStatus -[templates](../modules/templates.md).AgreementConditionsStatus - ## Indexable ▪ [condition: `string`]: { `blocked`: `boolean` ; `blockedBy`: `string`[] ; `condition`: `string` ; `contractName`: `string` ; `state`: [`ConditionState`](../enums/ConditionState.md) } diff --git a/docs/api-reference/interfaces/AgreementData.md b/docs/api-reference/interfaces/AgreementData.md new file mode 100644 index 000000000..61e418af8 --- /dev/null +++ b/docs/api-reference/interfaces/AgreementData.md @@ -0,0 +1,96 @@ +[@nevermined-io/sdk](../code-reference.md) / AgreementData + +# Interface: AgreementData + +## Table of contents + +### Properties + +- [agreementId](AgreementData.md#agreementid) +- [agreementIdSeed](AgreementData.md#agreementidseed) +- [conditionIdSeeds](AgreementData.md#conditionidseeds) +- [conditionIds](AgreementData.md#conditionids) +- [creator](AgreementData.md#creator) +- [did](AgreementData.md#did) +- [didOwner](AgreementData.md#didowner) +- [templateId](AgreementData.md#templateid) + +## Properties + +### agreementId + +• **agreementId**: `string` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L9) + +--- + +### agreementIdSeed + +• **agreementIdSeed**: `string` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L10) + +--- + +### conditionIdSeeds + +• **conditionIdSeeds**: `string`[] + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L15) + +--- + +### conditionIds + +• **conditionIds**: `string`[] + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L14) + +--- + +### creator + +• **creator**: `string` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L11) + +--- + +### did + +• **did**: `string` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L8) + +--- + +### didOwner + +• **didOwner**: `string` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L12) + +--- + +### templateId + +• **templateId**: `string` + +#### Defined in + +[src/keeper/contracts/managers/AgreementStoreManager.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/AgreementStoreManager.ts#L13) diff --git a/docs/api-reference/interfaces/AgreementInstance.md b/docs/api-reference/interfaces/AgreementInstance.md new file mode 100644 index 000000000..5e7f701eb --- /dev/null +++ b/docs/api-reference/interfaces/AgreementInstance.md @@ -0,0 +1,47 @@ +[@nevermined-io/sdk](../code-reference.md) / AgreementInstance + +# Interface: AgreementInstance + +## Type parameters + +| Name | +| :------- | +| `Params` | + +## Table of contents + +### Properties + +- [agreementId](AgreementInstance.md#agreementid) +- [instances](AgreementInstance.md#instances) +- [list](AgreementInstance.md#list) + +## Properties + +### agreementId + +• **agreementId**: `string` + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L39) + +--- + +### instances + +• **instances**: [`ConditionInstanceSmall`](ConditionInstanceSmall.md)[] + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L40) + +--- + +### list + +• **list**: `Params` + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L38) diff --git a/docs/api-reference/interfaces/AgreementPrepareResult.md b/docs/api-reference/interfaces/AgreementPrepareResult.md new file mode 100644 index 000000000..75122c3c9 --- /dev/null +++ b/docs/api-reference/interfaces/AgreementPrepareResult.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / AgreementPrepareResult + +# Interface: AgreementPrepareResult + +## Table of contents + +### Properties + +- [agreementIdSeed](AgreementPrepareResult.md#agreementidseed) +- [signature](AgreementPrepareResult.md#signature) + +## Properties + +### agreementIdSeed + +• **agreementIdSeed**: `string` + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L10) + +--- + +### signature + +• **signature**: `string` + +#### Defined in + +[src/nevermined/api/AgreementsApi.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AgreementsApi.ts#L11) diff --git a/docs/api-reference/interfaces/Algorithm.md b/docs/api-reference/interfaces/Algorithm.md index 152813916..341a24993 100644 --- a/docs/api-reference/interfaces/Algorithm.md +++ b/docs/api-reference/interfaces/Algorithm.md @@ -20,7 +20,7 @@ #### Defined in -[src/ddo/MetaData.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L43) +[src/ddo/types.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L75) --- @@ -30,7 +30,7 @@ #### Defined in -[src/ddo/MetaData.ts:41](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L41) +[src/ddo/types.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L73) --- @@ -40,7 +40,7 @@ #### Defined in -[src/ddo/MetaData.ts:40](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L40) +[src/ddo/types.ts:72](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L72) --- @@ -58,7 +58,7 @@ #### Defined in -[src/ddo/MetaData.ts:44](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L44) +[src/ddo/types.ts:76](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L76) --- @@ -68,4 +68,4 @@ #### Defined in -[src/ddo/MetaData.ts:42](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L42) +[src/ddo/types.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L74) diff --git a/docs/api-reference/interfaces/AuthToken.md b/docs/api-reference/interfaces/AuthToken.md new file mode 100644 index 000000000..4a81888b6 --- /dev/null +++ b/docs/api-reference/interfaces/AuthToken.md @@ -0,0 +1,19 @@ +[@nevermined-io/sdk](../code-reference.md) / AuthToken + +# Interface: AuthToken + +## Table of contents + +### Properties + +- [access_token](AuthToken.md#access_token) + +## Properties + +### access_token + +• **access_token**: `string` + +#### Defined in + +[src/services/metadata/MetadataService.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L34) diff --git a/docs/api-reference/interfaces/Authentication.md b/docs/api-reference/interfaces/Authentication.md new file mode 100644 index 000000000..2de062545 --- /dev/null +++ b/docs/api-reference/interfaces/Authentication.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / Authentication + +# Interface: Authentication + +## Table of contents + +### Properties + +- [publicKey](Authentication.md#publickey) +- [type](Authentication.md#type) + +## Properties + +### publicKey + +• **publicKey**: `string` + +#### Defined in + +[src/ddo/types.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L14) + +--- + +### type + +• **type**: `string` + +#### Defined in + +[src/ddo/types.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L13) diff --git a/docs/api-reference/interfaces/Babysig.md b/docs/api-reference/interfaces/Babysig.md new file mode 100644 index 000000000..401dae091 --- /dev/null +++ b/docs/api-reference/interfaces/Babysig.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / Babysig + +# Interface: Babysig + +## Table of contents + +### Properties + +- [R8](Babysig.md#r8) +- [S](Babysig.md#s) + +## Properties + +### R8 + +• **R8**: [`string`, `string`] + +#### Defined in + +[src/models/types.ts:79](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L79) + +--- + +### S + +• **S**: `string` + +#### Defined in + +[src/models/types.ts:80](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L80) diff --git a/docs/api-reference/interfaces/Balance.md b/docs/api-reference/interfaces/Balance.md new file mode 100644 index 000000000..b7aca36cb --- /dev/null +++ b/docs/api-reference/interfaces/Balance.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / Balance + +# Interface: Balance + +## Table of contents + +### Properties + +- [eth](Balance.md#eth) +- [nevermined](Balance.md#nevermined) + +## Properties + +### eth + +• **eth**: `bigint` + +#### Defined in + +[src/models/types.ts:84](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L84) + +--- + +### nevermined + +• **nevermined**: `bigint` + +#### Defined in + +[src/models/types.ts:85](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L85) diff --git a/docs/api-reference/interfaces/Bookmark.md b/docs/api-reference/interfaces/Bookmark.md index 284dceaed..55178c824 100644 --- a/docs/api-reference/interfaces/Bookmark.md +++ b/docs/api-reference/interfaces/Bookmark.md @@ -26,7 +26,7 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L9) +[src/services/metadata/types.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L9) --- @@ -40,7 +40,7 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L4) +[src/services/metadata/types.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L4) --- @@ -54,7 +54,7 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L2) +[src/services/metadata/types.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L2) --- @@ -64,7 +64,7 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L8) +[src/services/metadata/types.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L8) --- @@ -78,4 +78,4 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:3](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L3) +[src/services/metadata/types.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L3) diff --git a/docs/api-reference/interfaces/ConditionContext.md b/docs/api-reference/interfaces/ConditionContext.md new file mode 100644 index 000000000..18cf9ffea --- /dev/null +++ b/docs/api-reference/interfaces/ConditionContext.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / ConditionContext + +# Interface: ConditionContext + +## Table of contents + +### Properties + +- [creator](ConditionContext.md#creator) +- [ddo](ConditionContext.md#ddo) +- [price](ConditionContext.md#price) +- [service](ConditionContext.md#service) + +## Properties + +### creator + +• **creator**: `string` + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L22) + +--- + +### ddo + +• **ddo**: [`DDO`](../classes/DDO.md) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L19) + +--- + +### price + +• **price**: [`AssetPrice`](../classes/AssetPrice.md) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L21) + +--- + +### service + +• **service**: [`ServiceCommon`](ServiceCommon.md) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L20) diff --git a/docs/api-reference/interfaces/ConditionData.md b/docs/api-reference/interfaces/ConditionData.md new file mode 100644 index 000000000..1904978a9 --- /dev/null +++ b/docs/api-reference/interfaces/ConditionData.md @@ -0,0 +1,85 @@ +[@nevermined-io/sdk](../code-reference.md) / ConditionData + +# Interface: ConditionData + +## Table of contents + +### Properties + +- [blockNumber](ConditionData.md#blocknumber) +- [blockNumberUpdated](ConditionData.md#blocknumberupdated) +- [lastUpdatedBy](ConditionData.md#lastupdatedby) +- [state](ConditionData.md#state) +- [timeLock](ConditionData.md#timelock) +- [timeOut](ConditionData.md#timeout) +- [typeRef](ConditionData.md#typeref) + +## Properties + +### blockNumber + +• **blockNumber**: `number` + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L12) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L14) + +--- + +### lastUpdatedBy + +• **lastUpdatedBy**: `string` + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L13) + +--- + +### state + +• **state**: [`ConditionState`](../enums/ConditionState.md) + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L9) + +--- + +### timeLock + +• **timeLock**: `number` + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L10) + +--- + +### timeOut + +• **timeOut**: `number` + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L11) + +--- + +### typeRef + +• **typeRef**: `string` + +#### Defined in + +[src/keeper/contracts/managers/ConditionStoreManager.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/ConditionStoreManager.ts#L8) diff --git a/docs/api-reference/interfaces/ConditionInstance.md b/docs/api-reference/interfaces/ConditionInstance.md new file mode 100644 index 000000000..56fd87677 --- /dev/null +++ b/docs/api-reference/interfaces/ConditionInstance.md @@ -0,0 +1,121 @@ +[@nevermined-io/sdk](../code-reference.md) / ConditionInstance + +# Interface: ConditionInstance + +## Type parameters + +| Name | +| :------ | +| `Extra` | + +## Hierarchy + +- [`ConditionInstanceSmall`](ConditionInstanceSmall.md) + + ↳ **`ConditionInstance`** + +## Table of contents + +### Properties + +- [agreementId](ConditionInstance.md#agreementid) +- [condition](ConditionInstance.md#condition) +- [id](ConditionInstance.md#id) +- [list](ConditionInstance.md#list) +- [params](ConditionInstance.md#params) +- [seed](ConditionInstance.md#seed) + +## Properties + +### agreementId + +• **agreementId**: `string` + +#### Inherited from + +[ConditionInstanceSmall](ConditionInstanceSmall.md).[agreementId](ConditionInstanceSmall.md#agreementid) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L34) + +--- + +### condition + +• **condition**: `string` + +#### Inherited from + +[ConditionInstanceSmall](ConditionInstanceSmall.md).[condition](ConditionInstanceSmall.md#condition) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L35) + +--- + +### id + +• **id**: `string` + +#### Inherited from + +[ConditionInstanceSmall](ConditionInstanceSmall.md).[id](ConditionInstanceSmall.md#id) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L33) + +--- + +### list + +• **list**: `any`[] + +#### Inherited from + +[ConditionInstanceSmall](ConditionInstanceSmall.md).[list](ConditionInstanceSmall.md#list) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L31) + +--- + +### params + +• **params**: (`method`: [`ConditionMethod`](../code-reference.md#conditionmethod), `arg`: `Extra`) => `Promise`<`any`[]\> + +#### Type declaration + +▸ (`method`, `arg`): `Promise`<`any`[]\> + +##### Parameters + +| Name | Type | +| :------- | :-------------------------------------------------------- | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | +| `arg` | `Extra` | + +##### Returns + +`Promise`<`any`[]\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L39) + +--- + +### seed + +• **seed**: `string` + +#### Inherited from + +[ConditionInstanceSmall](ConditionInstanceSmall.md).[seed](ConditionInstanceSmall.md#seed) + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L32) diff --git a/docs/api-reference/interfaces/ConditionInstanceSmall.md b/docs/api-reference/interfaces/ConditionInstanceSmall.md new file mode 100644 index 000000000..e688855d2 --- /dev/null +++ b/docs/api-reference/interfaces/ConditionInstanceSmall.md @@ -0,0 +1,69 @@ +[@nevermined-io/sdk](../code-reference.md) / ConditionInstanceSmall + +# Interface: ConditionInstanceSmall + +## Hierarchy + +- **`ConditionInstanceSmall`** + + ↳ [`ConditionInstance`](ConditionInstance.md) + +## Table of contents + +### Properties + +- [agreementId](ConditionInstanceSmall.md#agreementid) +- [condition](ConditionInstanceSmall.md#condition) +- [id](ConditionInstanceSmall.md#id) +- [list](ConditionInstanceSmall.md#list) +- [seed](ConditionInstanceSmall.md#seed) + +## Properties + +### agreementId + +• **agreementId**: `string` + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L34) + +--- + +### condition + +• **condition**: `string` + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L35) + +--- + +### id + +• **id**: `string` + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L33) + +--- + +### list + +• **list**: `any`[] + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L31) + +--- + +### seed + +• **seed**: `string` + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L32) diff --git a/docs/api-reference/interfaces/ConditionParameters.md b/docs/api-reference/interfaces/ConditionParameters.md new file mode 100644 index 000000000..a08221e64 --- /dev/null +++ b/docs/api-reference/interfaces/ConditionParameters.md @@ -0,0 +1,51 @@ +[@nevermined-io/sdk](../code-reference.md) / ConditionParameters + +# Interface: ConditionParameters + +## Type parameters + +| Name | +| :------ | +| `Extra` | + +## Table of contents + +### Properties + +- [list](ConditionParameters.md#list) +- [params](ConditionParameters.md#params) + +## Properties + +### list + +• **list**: `any`[] + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L26) + +--- + +### params + +• **params**: (`method`: [`ConditionMethod`](../code-reference.md#conditionmethod), `arg`: `Extra`) => `Promise`<`any`[]\> + +#### Type declaration + +▸ (`method`, `arg`): `Promise`<`any`[]\> + +##### Parameters + +| Name | Type | +| :------- | :-------------------------------------------------------- | +| `method` | [`ConditionMethod`](../code-reference.md#conditionmethod) | +| `arg` | `Extra` | + +##### Returns + +`Promise`<`any`[]\> + +#### Defined in + +[src/keeper/contracts/conditions/Condition.abstract.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/conditions/Condition.abstract.ts#L27) diff --git a/docs/api-reference/interfaces/ContractEventSubscription.md b/docs/api-reference/interfaces/ContractEventSubscription.md new file mode 100644 index 000000000..02c09c835 --- /dev/null +++ b/docs/api-reference/interfaces/ContractEventSubscription.md @@ -0,0 +1,27 @@ +[@nevermined-io/sdk](../code-reference.md) / ContractEventSubscription + +# Interface: ContractEventSubscription + +## Table of contents + +### Properties + +- [unsubscribe](ContractEventSubscription.md#unsubscribe) + +## Properties + +### unsubscribe + +• **unsubscribe**: () => `void` + +#### Type declaration + +▸ (): `void` + +##### Returns + +`void` + +#### Defined in + +[src/events/NeverminedEvent.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L22) diff --git a/docs/api-reference/interfaces/Curation.md b/docs/api-reference/interfaces/Curation.md index c0c922cdd..0ae233af1 100644 --- a/docs/api-reference/interfaces/Curation.md +++ b/docs/api-reference/interfaces/Curation.md @@ -33,7 +33,7 @@ true #### Defined in -[src/ddo/MetaData.ts:226](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L226) +[src/ddo/types.ts:315](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L315) --- @@ -51,7 +51,7 @@ Number of votes. 0 is the default value. #### Defined in -[src/ddo/MetaData.ts:214](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L214) +[src/ddo/types.ts:303](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L303) --- @@ -69,7 +69,7 @@ Decimal value between 0 and 1. 0 is the default value. #### Defined in -[src/ddo/MetaData.ts:208](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L208) +[src/ddo/types.ts:297](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L297) --- @@ -87,4 +87,4 @@ Schema applied to calculate the rating. #### Defined in -[src/ddo/MetaData.ts:220](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L220) +[src/ddo/types.ts:309](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L309) diff --git a/docs/api-reference/interfaces/DDOStatus.md b/docs/api-reference/interfaces/DDOStatus.md new file mode 100644 index 000000000..69f9eb024 --- /dev/null +++ b/docs/api-reference/interfaces/DDOStatus.md @@ -0,0 +1,48 @@ +[@nevermined-io/sdk](../code-reference.md) / DDOStatus + +# Interface: DDOStatus + +## Table of contents + +### Properties + +- [external](DDOStatus.md#external) +- [internal](DDOStatus.md#internal) + +## Properties + +### external + +• **external**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------- | +| `id` | `string` | +| `status` | `string` | +| `type` | `string` | +| `url` | `string` | + +#### Defined in + +[src/services/metadata/MetadataService.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L25) + +--- + +### internal + +• **internal**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------- | +| `id` | `string` | +| `status` | `string` | +| `type` | `string` | +| `url` | `string` | + +#### Defined in + +[src/services/metadata/MetadataService.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L19) diff --git a/docs/api-reference/interfaces/Eip712Data.md b/docs/api-reference/interfaces/Eip712Data.md new file mode 100644 index 000000000..06b3a3b29 --- /dev/null +++ b/docs/api-reference/interfaces/Eip712Data.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / Eip712Data + +# Interface: Eip712Data + +## Table of contents + +### Properties + +- [chainId](Eip712Data.md#chainid) +- [message](Eip712Data.md#message) + +## Properties + +### chainId + +• **chainId**: `number` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L10) + +--- + +### message + +• **message**: `string` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L9) diff --git a/docs/api-reference/interfaces/events.EventEmitter.md b/docs/api-reference/interfaces/EventEmitter.md similarity index 67% rename from docs/api-reference/interfaces/events.EventEmitter.md rename to docs/api-reference/interfaces/EventEmitter.md index 413ed2a1e..a7512e530 100644 --- a/docs/api-reference/interfaces/events.EventEmitter.md +++ b/docs/api-reference/interfaces/EventEmitter.md @@ -1,15 +1,13 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / EventEmitter +[@nevermined-io/sdk](../code-reference.md) / EventEmitter # Interface: EventEmitter -[events](../modules/events.md).EventEmitter - ## Table of contents ### Properties -- [subscribe](events.EventEmitter.md#subscribe) -- [unsubscribe](events.EventEmitter.md#unsubscribe) +- [subscribe](EventEmitter.md#subscribe) +- [unsubscribe](EventEmitter.md#unsubscribe) ## Properties @@ -34,7 +32,7 @@ #### Defined in -[src/events/NeverminedEvent.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L18) +[src/events/NeverminedEvent.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L17) --- @@ -58,4 +56,4 @@ #### Defined in -[src/events/NeverminedEvent.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L19) +[src/events/NeverminedEvent.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L18) diff --git a/docs/api-reference/interfaces/EventOptions.md b/docs/api-reference/interfaces/EventOptions.md new file mode 100644 index 000000000..3903a6dbb --- /dev/null +++ b/docs/api-reference/interfaces/EventOptions.md @@ -0,0 +1,74 @@ +[@nevermined-io/sdk](../code-reference.md) / EventOptions + +# Interface: EventOptions + +## Table of contents + +### Properties + +- [eventName](EventOptions.md#eventname) +- [filterJsonRpc](EventOptions.md#filterjsonrpc) +- [filterSubgraph](EventOptions.md#filtersubgraph) +- [fromBlock](EventOptions.md#fromblock) +- [result](EventOptions.md#result) +- [toBlock](EventOptions.md#toblock) + +## Properties + +### eventName + +• **eventName**: `string` + +#### Defined in + +[src/events/NeverminedEvent.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L8) + +--- + +### filterJsonRpc + +• `Optional` **filterJsonRpc**: [`Filter`](Filter.md) + +#### Defined in + +[src/events/NeverminedEvent.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L9) + +--- + +### filterSubgraph + +• `Optional` **filterSubgraph**: `Record`<`string`, `unknown`\> + +#### Defined in + +[src/events/NeverminedEvent.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L10) + +--- + +### fromBlock + +• `Optional` **fromBlock**: `string` \| `number` + +#### Defined in + +[src/events/NeverminedEvent.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L12) + +--- + +### result + +• `Optional` **result**: `Record`<`string`, `unknown`\> + +#### Defined in + +[src/events/NeverminedEvent.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L11) + +--- + +### toBlock + +• `Optional` **toBlock**: `string` \| `number` + +#### Defined in + +[src/events/NeverminedEvent.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/events/NeverminedEvent.ts#L13) diff --git a/docs/api-reference/interfaces/File.md b/docs/api-reference/interfaces/File.md deleted file mode 100644 index 27d1d4102..000000000 --- a/docs/api-reference/interfaces/File.md +++ /dev/null @@ -1,173 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / File - -# Interface: File - -## Table of contents - -### Properties - -- [checksum](File.md#checksum) -- [checksumType](File.md#checksumtype) -- [compression](File.md#compression) -- [contentLength](File.md#contentlength) -- [contentType](File.md#contenttype) -- [encoding](File.md#encoding) -- [encryption](File.md#encryption) -- [index](File.md#index) -- [name](File.md#name) -- [resourceId](File.md#resourceid) -- [url](File.md#url) - -## Properties - -### checksum - -• `Optional` **checksum**: `string` - -File checksum. - -#### Defined in - -[src/ddo/MetaData.ts:97](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L97) - ---- - -### checksumType - -• `Optional` **checksumType**: `string` - -Checksum hash algorithm. - -#### Defined in - -[src/ddo/MetaData.ts:102](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L102) - ---- - -### compression - -• `Optional` **compression**: `string` - -File compression (e.g. no, gzip, bzip2, etc). - -**`Example`** - -```ts -'zip' -``` - -#### Defined in - -[src/ddo/MetaData.ts:124](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L124) - ---- - -### contentLength - -• `Optional` **contentLength**: `string` - -File content length. - -#### Defined in - -[src/ddo/MetaData.ts:107](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L107) - ---- - -### contentType - -• **contentType**: `string` - -File format, if applicable. - -**`Example`** - -```ts -'text/csv' -``` - -#### Defined in - -[src/ddo/MetaData.ts:92](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L92) - ---- - -### encoding - -• `Optional` **encoding**: `string` - -File encoding. - -**`Example`** - -```ts -'UTF-8' -``` - -#### Defined in - -[src/ddo/MetaData.ts:118](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L118) - ---- - -### encryption - -• `Optional` **encryption**: `"dtp"` - -Encryption mode used. - -**`Remarks`** - -If not provided is assumed the files are not encrypted. Currently only `dtp` is implemented. - -#### Defined in - -[src/ddo/MetaData.ts:132](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L132) - ---- - -### index - -• `Optional` **index**: `number` - -File index. - -#### Defined in - -[src/ddo/MetaData.ts:86](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L86) - ---- - -### name - -• `Optional` **name**: `string` - -File name. - -#### Defined in - -[src/ddo/MetaData.ts:76](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L76) - ---- - -### resourceId - -• `Optional` **resourceId**: `string` - -Resource ID (depending on the source). - -#### Defined in - -[src/ddo/MetaData.ts:112](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L112) - ---- - -### url - -• **url**: `string` - -File URL. - -#### Defined in - -[src/ddo/MetaData.ts:81](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L81) diff --git a/docs/api-reference/interfaces/Filter.md b/docs/api-reference/interfaces/Filter.md new file mode 100644 index 000000000..73d3073cd --- /dev/null +++ b/docs/api-reference/interfaces/Filter.md @@ -0,0 +1,7 @@ +[@nevermined-io/sdk](../code-reference.md) / Filter + +# Interface: Filter + +## Indexable + +▪ [key: `string`]: `number` \| `string` \| `string`[] \| `number`[] diff --git a/docs/api-reference/interfaces/GenericAccess.md b/docs/api-reference/interfaces/GenericAccess.md new file mode 100644 index 000000000..1de352cbf --- /dev/null +++ b/docs/api-reference/interfaces/GenericAccess.md @@ -0,0 +1,93 @@ +[@nevermined-io/sdk](../code-reference.md) / GenericAccess + +# Interface: GenericAccess + +## Table of contents + +### Properties + +- [contractName](GenericAccess.md#contractname) + +### Methods + +- [createAgreementWithPaymentFromDDO](GenericAccess.md#createagreementwithpaymentfromddo) +- [getAgreementData](GenericAccess.md#getagreementdata) +- [params](GenericAccess.md#params) + +## Properties + +### contractName + +• **contractName**: `string` + +#### Defined in + +[src/keeper/contracts/templates/GenericAccess.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/GenericAccess.ts#L20) + +## Methods + +### createAgreementWithPaymentFromDDO + +▸ **createAgreementWithPaymentFromDDO**(`agreementIdSeed`, `ddo`, `serviceReference`, `parameters`, `consumer`, `from`, `txParams?`, `observer?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :----------------- | :------------------------------------------------------------------------------------ | +| `agreementIdSeed` | `string` | +| `ddo` | [`DDO`](../classes/DDO.md) | +| `serviceReference` | `number` \| [`ServiceType`](../code-reference.md#servicetype) | +| `parameters` | `any` | +| `consumer` | [`Account`](../classes/Account.md) | +| `from` | [`Account`](../classes/Account.md) | +| `txParams?` | [`TxParameters`](TxParameters.md) | +| `observer?` | (`orderProgressStep`: [`OrderProgressStep`](../enums/OrderProgressStep.md)) => `void` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/keeper/contracts/templates/GenericAccess.ts:6](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/GenericAccess.ts#L6) + +--- + +### getAgreementData + +▸ **getAgreementData**(`agreementId`): `Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `agreementId` | `string` | + +#### Returns + +`Promise`<{ `accessConsumer`: `string` ; `accessProvider`: `string` }\> + +#### Defined in + +[src/keeper/contracts/templates/GenericAccess.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/GenericAccess.ts#L17) + +--- + +### params + +▸ **params**(`consumer`, `...args`): `any` + +#### Parameters + +| Name | Type | +| :--------- | :------ | +| `consumer` | `any` | +| `...args` | `any`[] | + +#### Returns + +`any` + +#### Defined in + +[src/keeper/contracts/templates/GenericAccess.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/GenericAccess.ts#L19) diff --git a/docs/api-reference/interfaces/InputType.md b/docs/api-reference/interfaces/InputType.md new file mode 100644 index 000000000..fed4677fd --- /dev/null +++ b/docs/api-reference/interfaces/InputType.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / InputType + +# Interface: InputType + +## Table of contents + +### Properties + +- [name](InputType.md#name) +- [type](InputType.md#type) + +## Properties + +### name + +• **name**: `string` + +#### Defined in + +[src/models/types.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L18) + +--- + +### type + +• **type**: `string` + +#### Defined in + +[src/models/types.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L20) diff --git a/docs/api-reference/interfaces/InstantiableConfig.md b/docs/api-reference/interfaces/InstantiableConfig.md new file mode 100644 index 000000000..f7c4ac012 --- /dev/null +++ b/docs/api-reference/interfaces/InstantiableConfig.md @@ -0,0 +1,74 @@ +[@nevermined-io/sdk](../code-reference.md) / InstantiableConfig + +# Interface: InstantiableConfig + +## Table of contents + +### Properties + +- [artifactsFolder](InstantiableConfig.md#artifactsfolder) +- [circuitsFolder](InstantiableConfig.md#circuitsfolder) +- [config](InstantiableConfig.md#config) +- [logger](InstantiableConfig.md#logger) +- [nevermined](InstantiableConfig.md#nevermined) +- [web3](InstantiableConfig.md#web3) + +## Properties + +### artifactsFolder + +• `Optional` **artifactsFolder**: `string` + +#### Defined in + +[src/Instantiable.abstract.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L12) + +--- + +### circuitsFolder + +• `Optional` **circuitsFolder**: `string` + +#### Defined in + +[src/Instantiable.abstract.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L13) + +--- + +### config + +• `Optional` **config**: [`NeverminedOptions`](../classes/NeverminedOptions.md) + +#### Defined in + +[src/Instantiable.abstract.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L9) + +--- + +### logger + +• `Optional` **logger**: `Logger` + +#### Defined in + +[src/Instantiable.abstract.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L11) + +--- + +### nevermined + +• **nevermined**: [`Nevermined`](../classes/Nevermined.md) + +#### Defined in + +[src/Instantiable.abstract.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L8) + +--- + +### web3 + +• `Optional` **web3**: `JsonRpcProvider` \| `BrowserProvider` + +#### Defined in + +[src/Instantiable.abstract.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/Instantiable.abstract.ts#L10) diff --git a/docs/api-reference/interfaces/JsonRpcPayload.md b/docs/api-reference/interfaces/JsonRpcPayload.md new file mode 100644 index 000000000..3a02f6909 --- /dev/null +++ b/docs/api-reference/interfaces/JsonRpcPayload.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / JsonRpcPayload + +# Interface: JsonRpcPayload + +## Table of contents + +### Properties + +- [id](JsonRpcPayload.md#id) +- [jsonrpc](JsonRpcPayload.md#jsonrpc) +- [method](JsonRpcPayload.md#method) +- [params](JsonRpcPayload.md#params) + +## Properties + +### id + +• `Optional` **id**: `string` \| `number` + +#### Defined in + +[src/keeper/utils.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L69) + +--- + +### jsonrpc + +• **jsonrpc**: `string` + +#### Defined in + +[src/keeper/utils.ts:66](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L66) + +--- + +### method + +• **method**: `string` + +#### Defined in + +[src/keeper/utils.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L67) + +--- + +### params + +• **params**: `any`[] + +#### Defined in + +[src/keeper/utils.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L68) diff --git a/docs/api-reference/interfaces/JsonRpcResponse.md b/docs/api-reference/interfaces/JsonRpcResponse.md new file mode 100644 index 000000000..714031ec1 --- /dev/null +++ b/docs/api-reference/interfaces/JsonRpcResponse.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / JsonRpcResponse + +# Interface: JsonRpcResponse + +## Table of contents + +### Properties + +- [error](JsonRpcResponse.md#error) +- [id](JsonRpcResponse.md#id) +- [jsonrpc](JsonRpcResponse.md#jsonrpc) +- [result](JsonRpcResponse.md#result) + +## Properties + +### error + +• `Optional` **error**: `string` + +#### Defined in + +[src/keeper/utils.ts:76](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L76) + +--- + +### id + +• **id**: `number` + +#### Defined in + +[src/keeper/utils.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L74) + +--- + +### jsonrpc + +• **jsonrpc**: `string` + +#### Defined in + +[src/keeper/utils.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L73) + +--- + +### result + +• `Optional` **result**: `any` + +#### Defined in + +[src/keeper/utils.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/utils.ts#L75) diff --git a/docs/api-reference/interfaces/KeyTransfer.Babysig.md b/docs/api-reference/interfaces/KeyTransfer.Babysig.md deleted file mode 100644 index 349009b32..000000000 --- a/docs/api-reference/interfaces/KeyTransfer.Babysig.md +++ /dev/null @@ -1,32 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [KeyTransfer](../modules/KeyTransfer.md) / Babysig - -# Interface: Babysig - -[KeyTransfer](../modules/KeyTransfer.md).Babysig - -## Table of contents - -### Properties - -- [R8](KeyTransfer.Babysig.md#r8) -- [S](KeyTransfer.Babysig.md#s) - -## Properties - -### R8 - -• **R8**: [`string`, `string`] - -#### Defined in - -[src/models/KeyTransfer.ts:34](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L34) - ---- - -### S - -• **S**: `string` - -#### Defined in - -[src/models/KeyTransfer.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/models/KeyTransfer.ts#L35) diff --git a/docs/api-reference/interfaces/MarketplaceResults.md b/docs/api-reference/interfaces/MarketplaceResults.md new file mode 100644 index 000000000..21bc2f8c0 --- /dev/null +++ b/docs/api-reference/interfaces/MarketplaceResults.md @@ -0,0 +1,58 @@ +[@nevermined-io/sdk](../code-reference.md) / MarketplaceResults + +# Interface: MarketplaceResults + +## Type parameters + +| Name | +| :------- | +| `Entity` | + +## Table of contents + +### Properties + +- [page](MarketplaceResults.md#page) +- [results](MarketplaceResults.md#results) +- [total_pages](MarketplaceResults.md#total_pages) +- [total_results](MarketplaceResults.md#total_results) + +## Properties + +### page + +• **page**: `number` + +#### Defined in + +[src/common/interfaces.ts:7](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L7) + +--- + +### results + +• **results**: `Entity`[] + +#### Defined in + +[src/common/interfaces.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L8) + +--- + +### total_pages + +• **total_pages**: `number` + +#### Defined in + +[src/common/interfaces.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L9) + +--- + +### total_results + +• **total_results**: `SearchResults` + +#### Defined in + +[src/common/interfaces.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L10) diff --git a/docs/api-reference/interfaces/MetaData.md b/docs/api-reference/interfaces/MetaData.md index ce634b7c2..2748c7b22 100644 --- a/docs/api-reference/interfaces/MetaData.md +++ b/docs/api-reference/interfaces/MetaData.md @@ -20,7 +20,7 @@ #### Defined in -[src/ddo/MetaData.ts:340](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L340) +[src/ddo/types.ts:435](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L435) --- @@ -30,7 +30,7 @@ #### Defined in -[src/ddo/MetaData.ts:341](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L341) +[src/ddo/types.ts:436](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L436) --- @@ -40,7 +40,7 @@ #### Defined in -[src/ddo/MetaData.ts:339](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L339) +[src/ddo/types.ts:434](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L434) --- @@ -50,7 +50,7 @@ #### Defined in -[src/ddo/MetaData.ts:338](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L338) +[src/ddo/types.ts:433](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L433) --- @@ -60,4 +60,4 @@ #### Defined in -[src/ddo/MetaData.ts:337](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L337) +[src/ddo/types.ts:432](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L432) diff --git a/docs/api-reference/interfaces/MetaDataExternalResource.md b/docs/api-reference/interfaces/MetaDataExternalResource.md new file mode 100644 index 000000000..91b149f19 --- /dev/null +++ b/docs/api-reference/interfaces/MetaDataExternalResource.md @@ -0,0 +1,187 @@ +[@nevermined-io/sdk](../code-reference.md) / MetaDataExternalResource + +# Interface: MetaDataExternalResource + +## Table of contents + +### Properties + +- [checksum](MetaDataExternalResource.md#checksum) +- [checksumType](MetaDataExternalResource.md#checksumtype) +- [compression](MetaDataExternalResource.md#compression) +- [contentLength](MetaDataExternalResource.md#contentlength) +- [contentType](MetaDataExternalResource.md#contenttype) +- [encoding](MetaDataExternalResource.md#encoding) +- [encryption](MetaDataExternalResource.md#encryption) +- [index](MetaDataExternalResource.md#index) +- [name](MetaDataExternalResource.md#name) +- [resourceId](MetaDataExternalResource.md#resourceid) +- [resourceType](MetaDataExternalResource.md#resourcetype) +- [url](MetaDataExternalResource.md#url) + +## Properties + +### checksum + +• `Optional` **checksum**: `string` + +File checksum. + +#### Defined in + +[src/ddo/types.ts:138](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L138) + +--- + +### checksumType + +• `Optional` **checksumType**: `string` + +Checksum hash algorithm. + +#### Defined in + +[src/ddo/types.ts:143](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L143) + +--- + +### compression + +• `Optional` **compression**: `string` + +File compression (e.g. no, gzip, bzip2, etc). + +**`Example`** + +```ts +'zip' +``` + +#### Defined in + +[src/ddo/types.ts:171](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L171) + +--- + +### contentLength + +• `Optional` **contentLength**: `string` + +File content length. + +#### Defined in + +[src/ddo/types.ts:148](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L148) + +--- + +### contentType + +• **contentType**: `string` + +File format, if applicable. + +**`Example`** + +```ts +'text/csv' +``` + +#### Defined in + +[src/ddo/types.ts:133](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L133) + +--- + +### encoding + +• `Optional` **encoding**: `string` + +File encoding. + +**`Example`** + +```ts +'UTF-8' +``` + +#### Defined in + +[src/ddo/types.ts:165](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L165) + +--- + +### encryption + +• `Optional` **encryption**: `"dtp"` \| `"dleq"` + +Encryption mode used. + +**`Remarks`** + +If not provided is assumed the files are not encrypted. Currently only `dtp` is implemented. + +#### Defined in + +[src/ddo/types.ts:179](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L179) + +--- + +### index + +• `Optional` **index**: `number` + +File index. + +#### Defined in + +[src/ddo/types.ts:127](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L127) + +--- + +### name + +• `Optional` **name**: `string` + +File name. + +#### Defined in + +[src/ddo/types.ts:117](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L117) + +--- + +### resourceId + +• `Optional` **resourceId**: `string` + +Resource ID (depending on the source). It is used to reference the id of the file in an external source. +For example the `ugcId` + +#### Defined in + +[src/ddo/types.ts:159](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L159) + +--- + +### resourceType + +• `Optional` **resourceType**: [`ExternalResourceFileType`](../enums/ExternalResourceFileType.md) + +The type of the external resource file + +#### Defined in + +[src/ddo/types.ts:153](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L153) + +--- + +### url + +• **url**: `string` + +File URL. + +#### Defined in + +[src/ddo/types.ts:122](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L122) diff --git a/docs/api-reference/interfaces/MetaDataMain.md b/docs/api-reference/interfaces/MetaDataMain.md index 524658cfa..004350b37 100644 --- a/docs/api-reference/interfaces/MetaDataMain.md +++ b/docs/api-reference/interfaces/MetaDataMain.md @@ -19,11 +19,13 @@ https://github.com/nevermined-io/docs/blob/master/docs/architecture/specs/metada - [encryptedService](MetaDataMain.md#encryptedservice) - [ercType](MetaDataMain.md#erctype) - [files](MetaDataMain.md#files) +- [isDTP](MetaDataMain.md#isdtp) - [license](MetaDataMain.md#license) - [name](MetaDataMain.md#name) - [nftType](MetaDataMain.md#nfttype) - [service](MetaDataMain.md#service) - [type](MetaDataMain.md#type) +- [webService](MetaDataMain.md#webservice) - [workflow](MetaDataMain.md#workflow) ## Properties @@ -34,7 +36,7 @@ https://github.com/nevermined-io/docs/blob/master/docs/architecture/specs/metada #### Defined in -[src/ddo/MetaData.ts:190](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L190) +[src/ddo/types.ts:277](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L277) --- @@ -52,7 +54,7 @@ Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.). #### Defined in -[src/ddo/MetaData.ts:172](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L172) +[src/ddo/types.ts:257](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L257) --- @@ -71,7 +73,7 @@ ISO 8601 format, Coordinated Universal Time. #### Defined in -[src/ddo/MetaData.ts:158](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L158) +[src/ddo/types.ts:243](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L243) --- @@ -91,7 +93,7 @@ so this value can't be set. #### Defined in -[src/ddo/MetaData.ts:166](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L166) +[src/ddo/types.ts:251](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L251) --- @@ -101,29 +103,39 @@ so this value can't be set. #### Defined in -[src/ddo/MetaData.ts:186](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L186) +[src/ddo/types.ts:273](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L273) --- ### ercType -• `Optional` **ercType**: `ERCType` +• `Optional` **ercType**: [`ERCType`](../enums/ERCType.md) #### Defined in -[src/ddo/MetaData.ts:194](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L194) +[src/ddo/types.ts:281](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L281) --- ### files -• `Optional` **files**: [`File`](File.md)[] +• `Optional` **files**: [`MetaDataExternalResource`](MetaDataExternalResource.md)[] Array of File objects including the encrypted file urls and some additional information. #### Defined in -[src/ddo/MetaData.ts:184](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L184) +[src/ddo/types.ts:269](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L269) + +--- + +### isDTP + +• `Optional` **isDTP**: `boolean` + +#### Defined in + +[src/ddo/types.ts:285](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L285) --- @@ -142,7 +154,7 @@ If it's not specified, the following value will be added: "No License Specified" #### Defined in -[src/ddo/MetaData.ts:179](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L179) +[src/ddo/types.ts:264](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L264) --- @@ -160,36 +172,36 @@ Descriptive name of the Asset. #### Defined in -[src/ddo/MetaData.ts:144](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L144) +[src/ddo/types.ts:221](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L221) --- ### nftType -• `Optional` **nftType**: `NeverminedNFTType` +• `Optional` **nftType**: [`NeverminedNFTType`](../code-reference.md#neverminednfttype) #### Defined in -[src/ddo/MetaData.ts:196](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L196) +[src/ddo/types.ts:283](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L283) --- ### service -• `Optional` **service**: [`Service`](Service.md) +• `Optional` **service**: [`ServiceCommon`](ServiceCommon.md) #### Defined in -[src/ddo/MetaData.ts:192](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L192) +[src/ddo/types.ts:279](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L279) --- ### type -• **type**: `"dataset"` \| `"compute"` \| `"workflow"` \| `"algorithm"` +• **type**: `"compute"` \| `"workflow"` \| `"service"` \| `"dataset"` \| `"algorithm"` \| `"subscription"` \| `"other"` Type of the Asset. Helps to filter by the type of asset, -initially ("dataset", "algorithm", "compute", "workflow", "compute", "other"). +initially ("dataset", "algorithm", "compute", "workflow", "compute", "subscription", "other"). **`Example`** @@ -199,7 +211,17 @@ initially ("dataset", "algorithm", "compute", "workflow", "compute", "other"). #### Defined in -[src/ddo/MetaData.ts:151](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L151) +[src/ddo/types.ts:228](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L228) + +--- + +### webService + +• `Optional` **webService**: [`WebService`](WebService.md) + +#### Defined in + +[src/ddo/types.ts:271](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L271) --- @@ -209,4 +231,4 @@ initially ("dataset", "algorithm", "compute", "workflow", "compute", "other"). #### Defined in -[src/ddo/MetaData.ts:188](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L188) +[src/ddo/types.ts:275](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L275) diff --git a/docs/api-reference/interfaces/MethodReflection.md b/docs/api-reference/interfaces/MethodReflection.md new file mode 100644 index 000000000..a8cf958b1 --- /dev/null +++ b/docs/api-reference/interfaces/MethodReflection.md @@ -0,0 +1,63 @@ +[@nevermined-io/sdk](../code-reference.md) / MethodReflection + +# Interface: MethodReflection + +## Table of contents + +### Properties + +- [address](MethodReflection.md#address) +- [contractName](MethodReflection.md#contractname) +- [inputs](MethodReflection.md#inputs) +- [methodName](MethodReflection.md#methodname) +- [signature](MethodReflection.md#signature) + +## Properties + +### address + +• **address**: `string` + +#### Defined in + +[src/models/types.ts:71](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L71) + +--- + +### contractName + +• **contractName**: `string` + +#### Defined in + +[src/models/types.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L67) + +--- + +### inputs + +• **inputs**: [`InputType`](InputType.md)[] + +#### Defined in + +[src/models/types.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L75) + +--- + +### methodName + +• **methodName**: `string` + +#### Defined in + +[src/models/types.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L69) + +--- + +### signature + +• **signature**: `string` + +#### Defined in + +[src/models/types.ts:73](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L73) diff --git a/docs/api-reference/interfaces/MintedEntry.md b/docs/api-reference/interfaces/MintedEntry.md new file mode 100644 index 000000000..c00570a78 --- /dev/null +++ b/docs/api-reference/interfaces/MintedEntry.md @@ -0,0 +1,41 @@ +[@nevermined-io/sdk](../code-reference.md) / MintedEntry + +# Interface: MintedEntry + +## Table of contents + +### Properties + +- [amountMinted](MintedEntry.md#amountminted) +- [expirationBlock](MintedEntry.md#expirationblock) +- [mintBlock](MintedEntry.md#mintblock) + +## Properties + +### amountMinted + +• **amountMinted**: `bigint` + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:8](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L8) + +--- + +### expirationBlock + +• **expirationBlock**: `bigint` + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:9](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L9) + +--- + +### mintBlock + +• **mintBlock**: `bigint` + +#### Defined in + +[src/keeper/contracts/NFTContractsBase.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/NFTContractsBase.ts#L10) diff --git a/docs/api-reference/interfaces/NewBookmark.md b/docs/api-reference/interfaces/NewBookmark.md index 14e286112..b91d6e5d4 100644 --- a/docs/api-reference/interfaces/NewBookmark.md +++ b/docs/api-reference/interfaces/NewBookmark.md @@ -24,7 +24,7 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L4) +[src/services/metadata/types.ts:4](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L4) --- @@ -34,7 +34,7 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:2](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L2) +[src/services/metadata/types.ts:2](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L2) --- @@ -44,4 +44,4 @@ #### Defined in -[src/bookmarks/Bookmarks.interfaces.ts:3](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/bookmarks/Bookmarks.interfaces.ts#L3) +[src/services/metadata/types.ts:3](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L3) diff --git a/docs/api-reference/interfaces/NewPermission.md b/docs/api-reference/interfaces/NewPermission.md index fb39a0553..e4e5ac3db 100644 --- a/docs/api-reference/interfaces/NewPermission.md +++ b/docs/api-reference/interfaces/NewPermission.md @@ -25,7 +25,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L12) +[src/services/metadata/types.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L23) --- @@ -35,7 +35,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L11) +[src/services/metadata/types.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L22) --- @@ -45,7 +45,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L10) +[src/services/metadata/types.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L21) --- @@ -55,4 +55,4 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L9) +[src/services/metadata/types.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L20) diff --git a/docs/api-reference/interfaces/NewProfile.md b/docs/api-reference/interfaces/NewProfile.md index a7af3fef2..8357a3d39 100644 --- a/docs/api-reference/interfaces/NewProfile.md +++ b/docs/api-reference/interfaces/NewProfile.md @@ -28,7 +28,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L14) +[src/services/metadata/types.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L44) --- @@ -38,7 +38,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L10) +[src/services/metadata/types.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L40) --- @@ -48,7 +48,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L13) +[src/services/metadata/types.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L43) --- @@ -58,7 +58,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L8) +[src/services/metadata/types.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L38) --- @@ -68,7 +68,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L12) +[src/services/metadata/types.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L42) --- @@ -78,7 +78,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L11) +[src/services/metadata/types.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L41) --- @@ -88,4 +88,4 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L9) +[src/services/metadata/types.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L39) diff --git a/docs/api-reference/interfaces/NvmConfig.md b/docs/api-reference/interfaces/NvmConfig.md new file mode 100644 index 000000000..6579668e8 --- /dev/null +++ b/docs/api-reference/interfaces/NvmConfig.md @@ -0,0 +1,97 @@ +[@nevermined-io/sdk](../code-reference.md) / NvmConfig + +# Interface: NvmConfig + +Nevermined Config DDO section + +**`Example`** + +```ts +"_nvm": { + "userId": "dff40170-37fc-11ed-be5b-9984d9f9ec35", + "appId": "acde070d-8c4c-4f0d-9d8a-162843c10333", + "versions": [ + { + "id": 1, + "updated": "2020-01-01T19:13:24Z", + "checksum": "89328493849328493284932" + }, + { + "id": 2, + "updated": "2021-02-21T20:13:24Z", + "checksum": "045328094852309483203443" + } + ] + } +``` + +## Table of contents + +### Properties + +- [appId](NvmConfig.md#appid) +- [networks](NvmConfig.md#networks) +- [userId](NvmConfig.md#userid) +- [versions](NvmConfig.md#versions) + +## Properties + +### appId + +• **appId**: `string` + +The `appId` will be a `string` storing an identifier in `UUID` format. + +**`Remarks`** + +Used to identity the application responsible for the DDO in the marketplace-api. +Useful for querying assets belonging to a particular app, allowing us to have multiple +apps using the same marketplace api + +#### Defined in + +[src/ddo/types.ts:508](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L508) + +--- + +### networks + +• `Optional` **networks**: `Object` + +Block networks where the asset is available. It is represented as a map of network Id and a boolean value. + +#### Index signature + +▪ [key: `string`]: `boolean` + +#### Defined in + +[src/ddo/types.ts:517](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L517) + +--- + +### userId + +• **userId**: `string` + +The `userId` will be a `string` storing an identifier in `UUID` format. + +**`Remarks`** + +Used to identify a user in the marketplace api + +#### Defined in + +[src/ddo/types.ts:499](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L499) + +--- + +### versions + +• **versions**: [`NvmConfigVersions`](NvmConfigVersions.md)[] + +The `versions` list stores the reference to all the changes done to the Metadata document. + +#### Defined in + +[src/ddo/types.ts:512](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L512) diff --git a/docs/api-reference/interfaces/NvmConfigVersions.md b/docs/api-reference/interfaces/NvmConfigVersions.md new file mode 100644 index 000000000..9e5de2bf7 --- /dev/null +++ b/docs/api-reference/interfaces/NvmConfigVersions.md @@ -0,0 +1,77 @@ +[@nevermined-io/sdk](../code-reference.md) / NvmConfigVersions + +# Interface: NvmConfigVersions + +## Table of contents + +### Properties + +- [checksum](NvmConfigVersions.md#checksum) +- [id](NvmConfigVersions.md#id) +- [immutableBackend](NvmConfigVersions.md#immutablebackend) +- [immutableUrl](NvmConfigVersions.md#immutableurl) +- [updated](NvmConfigVersions.md#updated) + +## Properties + +### checksum + +• **checksum**: `string` + +The checksum of the document + +#### Defined in + +[src/ddo/types.ts:542](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L542) + +--- + +### id + +• **id**: `number` + +The id of the DDO revision. + +**`Remarks`** + +This is a self incrementing number + +#### Defined in + +[src/ddo/types.ts:534](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L534) + +--- + +### immutableBackend + +• `Optional` **immutableBackend**: [`ImmutableBackends`](../enums/ImmutableBackends.md) + +The immutable solution to record the DDO + +#### Defined in + +[src/ddo/types.ts:552](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L552) + +--- + +### immutableUrl + +• `Optional` **immutableUrl**: `string` + +ID Hash of the metadata recorded in an immutable data store (IPFS, Filecoin, Arweave, ..) + +#### Defined in + +[src/ddo/types.ts:547](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L547) + +--- + +### updated + +• **updated**: `string` + +The date when the update occurred. + +#### Defined in + +[src/ddo/types.ts:538](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L538) diff --git a/docs/api-reference/interfaces/PaymentData.md b/docs/api-reference/interfaces/PaymentData.md new file mode 100644 index 000000000..00dd9f7b9 --- /dev/null +++ b/docs/api-reference/interfaces/PaymentData.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / PaymentData + +# Interface: PaymentData + +## Table of contents + +### Properties + +- [amounts](PaymentData.md#amounts) +- [receivers](PaymentData.md#receivers) +- [rewardAddress](PaymentData.md#rewardaddress) +- [tokenAddress](PaymentData.md#tokenaddress) + +## Properties + +### amounts + +• **amounts**: `bigint`[] + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L46) + +--- + +### receivers + +• **receivers**: `string`[] + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L47) + +--- + +### rewardAddress + +• **rewardAddress**: `string` + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L44) + +--- + +### tokenAddress + +• **tokenAddress**: `string` + +#### Defined in + +[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L45) diff --git a/docs/api-reference/interfaces/Permission.md b/docs/api-reference/interfaces/Permission.md index fb32f47a0..f4aa28c0c 100644 --- a/docs/api-reference/interfaces/Permission.md +++ b/docs/api-reference/interfaces/Permission.md @@ -31,7 +31,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L12) +[src/services/metadata/types.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L23) --- @@ -41,7 +41,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L16) +[src/services/metadata/types.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L27) --- @@ -51,7 +51,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L17) +[src/services/metadata/types.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L28) --- @@ -65,7 +65,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L11) +[src/services/metadata/types.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L22) --- @@ -79,7 +79,7 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L10) +[src/services/metadata/types.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L21) --- @@ -93,4 +93,4 @@ #### Defined in -[src/permissions/Permissions.interfaces.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/permissions/Permissions.interfaces.ts#L9) +[src/services/metadata/types.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L20) diff --git a/docs/api-reference/interfaces/PlatformKeeperTech.md b/docs/api-reference/interfaces/PlatformKeeperTech.md index fff8569d9..f3ad88e85 100644 --- a/docs/api-reference/interfaces/PlatformKeeperTech.md +++ b/docs/api-reference/interfaces/PlatformKeeperTech.md @@ -33,7 +33,7 @@ #### Defined in -[src/nevermined/Versions.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L15) +[src/nevermined/Versions.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L15) --- @@ -47,7 +47,7 @@ #### Defined in -[src/nevermined/Versions.ts:22](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L22) +[src/nevermined/Versions.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L22) --- @@ -57,7 +57,7 @@ #### Defined in -[src/nevermined/Versions.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L21) +[src/nevermined/Versions.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L21) --- @@ -71,7 +71,7 @@ #### Defined in -[src/nevermined/Versions.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L13) +[src/nevermined/Versions.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L13) --- @@ -81,7 +81,7 @@ #### Defined in -[src/nevermined/Versions.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L20) +[src/nevermined/Versions.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L20) --- @@ -91,7 +91,7 @@ #### Defined in -[src/nevermined/Versions.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L23) +[src/nevermined/Versions.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L23) --- @@ -105,7 +105,7 @@ #### Defined in -[src/nevermined/Versions.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L16) +[src/nevermined/Versions.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L16) --- @@ -119,4 +119,4 @@ #### Defined in -[src/nevermined/Versions.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L14) +[src/nevermined/Versions.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L14) diff --git a/docs/api-reference/interfaces/PlatformTech.md b/docs/api-reference/interfaces/PlatformTech.md index 339e5e990..6765eb25a 100644 --- a/docs/api-reference/interfaces/PlatformTech.md +++ b/docs/api-reference/interfaces/PlatformTech.md @@ -25,7 +25,7 @@ #### Defined in -[src/nevermined/Versions.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L15) +[src/nevermined/Versions.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L15) --- @@ -35,7 +35,7 @@ #### Defined in -[src/nevermined/Versions.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L13) +[src/nevermined/Versions.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L13) --- @@ -45,7 +45,7 @@ #### Defined in -[src/nevermined/Versions.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L16) +[src/nevermined/Versions.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L16) --- @@ -55,4 +55,4 @@ #### Defined in -[src/nevermined/Versions.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L14) +[src/nevermined/Versions.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L14) diff --git a/docs/api-reference/interfaces/PlatformVersions.md b/docs/api-reference/interfaces/PlatformVersions.md index 7b97cd7dd..56ff9d33c 100644 --- a/docs/api-reference/interfaces/PlatformVersions.md +++ b/docs/api-reference/interfaces/PlatformVersions.md @@ -6,30 +6,30 @@ ### Properties -- [gateway](PlatformVersions.md#gateway) - [metadata](PlatformVersions.md#metadata) +- [node](PlatformVersions.md#node) - [sdk](PlatformVersions.md#sdk) - [status](PlatformVersions.md#status) ## Properties -### gateway +### metadata -• **gateway**: [`PlatformKeeperTech`](PlatformKeeperTech.md) +• **metadata**: [`PlatformTech`](PlatformTech.md) #### Defined in -[src/nevermined/Versions.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L29) +[src/nevermined/Versions.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L28) --- -### metadata +### node -• **metadata**: [`PlatformTech`](PlatformTech.md) +• **node**: [`PlatformKeeperTech`](PlatformKeeperTech.md) #### Defined in -[src/nevermined/Versions.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L28) +[src/nevermined/Versions.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L29) --- @@ -39,7 +39,7 @@ #### Defined in -[src/nevermined/Versions.ts:27](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L27) +[src/nevermined/Versions.ts:27](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L27) --- @@ -57,4 +57,4 @@ #### Defined in -[src/nevermined/Versions.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/nevermined/Versions.ts#L30) +[src/nevermined/Versions.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/Versions.ts#L30) diff --git a/docs/api-reference/interfaces/Profile.md b/docs/api-reference/interfaces/Profile.md index 80e04a980..9e3c8c5a8 100644 --- a/docs/api-reference/interfaces/Profile.md +++ b/docs/api-reference/interfaces/Profile.md @@ -35,7 +35,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L14) +[src/services/metadata/types.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L44) --- @@ -49,7 +49,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L10) +[src/services/metadata/types.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L40) --- @@ -59,7 +59,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L19) +[src/services/metadata/types.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L49) --- @@ -73,7 +73,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L13) +[src/services/metadata/types.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L43) --- @@ -87,7 +87,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L8) +[src/services/metadata/types.ts:38](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L38) --- @@ -101,7 +101,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L12) +[src/services/metadata/types.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L42) --- @@ -115,7 +115,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L11) +[src/services/metadata/types.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L41) --- @@ -129,7 +129,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L9) +[src/services/metadata/types.ts:39](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L39) --- @@ -139,7 +139,7 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L20) +[src/services/metadata/types.ts:50](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L50) --- @@ -149,4 +149,4 @@ #### Defined in -[src/profiles/Profiles.interfaces.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/profiles/Profiles.interfaces.ts#L18) +[src/services/metadata/types.ts:48](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/types.ts#L48) diff --git a/docs/api-reference/interfaces/Proof.md b/docs/api-reference/interfaces/Proof.md new file mode 100644 index 000000000..4753f2759 --- /dev/null +++ b/docs/api-reference/interfaces/Proof.md @@ -0,0 +1,63 @@ +[@nevermined-io/sdk](../code-reference.md) / Proof + +# Interface: Proof + +## Table of contents + +### Properties + +- [checksum](Proof.md#checksum) +- [created](Proof.md#created) +- [creator](Proof.md#creator) +- [signatureValue](Proof.md#signaturevalue) +- [type](Proof.md#type) + +## Properties + +### checksum + +• **checksum**: `any` + +#### Defined in + +[src/ddo/types.ts:616](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L616) + +--- + +### created + +• **created**: `string` + +#### Defined in + +[src/ddo/types.ts:613](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L613) + +--- + +### creator + +• **creator**: `string` + +#### Defined in + +[src/ddo/types.ts:614](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L614) + +--- + +### signatureValue + +• **signatureValue**: `string` + +#### Defined in + +[src/ddo/types.ts:615](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L615) + +--- + +### type + +• **type**: `string` + +#### Defined in + +[src/ddo/types.ts:612](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L612) diff --git a/docs/api-reference/interfaces/ProvenanceAttributeRegisteredEvent.md b/docs/api-reference/interfaces/ProvenanceAttributeRegisteredEvent.md new file mode 100644 index 000000000..316b8aa63 --- /dev/null +++ b/docs/api-reference/interfaces/ProvenanceAttributeRegisteredEvent.md @@ -0,0 +1,118 @@ +[@nevermined-io/sdk](../code-reference.md) / ProvenanceAttributeRegisteredEvent + +# Interface: ProvenanceAttributeRegisteredEvent + +## Table of contents + +### Properties + +- [activityId](ProvenanceAttributeRegisteredEvent.md#activityid) +- [agentId](ProvenanceAttributeRegisteredEvent.md#agentid) +- [agentInvolvedId](ProvenanceAttributeRegisteredEvent.md#agentinvolvedid) +- [attributes](ProvenanceAttributeRegisteredEvent.md#attributes) +- [blockNumberUpdated](ProvenanceAttributeRegisteredEvent.md#blocknumberupdated) +- [did](ProvenanceAttributeRegisteredEvent.md#did) +- [id](ProvenanceAttributeRegisteredEvent.md#id) +- [method](ProvenanceAttributeRegisteredEvent.md#method) +- [provId](ProvenanceAttributeRegisteredEvent.md#provid) +- [relatedDid](ProvenanceAttributeRegisteredEvent.md#relateddid) + +## Properties + +### activityId + +• **activityId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L44) + +--- + +### agentId + +• **agentId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:43](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L43) + +--- + +### agentInvolvedId + +• **agentInvolvedId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:46](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L46) + +--- + +### attributes + +• `Optional` **attributes**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:48](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L48) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L49) + +--- + +### did + +• **did**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:42](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L42) + +--- + +### id + +• **id**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:40](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L40) + +--- + +### method + +• **method**: [`ProvenanceMethod`](../enums/ProvenanceMethod.md) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:47](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L47) + +--- + +### provId + +• **provId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:41](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L41) + +--- + +### relatedDid + +• **relatedDid**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L45) diff --git a/docs/api-reference/interfaces/ProvenanceBaseEvent.md b/docs/api-reference/interfaces/ProvenanceBaseEvent.md new file mode 100644 index 000000000..fec025c78 --- /dev/null +++ b/docs/api-reference/interfaces/ProvenanceBaseEvent.md @@ -0,0 +1,88 @@ +[@nevermined-io/sdk](../code-reference.md) / ProvenanceBaseEvent + +# Interface: ProvenanceBaseEvent + +## Hierarchy + +- **`ProvenanceBaseEvent`** + + ↳ [`WasGeneratedByEvent`](WasGeneratedByEvent.md) + + ↳ [`UsedEvent`](UsedEvent.md) + + ↳ [`WasDerivedFromEvent`](WasDerivedFromEvent.md) + + ↳ [`WasAssociatedWithEvent`](WasAssociatedWithEvent.md) + + ↳ [`ActedOnBehalfEvent`](ActedOnBehalfEvent.md) + +## Table of contents + +### Properties + +- [activityId](ProvenanceBaseEvent.md#activityid) +- [attributes](ProvenanceBaseEvent.md#attributes) +- [blockNumberUpdated](ProvenanceBaseEvent.md#blocknumberupdated) +- [event](ProvenanceBaseEvent.md#event) +- [method](ProvenanceBaseEvent.md#method) +- [provId](ProvenanceBaseEvent.md#provid) + +## Properties + +### activityId + +• **activityId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L55) + +--- + +### attributes + +• `Optional` **attributes**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L57) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L58) + +--- + +### event + +• **event**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L53) + +--- + +### method + +• **method**: [`ProvenanceMethod`](../enums/ProvenanceMethod.md) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L54) + +--- + +### provId + +• **provId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L56) diff --git a/docs/api-reference/interfaces/ProvenanceRegistry.md b/docs/api-reference/interfaces/ProvenanceRegistry.md index 0fca644e7..1c3737af9 100644 --- a/docs/api-reference/interfaces/ProvenanceRegistry.md +++ b/docs/api-reference/interfaces/ProvenanceRegistry.md @@ -24,7 +24,7 @@ #### Defined in -[src/keeper.ts:27](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L27) +[src/keeper/contracts/Provenance.ts:31](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L31) --- @@ -34,7 +34,7 @@ #### Defined in -[src/keeper.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L26) +[src/keeper/contracts/Provenance.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L30) --- @@ -44,7 +44,7 @@ #### Defined in -[src/keeper.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L28) +[src/keeper/contracts/Provenance.ts:32](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L32) --- @@ -54,7 +54,7 @@ #### Defined in -[src/keeper.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L31) +[src/keeper/contracts/Provenance.ts:35](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L35) --- @@ -64,7 +64,7 @@ #### Defined in -[src/keeper.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L30) +[src/keeper/contracts/Provenance.ts:34](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L34) --- @@ -74,7 +74,7 @@ #### Defined in -[src/keeper.ts:24](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L24) +[src/keeper/contracts/Provenance.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L28) --- @@ -84,7 +84,7 @@ #### Defined in -[src/keeper.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L29) +[src/keeper/contracts/Provenance.ts:33](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L33) --- @@ -94,7 +94,7 @@ #### Defined in -[src/keeper.ts:25](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L25) +[src/keeper/contracts/Provenance.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L29) --- @@ -104,4 +104,4 @@ #### Defined in -[src/keeper.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper.ts#L32) +[src/keeper/contracts/Provenance.ts:36](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L36) diff --git a/docs/api-reference/interfaces/Provider.md b/docs/api-reference/interfaces/Provider.md new file mode 100644 index 000000000..88ce0cd06 --- /dev/null +++ b/docs/api-reference/interfaces/Provider.md @@ -0,0 +1,51 @@ +[@nevermined-io/sdk](../code-reference.md) / Provider + +# Interface: Provider + +## Table of contents + +### Properties + +- [description](Provider.md#description) +- [environment](Provider.md#environment) +- [type](Provider.md#type) + +## Properties + +### description + +• **description**: `string` + +#### Defined in + +[src/ddo/types.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L19) + +--- + +### environment + +• **environment**: `Object` + +#### Type declaration + +| Name | Type | +| :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cluster` | { `type`: `string` ; `url`: `string` } | +| `cluster.type` | `string` | +| `cluster.url` | `string` | +| `supportedContainers` | { `checksum`: `string` ; `image`: `string` ; `tag`: `string` }[] | +| `supportedServers` | { `cpu`: `string` ; `disk`: `string` ; `gpu`: `string` ; `maxExecutionTime`: `number` ; `memory`: `string` ; `price`: `string` ; `serverId`: `string` ; `serverType`: `string` }[] | + +#### Defined in + +[src/ddo/types.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L20) + +--- + +### type + +• **type**: `string` + +#### Defined in + +[src/ddo/types.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L18) diff --git a/docs/api-reference/interfaces/PublicKey.md b/docs/api-reference/interfaces/PublicKey.md new file mode 100644 index 000000000..ce7423d95 --- /dev/null +++ b/docs/api-reference/interfaces/PublicKey.md @@ -0,0 +1,94 @@ +[@nevermined-io/sdk](../code-reference.md) / PublicKey + +# Interface: PublicKey + +Public key data. + +## Table of contents + +### Properties + +- [id](PublicKey.md#id) +- [owner](PublicKey.md#owner) +- [publicKeyBase58](PublicKey.md#publickeybase58) +- [publicKeyHex](PublicKey.md#publickeyhex) +- [publicKeyPem](PublicKey.md#publickeypem) +- [type](PublicKey.md#type) + +## Properties + +### id + +• **id**: `string` + +ID of the key. + +**`Example`** + +```ts +'did:nv:123456789abcdefghi#keys-1' +``` + +#### Defined in + +[src/ddo/types.ts:447](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L447) + +--- + +### owner + +• **owner**: `string` + +Key owner. + +**`Example`** + +```ts +'did:nv:123456789abcdefghi' +``` + +#### Defined in + +[src/ddo/types.ts:462](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L462) + +--- + +### publicKeyBase58 + +• `Optional` **publicKeyBase58**: `string` + +#### Defined in + +[src/ddo/types.ts:465](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L465) + +--- + +### publicKeyHex + +• `Optional` **publicKeyHex**: `string` + +#### Defined in + +[src/ddo/types.ts:466](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L466) + +--- + +### publicKeyPem + +• `Optional` **publicKeyPem**: `string` + +#### Defined in + +[src/ddo/types.ts:464](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L464) + +--- + +### type + +• **type**: `"Ed25519VerificationKey2018"` \| `"RsaVerificationKey2018"` \| `"EdDsaSAPublicKeySecp256k1"` \| `"EthereumECDSAKey"` + +Type of key. + +#### Defined in + +[src/ddo/types.ts:452](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L452) diff --git a/docs/api-reference/interfaces/QueryResult.md b/docs/api-reference/interfaces/QueryResult.md new file mode 100644 index 000000000..0f6406cfd --- /dev/null +++ b/docs/api-reference/interfaces/QueryResult.md @@ -0,0 +1,56 @@ +[@nevermined-io/sdk](../code-reference.md) / QueryResult + +# Interface: QueryResult + +## Table of contents + +### Properties + +- [page](QueryResult.md#page) +- [results](QueryResult.md#results) +- [totalPages](QueryResult.md#totalpages) +- [totalResults](QueryResult.md#totalresults) + +## Properties + +### page + +• **page**: `number` + +#### Defined in + +[src/services/metadata/MetadataService.ts:11](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L11) + +--- + +### results + +• **results**: [`DDO`](../classes/DDO.md)[] + +#### Defined in + +[src/services/metadata/MetadataService.ts:10](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L10) + +--- + +### totalPages + +• **totalPages**: `number` + +#### Defined in + +[src/services/metadata/MetadataService.ts:12](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L12) + +--- + +### totalResults + +• **totalResults**: `Object` + +#### Index signature + +▪ [jsonPath: `string`]: `any` + +#### Defined in + +[src/services/metadata/MetadataService.ts:13](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/metadata/MetadataService.ts#L13) diff --git a/docs/api-reference/interfaces/ResourceAuthentication.md b/docs/api-reference/interfaces/ResourceAuthentication.md new file mode 100644 index 000000000..478afff32 --- /dev/null +++ b/docs/api-reference/interfaces/ResourceAuthentication.md @@ -0,0 +1,63 @@ +[@nevermined-io/sdk](../code-reference.md) / ResourceAuthentication + +# Interface: ResourceAuthentication + +## Table of contents + +### Properties + +- [password](ResourceAuthentication.md#password) +- [privateParameters](ResourceAuthentication.md#privateparameters) +- [token](ResourceAuthentication.md#token) +- [type](ResourceAuthentication.md#type) +- [user](ResourceAuthentication.md#user) + +## Properties + +### password + +• `Optional` **password**: `string` + +#### Defined in + +[src/ddo/types.ts:207](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L207) + +--- + +### privateParameters + +• `Optional` **privateParameters**: { `[name: string]`: `string`; }[] + +#### Defined in + +[src/ddo/types.ts:209](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L209) + +--- + +### token + +• `Optional` **token**: `string` + +#### Defined in + +[src/ddo/types.ts:208](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L208) + +--- + +### type + +• **type**: `"none"` \| `"basic"` \| `"oauth"` + +#### Defined in + +[src/ddo/types.ts:204](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L204) + +--- + +### user + +• `Optional` **user**: `string` + +#### Defined in + +[src/ddo/types.ts:206](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L206) diff --git a/docs/api-reference/interfaces/RoyaltyAttributes.md b/docs/api-reference/interfaces/RoyaltyAttributes.md new file mode 100644 index 000000000..41fdf4435 --- /dev/null +++ b/docs/api-reference/interfaces/RoyaltyAttributes.md @@ -0,0 +1,43 @@ +[@nevermined-io/sdk](../code-reference.md) / RoyaltyAttributes + +# Interface: RoyaltyAttributes + +Attributes defining the royalties model attached to the asset + +## Table of contents + +### Properties + +- [amount](RoyaltyAttributes.md#amount) +- [royaltyKind](RoyaltyAttributes.md#royaltykind) +- [scheme](RoyaltyAttributes.md#scheme) + +## Properties + +### amount + +• **amount**: `number` + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L63) + +--- + +### royaltyKind + +• **royaltyKind**: [`RoyaltyKind`](../enums/RoyaltyKind.md) + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L61) + +--- + +### scheme + +• **scheme**: [`RoyaltyScheme`](../classes/RoyaltyScheme.md) + +#### Defined in + +[src/nevermined/api/AssetsApi.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/api/AssetsApi.ts#L62) diff --git a/docs/api-reference/interfaces/SearchQuery.md b/docs/api-reference/interfaces/SearchQuery.md index 10b8d913f..d9b69b219 100644 --- a/docs/api-reference/interfaces/SearchQuery.md +++ b/docs/api-reference/interfaces/SearchQuery.md @@ -22,7 +22,7 @@ #### Defined in -[src/common/interfaces.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/common/interfaces.ts#L20) +[src/common/interfaces.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L20) --- @@ -32,7 +32,7 @@ #### Defined in -[src/common/interfaces.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/common/interfaces.ts#L14) +[src/common/interfaces.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L14) --- @@ -42,7 +42,7 @@ #### Defined in -[src/common/interfaces.ts:15](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/common/interfaces.ts#L15) +[src/common/interfaces.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L15) --- @@ -52,7 +52,7 @@ #### Defined in -[src/common/interfaces.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/common/interfaces.ts#L17) +[src/common/interfaces.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L17) --- @@ -62,7 +62,7 @@ #### Defined in -[src/common/interfaces.ts:19](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/common/interfaces.ts#L19) +[src/common/interfaces.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L19) --- @@ -72,7 +72,7 @@ #### Defined in -[src/common/interfaces.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/common/interfaces.ts#L18) +[src/common/interfaces.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L18) --- @@ -82,4 +82,4 @@ #### Defined in -[src/common/interfaces.ts:16](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/common/interfaces.ts#L16) +[src/common/interfaces.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/common/interfaces.ts#L16) diff --git a/docs/api-reference/interfaces/Service.md b/docs/api-reference/interfaces/Service.md deleted file mode 100644 index 4cc908053..000000000 --- a/docs/api-reference/interfaces/Service.md +++ /dev/null @@ -1,41 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / Service - -# Interface: Service - -## Table of contents - -### Properties - -- [definition](Service.md#definition) -- [spec](Service.md#spec) -- [specChecksum](Service.md#specchecksum) - -## Properties - -### definition - -• **definition**: [`ServiceDefinition`](ServiceDefinition.md) - -#### Defined in - -[src/ddo/MetaData.ts:69](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L69) - ---- - -### spec - -• `Optional` **spec**: `string` - -#### Defined in - -[src/ddo/MetaData.ts:67](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L67) - ---- - -### specChecksum - -• `Optional` **specChecksum**: `string` - -#### Defined in - -[src/ddo/MetaData.ts:68](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L68) diff --git a/docs/api-reference/interfaces/ServiceAaveCredit.md b/docs/api-reference/interfaces/ServiceAaveCredit.md new file mode 100644 index 000000000..9ffd27048 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAaveCredit.md @@ -0,0 +1,104 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAaveCredit + +# Interface: ServiceAaveCredit + +## Hierarchy + +- [`ServiceCommon`](ServiceCommon.md) + + ↳ **`ServiceAaveCredit`** + +## Table of contents + +### Properties + +- [attributes](ServiceAaveCredit.md#attributes) +- [index](ServiceAaveCredit.md#index) +- [serviceEndpoint](ServiceAaveCredit.md#serviceendpoint) +- [templateId](ServiceAaveCredit.md#templateid) +- [type](ServiceAaveCredit.md#type) + +## Properties + +### attributes + +• **attributes**: `Object` + +#### Type declaration + +| Name | Type | +| :----------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- | +| `additionalInformation` | { `description`: `string` ; `priceHighestDenomination`: `number` } | +| `additionalInformation.description` | `string` | +| `additionalInformation.priceHighestDenomination` | `number` | +| `main` | { `creator`: `string` ; `datePublished`: `string` ; `name`: `string` ; `price`: `string` ; `timeout`: `number` } | +| `main.creator` | `string` | +| `main.datePublished` | `string` | +| `main.name` | `string` | +| `main.price` | `string` | +| `main.timeout` | `number` | +| `serviceAgreementTemplate?` | [`ServiceAgreementTemplate`](ServiceAgreementTemplate.md) | + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[attributes](ServiceCommon.md#attributes) + +#### Defined in + +[src/keeper/contracts/defi/Service.ts:30](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/Service.ts#L30) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[index](ServiceCommon.md#index) + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[serviceEndpoint](ServiceCommon.md#serviceendpoint) + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[templateId](ServiceCommon.md#templateid) + +#### Defined in + +[src/keeper/contracts/defi/Service.ts:29](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/Service.ts#L29) + +--- + +### type + +• **type**: `"aave-credit"` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[type](ServiceCommon.md#type) + +#### Defined in + +[src/keeper/contracts/defi/Service.ts:28](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/defi/Service.ts#L28) diff --git a/docs/api-reference/interfaces/ServiceAccess.md b/docs/api-reference/interfaces/ServiceAccess.md new file mode 100644 index 000000000..2f7a85b8c --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAccess.md @@ -0,0 +1,106 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAccess + +# Interface: ServiceAccess + +## Hierarchy + +- [`ServiceCommon`](ServiceCommon.md) + +- [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) + + ↳ **`ServiceAccess`** + +## Table of contents + +### Properties + +- [attributes](ServiceAccess.md#attributes) +- [index](ServiceAccess.md#index) +- [serviceEndpoint](ServiceAccess.md#serviceendpoint) +- [templateId](ServiceAccess.md#templateid) +- [type](ServiceAccess.md#type) + +## Properties + +### attributes + +• **attributes**: `Object` + +#### Type declaration + +| Name | Type | +| :----------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- | +| `additionalInformation` | { `description`: `string` ; `priceHighestDenomination`: `number` } | +| `additionalInformation.description` | `string` | +| `additionalInformation.priceHighestDenomination` | `number` | +| `main` | { `creator`: `string` ; `datePublished`: `string` ; `name`: `string` ; `price`: `string` ; `timeout`: `number` } | +| `main.creator` | `string` | +| `main.datePublished` | `string` | +| `main.name` | `string` | +| `main.price` | `string` | +| `main.timeout` | `number` | +| `serviceAgreementTemplate?` | [`ServiceAgreementTemplate`](ServiceAgreementTemplate.md) | + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[attributes](ServiceCommon.md#attributes) + +#### Defined in + +[src/ddo/types.ts:639](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L639) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[index](ServiceCommon.md#index) + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[serviceEndpoint](ServiceCommon.md#serviceendpoint) + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[templateId](ServiceCommon.md#templateid) + +#### Defined in + +[src/ddo/types.ts:638](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L638) + +--- + +### type + +• **type**: `"access"` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[type](ServiceCommon.md#type) + +#### Defined in + +[src/ddo/types.ts:637](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L637) diff --git a/docs/api-reference/interfaces/ServiceAgreementTemplate.md b/docs/api-reference/interfaces/ServiceAgreementTemplate.md new file mode 100644 index 000000000..fbe545c97 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAgreementTemplate.md @@ -0,0 +1,67 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAgreementTemplate + +# Interface: ServiceAgreementTemplate + +## Table of contents + +### Properties + +- [conditionDependency](ServiceAgreementTemplate.md#conditiondependency) +- [conditions](ServiceAgreementTemplate.md#conditions) +- [contractName](ServiceAgreementTemplate.md#contractname) +- [events](ServiceAgreementTemplate.md#events) +- [fulfillmentOrder](ServiceAgreementTemplate.md#fulfillmentorder) + +## Properties + +### conditionDependency + +• **conditionDependency**: `Object` + +#### Index signature + +▪ [condition: `string`]: `string`[] + +#### Defined in + +[src/ddo/types.ts:796](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L796) + +--- + +### conditions + +• **conditions**: [`ServiceAgreementTemplateCondition`](ServiceAgreementTemplateCondition.md)[] + +#### Defined in + +[src/ddo/types.ts:797](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L797) + +--- + +### contractName + +• **contractName**: `string` + +#### Defined in + +[src/ddo/types.ts:793](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L793) + +--- + +### events + +• **events**: [`ServiceAgreementTemplateEvent`](ServiceAgreementTemplateEvent.md)[] + +#### Defined in + +[src/ddo/types.ts:794](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L794) + +--- + +### fulfillmentOrder + +• **fulfillmentOrder**: `string`[] + +#### Defined in + +[src/ddo/types.ts:795](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L795) diff --git a/docs/api-reference/interfaces/ServiceAgreementTemplateCondition.md b/docs/api-reference/interfaces/ServiceAgreementTemplateCondition.md new file mode 100644 index 000000000..11853e0d6 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAgreementTemplateCondition.md @@ -0,0 +1,85 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAgreementTemplateCondition + +# Interface: ServiceAgreementTemplateCondition + +## Table of contents + +### Properties + +- [contractName](ServiceAgreementTemplateCondition.md#contractname) +- [events](ServiceAgreementTemplateCondition.md#events) +- [functionName](ServiceAgreementTemplateCondition.md#functionname) +- [name](ServiceAgreementTemplateCondition.md#name) +- [parameters](ServiceAgreementTemplateCondition.md#parameters) +- [timelock](ServiceAgreementTemplateCondition.md#timelock) +- [timeout](ServiceAgreementTemplateCondition.md#timeout) + +## Properties + +### contractName + +• **contractName**: `string` + +#### Defined in + +[src/ddo/types.ts:786](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L786) + +--- + +### events + +• **events**: [`ServiceAgreementTemplateEvent`](ServiceAgreementTemplateEvent.md)[] + +#### Defined in + +[src/ddo/types.ts:789](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L789) + +--- + +### functionName + +• **functionName**: `string` + +#### Defined in + +[src/ddo/types.ts:787](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L787) + +--- + +### name + +• **name**: `string` + +#### Defined in + +[src/ddo/types.ts:783](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L783) + +--- + +### parameters + +• **parameters**: [`ServiceAgreementTemplateParameter`](ServiceAgreementTemplateParameter.md)[] + +#### Defined in + +[src/ddo/types.ts:788](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L788) + +--- + +### timelock + +• **timelock**: `number` + +#### Defined in + +[src/ddo/types.ts:784](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L784) + +--- + +### timeout + +• **timeout**: `number` + +#### Defined in + +[src/ddo/types.ts:785](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L785) diff --git a/docs/api-reference/interfaces/ServiceAgreementTemplateEvent.md b/docs/api-reference/interfaces/ServiceAgreementTemplateEvent.md new file mode 100644 index 000000000..0294496da --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAgreementTemplateEvent.md @@ -0,0 +1,49 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAgreementTemplateEvent + +# Interface: ServiceAgreementTemplateEvent + +## Table of contents + +### Properties + +- [actorType](ServiceAgreementTemplateEvent.md#actortype) +- [handler](ServiceAgreementTemplateEvent.md#handler) +- [name](ServiceAgreementTemplateEvent.md#name) + +## Properties + +### actorType + +• **actorType**: `string` + +#### Defined in + +[src/ddo/types.ts:774](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L774) + +--- + +### handler + +• **handler**: `Object` + +#### Type declaration + +| Name | Type | +| :------------- | :------- | +| `functionName` | `string` | +| `moduleName` | `string` | +| `version` | `string` | + +#### Defined in + +[src/ddo/types.ts:775](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L775) + +--- + +### name + +• **name**: `string` + +#### Defined in + +[src/ddo/types.ts:773](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L773) diff --git a/docs/api-reference/interfaces/ServiceAgreementTemplateParameter.md b/docs/api-reference/interfaces/ServiceAgreementTemplateParameter.md new file mode 100644 index 000000000..f6e479670 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAgreementTemplateParameter.md @@ -0,0 +1,41 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAgreementTemplateParameter + +# Interface: ServiceAgreementTemplateParameter + +## Table of contents + +### Properties + +- [name](ServiceAgreementTemplateParameter.md#name) +- [type](ServiceAgreementTemplateParameter.md#type) +- [value](ServiceAgreementTemplateParameter.md#value) + +## Properties + +### name + +• **name**: `string` + +#### Defined in + +[src/ddo/types.ts:767](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L767) + +--- + +### type + +• **type**: `string` + +#### Defined in + +[src/ddo/types.ts:768](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L768) + +--- + +### value + +• **value**: `string` \| `number` \| `string`[] + +#### Defined in + +[src/ddo/types.ts:769](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L769) diff --git a/docs/api-reference/interfaces/ServiceAttributes.md b/docs/api-reference/interfaces/ServiceAttributes.md new file mode 100644 index 000000000..fe30f7a7b --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAttributes.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAttributes + +# Interface: ServiceAttributes + +## Table of contents + +### Properties + +- [nft](ServiceAttributes.md#nft) +- [price](ServiceAttributes.md#price) +- [serviceIndex](ServiceAttributes.md#serviceindex) +- [serviceType](ServiceAttributes.md#servicetype) + +## Properties + +### nft + +• `Optional` **nft**: [`NFTServiceAttributes`](../classes/NFTServiceAttributes.md) + +#### Defined in + +[src/ddo/types.ts:623](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L623) + +--- + +### price + +• `Optional` **price**: [`AssetPrice`](../classes/AssetPrice.md) + +#### Defined in + +[src/ddo/types.ts:622](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L622) + +--- + +### serviceIndex + +• `Optional` **serviceIndex**: `number` + +#### Defined in + +[src/ddo/types.ts:621](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L621) + +--- + +### serviceType + +• **serviceType**: [`ServiceType`](../code-reference.md#servicetype) + +#### Defined in + +[src/ddo/types.ts:620](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L620) diff --git a/docs/api-reference/interfaces/ServiceAuthorization.md b/docs/api-reference/interfaces/ServiceAuthorization.md new file mode 100644 index 000000000..f65f258c1 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceAuthorization.md @@ -0,0 +1,100 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceAuthorization + +# Interface: ServiceAuthorization + +## Hierarchy + +- [`ServiceCommon`](ServiceCommon.md) + + ↳ **`ServiceAuthorization`** + +## Table of contents + +### Properties + +- [attributes](ServiceAuthorization.md#attributes) +- [index](ServiceAuthorization.md#index) +- [service](ServiceAuthorization.md#service) +- [serviceEndpoint](ServiceAuthorization.md#serviceendpoint) +- [templateId](ServiceAuthorization.md#templateid) +- [type](ServiceAuthorization.md#type) + +## Properties + +### attributes + +• **attributes**: `any` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[attributes](ServiceCommon.md#attributes) + +#### Defined in + +[src/ddo/types.ts:595](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L595) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[index](ServiceCommon.md#index) + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### service + +• **service**: `"None"` \| `"RSAES-OAEP"` + +#### Defined in + +[src/ddo/types.ts:628](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L628) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[serviceEndpoint](ServiceCommon.md#serviceendpoint) + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[templateId](ServiceCommon.md#templateid) + +#### Defined in + +[src/ddo/types.ts:594](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L594) + +--- + +### type + +• **type**: `"authorization"` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[type](ServiceCommon.md#type) + +#### Defined in + +[src/ddo/types.ts:627](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L627) diff --git a/docs/api-reference/interfaces/ServiceCommon.md b/docs/api-reference/interfaces/ServiceCommon.md new file mode 100644 index 000000000..dd18ce3e2 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceCommon.md @@ -0,0 +1,81 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceCommon + +# Interface: ServiceCommon + +## Hierarchy + +- **`ServiceCommon`** + + ↳ [`ServiceMetadata`](ServiceMetadata.md) + + ↳ [`ServiceAuthorization`](ServiceAuthorization.md) + + ↳ [`ServiceAccess`](ServiceAccess.md) + + ↳ [`ServiceCompute`](ServiceCompute.md) + + ↳ [`ServiceNFTAccess`](ServiceNFTAccess.md) + + ↳ [`ServiceNFTSales`](ServiceNFTSales.md) + + ↳ [`ServiceAaveCredit`](ServiceAaveCredit.md) + +## Table of contents + +### Properties + +- [attributes](ServiceCommon.md#attributes) +- [index](ServiceCommon.md#index) +- [serviceEndpoint](ServiceCommon.md#serviceendpoint) +- [templateId](ServiceCommon.md#templateid) +- [type](ServiceCommon.md#type) + +## Properties + +### attributes + +• **attributes**: `any` + +#### Defined in + +[src/ddo/types.ts:595](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L595) + +--- + +### index + +• **index**: `number` + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Defined in + +[src/ddo/types.ts:594](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L594) + +--- + +### type + +• **type**: [`ServiceType`](../code-reference.md#servicetype) + +#### Defined in + +[src/ddo/types.ts:591](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L591) diff --git a/docs/api-reference/interfaces/ServiceCompute.md b/docs/api-reference/interfaces/ServiceCompute.md new file mode 100644 index 000000000..0a105ae0d --- /dev/null +++ b/docs/api-reference/interfaces/ServiceCompute.md @@ -0,0 +1,106 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceCompute + +# Interface: ServiceCompute + +## Hierarchy + +- [`ServiceCommon`](ServiceCommon.md) + +- [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) + + ↳ **`ServiceCompute`** + +## Table of contents + +### Properties + +- [attributes](ServiceCompute.md#attributes) +- [index](ServiceCompute.md#index) +- [serviceEndpoint](ServiceCompute.md#serviceendpoint) +- [templateId](ServiceCompute.md#templateid) +- [type](ServiceCompute.md#type) + +## Properties + +### attributes + +• **attributes**: `Object` + +#### Type declaration + +| Name | Type | +| :----------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- | +| `additionalInformation` | { `description`: `string` ; `priceHighestDenomination`: `number` } | +| `additionalInformation.description` | `string` | +| `additionalInformation.priceHighestDenomination` | `number` | +| `main` | { `creator`: `string` ; `datePublished`: `string` ; `name`: `string` ; `price`: `string` ; `timeout`: `number` } | +| `main.creator` | `string` | +| `main.datePublished` | `string` | +| `main.name` | `string` | +| `main.price` | `string` | +| `main.timeout` | `number` | +| `serviceAgreementTemplate?` | [`ServiceAgreementTemplate`](ServiceAgreementTemplate.md) | + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[attributes](ServiceCommon.md#attributes) + +#### Defined in + +[src/ddo/types.ts:658](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L658) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[index](ServiceCommon.md#index) + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[serviceEndpoint](ServiceCommon.md#serviceendpoint) + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[templateId](ServiceCommon.md#templateid) + +#### Defined in + +[src/ddo/types.ts:657](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L657) + +--- + +### type + +• **type**: `"compute"` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[type](ServiceCommon.md#type) + +#### Defined in + +[src/ddo/types.ts:656](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L656) diff --git a/docs/api-reference/interfaces/ServiceDefinition.md b/docs/api-reference/interfaces/ServiceDefinition.md index a348870c6..4555be3e3 100644 --- a/docs/api-reference/interfaces/ServiceDefinition.md +++ b/docs/api-reference/interfaces/ServiceDefinition.md @@ -26,7 +26,7 @@ #### Defined in -[src/ddo/MetaData.ts:52](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L52) +[src/ddo/types.ts:84](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L84) --- @@ -45,4 +45,4 @@ #### Defined in -[src/ddo/MetaData.ts:58](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L58) +[src/ddo/types.ts:90](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L90) diff --git a/docs/api-reference/interfaces/ServiceMetadata.md b/docs/api-reference/interfaces/ServiceMetadata.md new file mode 100644 index 000000000..b2fc94f92 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceMetadata.md @@ -0,0 +1,122 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceMetadata + +# Interface: ServiceMetadata + +## Hierarchy + +- [`ServiceCommon`](ServiceCommon.md) + + ↳ **`ServiceMetadata`** + +## Table of contents + +### Properties + +- [attributes](ServiceMetadata.md#attributes) +- [definition](ServiceMetadata.md#definition) +- [index](ServiceMetadata.md#index) +- [serviceEndpoint](ServiceMetadata.md#serviceendpoint) +- [spec](ServiceMetadata.md#spec) +- [specChecksum](ServiceMetadata.md#specchecksum) +- [templateId](ServiceMetadata.md#templateid) +- [type](ServiceMetadata.md#type) + +## Properties + +### attributes + +• **attributes**: [`MetaData`](MetaData.md) + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[attributes](ServiceCommon.md#attributes) + +#### Defined in + +[src/ddo/types.ts:633](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L633) + +--- + +### definition + +• **definition**: [`ServiceDefinition`](ServiceDefinition.md) + +#### Defined in + +[src/ddo/types.ts:101](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L101) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[index](ServiceCommon.md#index) + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[serviceEndpoint](ServiceCommon.md#serviceendpoint) + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### spec + +• `Optional` **spec**: `string` + +#### Defined in + +[src/ddo/types.ts:99](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L99) + +--- + +### specChecksum + +• `Optional` **specChecksum**: `string` + +#### Defined in + +[src/ddo/types.ts:100](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L100) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[templateId](ServiceCommon.md#templateid) + +#### Defined in + +[src/ddo/types.ts:594](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L594) + +--- + +### type + +• **type**: `"metadata"` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[type](ServiceCommon.md#type) + +#### Defined in + +[src/ddo/types.ts:632](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L632) diff --git a/docs/api-reference/interfaces/ServiceNFTAccess.md b/docs/api-reference/interfaces/ServiceNFTAccess.md new file mode 100644 index 000000000..5a30c3fca --- /dev/null +++ b/docs/api-reference/interfaces/ServiceNFTAccess.md @@ -0,0 +1,104 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceNFTAccess + +# Interface: ServiceNFTAccess + +## Hierarchy + +- [`ServiceCommon`](ServiceCommon.md) + + ↳ **`ServiceNFTAccess`** + +## Table of contents + +### Properties + +- [attributes](ServiceNFTAccess.md#attributes) +- [index](ServiceNFTAccess.md#index) +- [serviceEndpoint](ServiceNFTAccess.md#serviceendpoint) +- [templateId](ServiceNFTAccess.md#templateid) +- [type](ServiceNFTAccess.md#type) + +## Properties + +### attributes + +• **attributes**: `Object` + +#### Type declaration + +| Name | Type | +| :---------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalInformation` | { `description`: `string` } | +| `additionalInformation.description` | `string` | +| `main` | { `creator`: `string` ; `datePublished`: `string` ; `ercType`: [`ERCType`](../enums/ERCType.md) ; `name`: `string` ; `nftType`: [`NeverminedNFTType`](../code-reference.md#neverminednfttype) ; `timeout`: `number` } | +| `main.creator` | `string` | +| `main.datePublished` | `string` | +| `main.ercType` | [`ERCType`](../enums/ERCType.md) | +| `main.name` | `string` | +| `main.nftType` | [`NeverminedNFTType`](../code-reference.md#neverminednfttype) | +| `main.timeout` | `number` | +| `serviceAgreementTemplate?` | [`ServiceAgreementTemplate`](ServiceAgreementTemplate.md) | + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[attributes](ServiceCommon.md#attributes) + +#### Defined in + +[src/ddo/types.ts:677](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L677) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[index](ServiceCommon.md#index) + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[serviceEndpoint](ServiceCommon.md#serviceendpoint) + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[templateId](ServiceCommon.md#templateid) + +#### Defined in + +[src/ddo/types.ts:676](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L676) + +--- + +### type + +• **type**: `"nft-access"` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[type](ServiceCommon.md#type) + +#### Defined in + +[src/ddo/types.ts:675](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L675) diff --git a/docs/api-reference/interfaces/ServiceNFTSales.md b/docs/api-reference/interfaces/ServiceNFTSales.md new file mode 100644 index 000000000..7adc8de62 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceNFTSales.md @@ -0,0 +1,108 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceNFTSales + +# Interface: ServiceNFTSales + +## Hierarchy + +- [`ServiceCommon`](ServiceCommon.md) + +- [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) + + ↳ **`ServiceNFTSales`** + +## Table of contents + +### Properties + +- [attributes](ServiceNFTSales.md#attributes) +- [index](ServiceNFTSales.md#index) +- [serviceEndpoint](ServiceNFTSales.md#serviceendpoint) +- [templateId](ServiceNFTSales.md#templateid) +- [type](ServiceNFTSales.md#type) + +## Properties + +### attributes + +• **attributes**: `Object` + +#### Type declaration + +| Name | Type | +| :----------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalInformation` | { `description`: `string` ; `priceHighestDenomination`: `number` } | +| `additionalInformation.description` | `string` | +| `additionalInformation.priceHighestDenomination` | `number` | +| `main` | { `creator`: `string` ; `datePublished`: `string` ; `ercType`: [`ERCType`](../enums/ERCType.md) ; `name`: `string` ; `nftType`: [`NeverminedNFTType`](../code-reference.md#neverminednfttype) ; `price`: `string` ; `timeout`: `number` } | +| `main.creator` | `string` | +| `main.datePublished` | `string` | +| `main.ercType` | [`ERCType`](../enums/ERCType.md) | +| `main.name` | `string` | +| `main.nftType` | [`NeverminedNFTType`](../code-reference.md#neverminednfttype) | +| `main.price` | `string` | +| `main.timeout` | `number` | +| `serviceAgreementTemplate?` | [`ServiceAgreementTemplate`](ServiceAgreementTemplate.md) | + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[attributes](ServiceCommon.md#attributes) + +#### Defined in + +[src/ddo/types.ts:696](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L696) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[index](ServiceCommon.md#index) + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +[ServiceCommon](ServiceCommon.md).[serviceEndpoint](ServiceCommon.md#serviceendpoint) + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[templateId](ServiceCommon.md#templateid) + +#### Defined in + +[src/ddo/types.ts:695](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L695) + +--- + +### type + +• **type**: `"nft-sales"` + +#### Overrides + +[ServiceCommon](ServiceCommon.md).[type](ServiceCommon.md#type) + +#### Defined in + +[src/ddo/types.ts:694](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L694) diff --git a/docs/api-reference/interfaces/ServicePlugin.md b/docs/api-reference/interfaces/ServicePlugin.md new file mode 100644 index 000000000..36a83fce2 --- /dev/null +++ b/docs/api-reference/interfaces/ServicePlugin.md @@ -0,0 +1,113 @@ +[@nevermined-io/sdk](../code-reference.md) / ServicePlugin + +# Interface: ServicePlugin + +## Type parameters + +| Name | Type | +| :--- | :------------------------------------------------ | +| `T` | extends [`Service`](../code-reference.md#service) | + +## Implemented by + +- [`AccessService`](../classes/AccessService.md) +- [`BaseTemplate`](../classes/BaseTemplate.md) +- [`NFTAccessService`](../classes/NFTAccessService.md) +- [`NFTSalesService`](../classes/NFTSalesService.md) + +## Table of contents + +### Methods + +- [accept](ServicePlugin.md#accept) +- [createService](ServicePlugin.md#createservice) +- [process](ServicePlugin.md#process) +- [track](ServicePlugin.md#track) + +## Methods + +### accept + +▸ **accept**(`params`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------- | +| `params` | [`ValidationParams`](ValidationParams.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/ddo/types.ts:761](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L761) + +--- + +### createService + +▸ **createService**(`publisher`, `metadata`, `serviceAttributes`, `nftAttributes`, `pricedData?`): `T` + +#### Parameters + +| Name | Type | +| :------------------ | :---------------------------------------------------------------------------- | +| `publisher` | [`Account`](../classes/Account.md) | +| `metadata` | [`MetaData`](MetaData.md) | +| `serviceAttributes` | [`ServiceAttributes`](ServiceAttributes.md) | +| `nftAttributes` | [`NFTAttributes`](../classes/NFTAttributes.md) | +| `pricedData?` | [`PricedMetadataInformation`](../code-reference.md#pricedmetadatainformation) | + +#### Returns + +`T` + +#### Defined in + +[src/ddo/types.ts:751](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L751) + +--- + +### process + +▸ **process**(`params`, `from`, `txparams?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------- | +| `params` | [`ValidationParams`](ValidationParams.md) | +| `from` | [`Account`](../classes/Account.md) | +| `txparams?` | [`TxParameters`](TxParameters.md) | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/ddo/types.ts:759](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L759) + +--- + +### track + +▸ **track**(`params`, `from`, `txparams?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------- | +| `params` | [`ValidationParams`](ValidationParams.md) | +| `from` | [`Account`](../classes/Account.md) | +| `txparams?` | [`TxParameters`](TxParameters.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/ddo/types.ts:763](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L763) diff --git a/docs/api-reference/interfaces/ServiceSecondary.md b/docs/api-reference/interfaces/ServiceSecondary.md new file mode 100644 index 000000000..1737f8842 --- /dev/null +++ b/docs/api-reference/interfaces/ServiceSecondary.md @@ -0,0 +1,111 @@ +[@nevermined-io/sdk](../code-reference.md) / ServiceSecondary + +# Interface: ServiceSecondary + +## Hierarchy + +- [`Service`](../code-reference.md#service) + + ↳ **`ServiceSecondary`** + +## Table of contents + +### Properties + +- [agreementId](ServiceSecondary.md#agreementid) +- [attributes](ServiceSecondary.md#attributes) +- [did](ServiceSecondary.md#did) +- [index](ServiceSecondary.md#index) +- [serviceEndpoint](ServiceSecondary.md#serviceendpoint) +- [templateId](ServiceSecondary.md#templateid) +- [type](ServiceSecondary.md#type) + +## Properties + +### agreementId + +• **agreementId**: `string` + +#### Defined in + +[src/ddo/types.ts:715](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L715) + +--- + +### attributes + +• **attributes**: `any` + +#### Inherited from + +Service.attributes + +#### Defined in + +[src/ddo/types.ts:595](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L595) + +--- + +### did + +• **did**: `string` + +#### Defined in + +[src/ddo/types.ts:716](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L716) + +--- + +### index + +• **index**: `number` + +#### Inherited from + +Service.index + +#### Defined in + +[src/ddo/types.ts:592](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L592) + +--- + +### serviceEndpoint + +• `Optional` **serviceEndpoint**: `string` + +#### Inherited from + +Service.serviceEndpoint + +#### Defined in + +[src/ddo/types.ts:593](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L593) + +--- + +### templateId + +• `Optional` **templateId**: `string` + +#### Inherited from + +Service.templateId + +#### Defined in + +[src/ddo/types.ts:594](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L594) + +--- + +### type + +• **type**: [`ServiceType`](../code-reference.md#servicetype) + +#### Inherited from + +Service.type + +#### Defined in + +[src/ddo/types.ts:591](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L591) diff --git a/docs/api-reference/interfaces/Stage.md b/docs/api-reference/interfaces/Stage.md index 9319aaf3e..cfaa58235 100644 --- a/docs/api-reference/interfaces/Stage.md +++ b/docs/api-reference/interfaces/Stage.md @@ -9,7 +9,6 @@ - [index](Stage.md#index) - [input](Stage.md#input) - [output](Stage.md#output) -- [requirements](Stage.md#requirements) - [stageType](Stage.md#stagetype) - [transformation](Stage.md#transformation) @@ -21,17 +20,17 @@ #### Defined in -[src/ddo/MetaData.ts:27](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L27) +[src/ddo/types.ts:59](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L59) --- ### input -• **input**: [`StageInput`](StageInput.md) +• **input**: [`StageInput`](StageInput.md)[] #### Defined in -[src/ddo/MetaData.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L30) +[src/ddo/types.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L61) --- @@ -41,17 +40,7 @@ #### Defined in -[src/ddo/MetaData.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L32) - ---- - -### requirements - -• **requirements**: [`StageRequirements`](StageRequirements.md) - -#### Defined in - -[src/ddo/MetaData.ts:29](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L29) +[src/ddo/types.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L63) --- @@ -61,7 +50,7 @@ #### Defined in -[src/ddo/MetaData.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L28) +[src/ddo/types.ts:60](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L60) --- @@ -71,4 +60,4 @@ #### Defined in -[src/ddo/MetaData.ts:31](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L31) +[src/ddo/types.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L62) diff --git a/docs/api-reference/interfaces/StageInput.md b/docs/api-reference/interfaces/StageInput.md index 56725b726..2d0a790ee 100644 --- a/docs/api-reference/interfaces/StageInput.md +++ b/docs/api-reference/interfaces/StageInput.md @@ -17,7 +17,7 @@ #### Defined in -[src/ddo/MetaData.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L13) +[src/ddo/types.ts:45](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L45) --- @@ -27,4 +27,4 @@ #### Defined in -[src/ddo/MetaData.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L12) +[src/ddo/types.ts:44](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L44) diff --git a/docs/api-reference/interfaces/StageOutput.md b/docs/api-reference/interfaces/StageOutput.md index a373b351a..5bc58419b 100644 --- a/docs/api-reference/interfaces/StageOutput.md +++ b/docs/api-reference/interfaces/StageOutput.md @@ -18,7 +18,7 @@ #### Defined in -[src/ddo/MetaData.ts:22](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L22) +[src/ddo/types.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L54) --- @@ -28,7 +28,7 @@ #### Defined in -[src/ddo/MetaData.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L23) +[src/ddo/types.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L55) --- @@ -38,4 +38,4 @@ #### Defined in -[src/ddo/MetaData.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L21) +[src/ddo/types.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L53) diff --git a/docs/api-reference/interfaces/StageRequirements.md b/docs/api-reference/interfaces/StageRequirements.md deleted file mode 100644 index b0619be17..000000000 --- a/docs/api-reference/interfaces/StageRequirements.md +++ /dev/null @@ -1,27 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / StageRequirements - -# Interface: StageRequirements - -## Table of contents - -### Properties - -- [container](StageRequirements.md#container) - -## Properties - -### container - -• **container**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :------- | -| `checksum` | `string` | -| `image` | `string` | -| `tag` | `string` | - -#### Defined in - -[src/ddo/MetaData.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L4) diff --git a/docs/api-reference/interfaces/StageTransformation.md b/docs/api-reference/interfaces/StageTransformation.md index ebab8b3b9..76c9a7d7f 100644 --- a/docs/api-reference/interfaces/StageTransformation.md +++ b/docs/api-reference/interfaces/StageTransformation.md @@ -16,4 +16,4 @@ #### Defined in -[src/ddo/MetaData.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L17) +[src/ddo/types.ts:49](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L49) diff --git a/docs/api-reference/interfaces/SubscriptionToken.md b/docs/api-reference/interfaces/SubscriptionToken.md new file mode 100644 index 000000000..1de8a29fe --- /dev/null +++ b/docs/api-reference/interfaces/SubscriptionToken.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / SubscriptionToken + +# Interface: SubscriptionToken + +## Table of contents + +### Properties + +- [accessToken](SubscriptionToken.md#accesstoken) +- [neverminedProxyUri](SubscriptionToken.md#neverminedproxyuri) + +## Properties + +### accessToken + +• **accessToken**: `string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:25](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L25) + +--- + +### neverminedProxyUri + +• **neverminedProxyUri**: `string` + +#### Defined in + +[src/services/node/NeverminedNode.ts:26](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/services/node/NeverminedNode.ts#L26) diff --git a/docs/api-reference/interfaces/TemplateMetadata.md b/docs/api-reference/interfaces/TemplateMetadata.md new file mode 100644 index 000000000..de2d4949c --- /dev/null +++ b/docs/api-reference/interfaces/TemplateMetadata.md @@ -0,0 +1,52 @@ +[@nevermined-io/sdk](../code-reference.md) / TemplateMetadata + +# Interface: TemplateMetadata + +## Table of contents + +### Properties + +- [blockNumberUpdated](TemplateMetadata.md#blocknumberupdated) +- [lastUpdatedBy](TemplateMetadata.md#lastupdatedby) +- [owner](TemplateMetadata.md#owner) +- [state](TemplateMetadata.md#state) + +## Properties + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L17) + +--- + +### lastUpdatedBy + +• **lastUpdatedBy**: `string` + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L16) + +--- + +### owner + +• **owner**: `string` + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L15) + +--- + +### state + +• **state**: [`TemplateState`](../enums/TemplateState.md) + +#### Defined in + +[src/keeper/contracts/managers/TemplateStoreManager.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/managers/TemplateStoreManager.ts#L14) diff --git a/docs/api-reference/interfaces/TxParameters.md b/docs/api-reference/interfaces/TxParameters.md new file mode 100644 index 000000000..d566ff05c --- /dev/null +++ b/docs/api-reference/interfaces/TxParameters.md @@ -0,0 +1,132 @@ +[@nevermined-io/sdk](../code-reference.md) / TxParameters + +# Interface: TxParameters + +## Table of contents + +### Properties + +- [gasLimit](TxParameters.md#gaslimit) +- [gasMultiplier](TxParameters.md#gasmultiplier) +- [gasPrice](TxParameters.md#gasprice) +- [maxFeePerGas](TxParameters.md#maxfeepergas) +- [maxPriorityFeePerGas](TxParameters.md#maxpriorityfeepergas) +- [nonce](TxParameters.md#nonce) +- [progress](TxParameters.md#progress) +- [signer](TxParameters.md#signer) +- [value](TxParameters.md#value) +- [zeroDevSigner](TxParameters.md#zerodevsigner) + +## Properties + +### gasLimit + +• `Optional` **gasLimit**: `bigint` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L16) + +--- + +### gasMultiplier + +• `Optional` **gasMultiplier**: `number` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:17](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L17) + +--- + +### gasPrice + +• `Optional` **gasPrice**: `string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:18](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L18) + +--- + +### maxFeePerGas + +• `Optional` **maxFeePerGas**: `string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L20) + +--- + +### maxPriorityFeePerGas + +• `Optional` **maxPriorityFeePerGas**: `string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:19](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L19) + +--- + +### nonce + +• `Optional` **nonce**: `number` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:23](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L23) + +--- + +### progress + +• `Optional` **progress**: (`data`: `any`) => `void` + +#### Type declaration + +▸ (`data`): `void` + +##### Parameters + +| Name | Type | +| :----- | :---- | +| `data` | `any` | + +##### Returns + +`void` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:24](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L24) + +--- + +### signer + +• `Optional` **signer**: `Signer` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:21](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L21) + +--- + +### value + +• `Optional` **value**: `string` + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L15) + +--- + +### zeroDevSigner + +• `Optional` **zeroDevSigner**: `ZeroDevAccountSigner`<`"ECDSA"`\> + +#### Defined in + +[src/keeper/contracts/ContractBase.ts:22](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/ContractBase.ts#L22) diff --git a/docs/api-reference/interfaces/TypedDataDomain.md b/docs/api-reference/interfaces/TypedDataDomain.md new file mode 100644 index 000000000..b516c7875 --- /dev/null +++ b/docs/api-reference/interfaces/TypedDataDomain.md @@ -0,0 +1,41 @@ +[@nevermined-io/sdk](../code-reference.md) / TypedDataDomain + +# Interface: TypedDataDomain + +## Table of contents + +### Properties + +- [chainId](TypedDataDomain.md#chainid) +- [name](TypedDataDomain.md#name) +- [version](TypedDataDomain.md#version) + +## Properties + +### chainId + +• **chainId**: `number` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:16](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L16) + +--- + +### name + +• **name**: `string` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:14](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L14) + +--- + +### version + +• **version**: `string` + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:15](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L15) diff --git a/docs/api-reference/interfaces/TypedDataTypes.md b/docs/api-reference/interfaces/TypedDataTypes.md new file mode 100644 index 000000000..4c04c80a2 --- /dev/null +++ b/docs/api-reference/interfaces/TypedDataTypes.md @@ -0,0 +1,19 @@ +[@nevermined-io/sdk](../code-reference.md) / TypedDataTypes + +# Interface: TypedDataTypes + +## Table of contents + +### Properties + +- [Nevermined](TypedDataTypes.md#nevermined) + +## Properties + +### Nevermined + +• **Nevermined**: { `name`: `string` ; `type`: `string` }[] + +#### Defined in + +[src/nevermined/utils/JwtUtils.ts:20](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/nevermined/utils/JwtUtils.ts#L20) diff --git a/docs/api-reference/interfaces/UsedEvent.md b/docs/api-reference/interfaces/UsedEvent.md new file mode 100644 index 000000000..a68de7335 --- /dev/null +++ b/docs/api-reference/interfaces/UsedEvent.md @@ -0,0 +1,126 @@ +[@nevermined-io/sdk](../code-reference.md) / UsedEvent + +# Interface: UsedEvent + +## Hierarchy + +- [`ProvenanceBaseEvent`](ProvenanceBaseEvent.md) + + ↳ **`UsedEvent`** + +## Table of contents + +### Properties + +- [activityId](UsedEvent.md#activityid) +- [agentId](UsedEvent.md#agentid) +- [attributes](UsedEvent.md#attributes) +- [blockNumberUpdated](UsedEvent.md#blocknumberupdated) +- [did](UsedEvent.md#did) +- [event](UsedEvent.md#event) +- [method](UsedEvent.md#method) +- [provId](UsedEvent.md#provid) + +## Properties + +### activityId + +• **activityId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[activityId](ProvenanceBaseEvent.md#activityid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L55) + +--- + +### agentId + +• **agentId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:66](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L66) + +--- + +### attributes + +• `Optional` **attributes**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[attributes](ProvenanceBaseEvent.md#attributes) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L57) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[blockNumberUpdated](ProvenanceBaseEvent.md#blocknumberupdated) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L58) + +--- + +### did + +• **did**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:65](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L65) + +--- + +### event + +• **event**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[event](ProvenanceBaseEvent.md#event) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L53) + +--- + +### method + +• **method**: [`ProvenanceMethod`](../enums/ProvenanceMethod.md) + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[method](ProvenanceBaseEvent.md#method) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L54) + +--- + +### provId + +• **provId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[provId](ProvenanceBaseEvent.md#provid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L56) diff --git a/docs/api-reference/interfaces/ValidationParams.md b/docs/api-reference/interfaces/ValidationParams.md new file mode 100644 index 000000000..38a702631 --- /dev/null +++ b/docs/api-reference/interfaces/ValidationParams.md @@ -0,0 +1,118 @@ +[@nevermined-io/sdk](../code-reference.md) / ValidationParams + +# Interface: ValidationParams + +## Table of contents + +### Properties + +- [agreement_id](ValidationParams.md#agreement_id) +- [babysig](ValidationParams.md#babysig) +- [buyer](ValidationParams.md#buyer) +- [consumer_address](ValidationParams.md#consumer_address) +- [did](ValidationParams.md#did) +- [duration](ValidationParams.md#duration) +- [expiration](ValidationParams.md#expiration) +- [nft_amount](ValidationParams.md#nft_amount) +- [nft_holder](ValidationParams.md#nft_holder) +- [service_index](ValidationParams.md#service_index) + +## Properties + +### agreement_id + +• **agreement_id**: `string` + +#### Defined in + +[src/ddo/types.ts:738](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L738) + +--- + +### babysig + +• `Optional` **babysig**: [`Babysig`](Babysig.md) + +#### Defined in + +[src/ddo/types.ts:743](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L743) + +--- + +### buyer + +• `Optional` **buyer**: `string` + +#### Defined in + +[src/ddo/types.ts:742](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L742) + +--- + +### consumer_address + +• `Optional` **consumer_address**: `string` + +#### Defined in + +[src/ddo/types.ts:741](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L741) + +--- + +### did + +• **did**: `string` + +#### Defined in + +[src/ddo/types.ts:739](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L739) + +--- + +### duration + +• `Optional` **duration**: `number` + +#### Defined in + +[src/ddo/types.ts:746](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L746) + +--- + +### expiration + +• `Optional` **expiration**: `number` + +#### Defined in + +[src/ddo/types.ts:747](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L747) + +--- + +### nft_amount + +• `Optional` **nft_amount**: `bigint` + +#### Defined in + +[src/ddo/types.ts:744](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L744) + +--- + +### nft_holder + +• `Optional` **nft_holder**: `string` + +#### Defined in + +[src/ddo/types.ts:745](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L745) + +--- + +### service_index + +• `Optional` **service_index**: `number` + +#### Defined in + +[src/ddo/types.ts:740](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L740) diff --git a/docs/api-reference/interfaces/ValuePair.md b/docs/api-reference/interfaces/ValuePair.md new file mode 100644 index 000000000..bc0ffffc0 --- /dev/null +++ b/docs/api-reference/interfaces/ValuePair.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / ValuePair + +# Interface: ValuePair + +## Table of contents + +### Properties + +- [type](ValuePair.md#type) +- [value](ValuePair.md#value) + +## Properties + +### type + +• **type**: `string` + +#### Defined in + +[src/models/types.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L62) + +--- + +### value + +• **value**: `any` + +#### Defined in + +[src/models/types.ts:63](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/models/types.ts#L63) diff --git a/docs/api-reference/interfaces/WasAssociatedWithEvent.md b/docs/api-reference/interfaces/WasAssociatedWithEvent.md new file mode 100644 index 000000000..3dc91fcd2 --- /dev/null +++ b/docs/api-reference/interfaces/WasAssociatedWithEvent.md @@ -0,0 +1,126 @@ +[@nevermined-io/sdk](../code-reference.md) / WasAssociatedWithEvent + +# Interface: WasAssociatedWithEvent + +## Hierarchy + +- [`ProvenanceBaseEvent`](ProvenanceBaseEvent.md) + + ↳ **`WasAssociatedWithEvent`** + +## Table of contents + +### Properties + +- [activityId](WasAssociatedWithEvent.md#activityid) +- [agentId](WasAssociatedWithEvent.md#agentid) +- [attributes](WasAssociatedWithEvent.md#attributes) +- [blockNumberUpdated](WasAssociatedWithEvent.md#blocknumberupdated) +- [entityDid](WasAssociatedWithEvent.md#entitydid) +- [event](WasAssociatedWithEvent.md#event) +- [method](WasAssociatedWithEvent.md#method) +- [provId](WasAssociatedWithEvent.md#provid) + +## Properties + +### activityId + +• **activityId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[activityId](ProvenanceBaseEvent.md#activityid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L55) + +--- + +### agentId + +• **agentId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:75](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L75) + +--- + +### attributes + +• `Optional` **attributes**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[attributes](ProvenanceBaseEvent.md#attributes) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L57) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[blockNumberUpdated](ProvenanceBaseEvent.md#blocknumberupdated) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L58) + +--- + +### entityDid + +• **entityDid**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:74](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L74) + +--- + +### event + +• **event**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[event](ProvenanceBaseEvent.md#event) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L53) + +--- + +### method + +• **method**: [`ProvenanceMethod`](../enums/ProvenanceMethod.md) + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[method](ProvenanceBaseEvent.md#method) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L54) + +--- + +### provId + +• **provId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[provId](ProvenanceBaseEvent.md#provid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L56) diff --git a/docs/api-reference/interfaces/WasDerivedFromEvent.md b/docs/api-reference/interfaces/WasDerivedFromEvent.md new file mode 100644 index 000000000..342b311f7 --- /dev/null +++ b/docs/api-reference/interfaces/WasDerivedFromEvent.md @@ -0,0 +1,137 @@ +[@nevermined-io/sdk](../code-reference.md) / WasDerivedFromEvent + +# Interface: WasDerivedFromEvent + +## Hierarchy + +- [`ProvenanceBaseEvent`](ProvenanceBaseEvent.md) + + ↳ **`WasDerivedFromEvent`** + +## Table of contents + +### Properties + +- [activityId](WasDerivedFromEvent.md#activityid) +- [agentId](WasDerivedFromEvent.md#agentid) +- [attributes](WasDerivedFromEvent.md#attributes) +- [blockNumberUpdated](WasDerivedFromEvent.md#blocknumberupdated) +- [event](WasDerivedFromEvent.md#event) +- [method](WasDerivedFromEvent.md#method) +- [newEntityDid](WasDerivedFromEvent.md#newentitydid) +- [provId](WasDerivedFromEvent.md#provid) +- [usedEntityDid](WasDerivedFromEvent.md#usedentitydid) + +## Properties + +### activityId + +• **activityId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[activityId](ProvenanceBaseEvent.md#activityid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L55) + +--- + +### agentId + +• **agentId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:71](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L71) + +--- + +### attributes + +• `Optional` **attributes**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[attributes](ProvenanceBaseEvent.md#attributes) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L57) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[blockNumberUpdated](ProvenanceBaseEvent.md#blocknumberupdated) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L58) + +--- + +### event + +• **event**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[event](ProvenanceBaseEvent.md#event) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L53) + +--- + +### method + +• **method**: [`ProvenanceMethod`](../enums/ProvenanceMethod.md) + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[method](ProvenanceBaseEvent.md#method) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L54) + +--- + +### newEntityDid + +• **newEntityDid**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:69](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L69) + +--- + +### provId + +• **provId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[provId](ProvenanceBaseEvent.md#provid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L56) + +--- + +### usedEntityDid + +• **usedEntityDid**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:70](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L70) diff --git a/docs/api-reference/interfaces/WasGeneratedByEvent.md b/docs/api-reference/interfaces/WasGeneratedByEvent.md new file mode 100644 index 000000000..3430dac8d --- /dev/null +++ b/docs/api-reference/interfaces/WasGeneratedByEvent.md @@ -0,0 +1,126 @@ +[@nevermined-io/sdk](../code-reference.md) / WasGeneratedByEvent + +# Interface: WasGeneratedByEvent + +## Hierarchy + +- [`ProvenanceBaseEvent`](ProvenanceBaseEvent.md) + + ↳ **`WasGeneratedByEvent`** + +## Table of contents + +### Properties + +- [activityId](WasGeneratedByEvent.md#activityid) +- [agentId](WasGeneratedByEvent.md#agentid) +- [attributes](WasGeneratedByEvent.md#attributes) +- [blockNumberUpdated](WasGeneratedByEvent.md#blocknumberupdated) +- [did](WasGeneratedByEvent.md#did) +- [event](WasGeneratedByEvent.md#event) +- [method](WasGeneratedByEvent.md#method) +- [provId](WasGeneratedByEvent.md#provid) + +## Properties + +### activityId + +• **activityId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[activityId](ProvenanceBaseEvent.md#activityid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:55](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L55) + +--- + +### agentId + +• **agentId**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:62](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L62) + +--- + +### attributes + +• `Optional` **attributes**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[attributes](ProvenanceBaseEvent.md#attributes) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:57](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L57) + +--- + +### blockNumberUpdated + +• **blockNumberUpdated**: `number` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[blockNumberUpdated](ProvenanceBaseEvent.md#blocknumberupdated) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:58](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L58) + +--- + +### did + +• **did**: `string` + +#### Defined in + +[src/keeper/contracts/Provenance.ts:61](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L61) + +--- + +### event + +• **event**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[event](ProvenanceBaseEvent.md#event) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:53](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L53) + +--- + +### method + +• **method**: [`ProvenanceMethod`](../enums/ProvenanceMethod.md) + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[method](ProvenanceBaseEvent.md#method) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:54](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L54) + +--- + +### provId + +• **provId**: `string` + +#### Inherited from + +[ProvenanceBaseEvent](ProvenanceBaseEvent.md).[provId](ProvenanceBaseEvent.md#provid) + +#### Defined in + +[src/keeper/contracts/Provenance.ts:56](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/keeper/contracts/Provenance.ts#L56) diff --git a/docs/api-reference/interfaces/WebService.md b/docs/api-reference/interfaces/WebService.md new file mode 100644 index 000000000..eb6c01e21 --- /dev/null +++ b/docs/api-reference/interfaces/WebService.md @@ -0,0 +1,65 @@ +[@nevermined-io/sdk](../code-reference.md) / WebService + +# Interface: WebService + +Interface describing an asset of type `service` + +## Table of contents + +### Properties + +- [encryptedAttributes](WebService.md#encryptedattributes) +- [endpoints](WebService.md#endpoints) +- [internalAttributes](WebService.md#internalattributes) +- [openEndpoints](WebService.md#openendpoints) +- [type](WebService.md#type) + +## Properties + +### encryptedAttributes + +• `Optional` **encryptedAttributes**: `string` + +#### Defined in + +[src/ddo/types.ts:194](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L194) + +--- + +### endpoints + +• `Optional` **endpoints**: { `[verb: string]`: `string`; }[] + +#### Defined in + +[src/ddo/types.ts:188](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L188) + +--- + +### internalAttributes + +• `Optional` **internalAttributes**: [`WebServiceInternalAttributes`](WebServiceInternalAttributes.md) + +#### Defined in + +[src/ddo/types.ts:192](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L192) + +--- + +### openEndpoints + +• `Optional` **openEndpoints**: `string`[] + +#### Defined in + +[src/ddo/types.ts:190](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L190) + +--- + +### type + +• `Optional` **type**: `"Other"` \| `"RESTful"` \| `"GrapQL"` \| `"RPC"` + +#### Defined in + +[src/ddo/types.ts:186](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L186) diff --git a/docs/api-reference/interfaces/WebServiceInternalAttributes.md b/docs/api-reference/interfaces/WebServiceInternalAttributes.md new file mode 100644 index 000000000..7bf0ebccc --- /dev/null +++ b/docs/api-reference/interfaces/WebServiceInternalAttributes.md @@ -0,0 +1,30 @@ +[@nevermined-io/sdk](../code-reference.md) / WebServiceInternalAttributes + +# Interface: WebServiceInternalAttributes + +## Table of contents + +### Properties + +- [authentication](WebServiceInternalAttributes.md#authentication) +- [headers](WebServiceInternalAttributes.md#headers) + +## Properties + +### authentication + +• `Optional` **authentication**: [`ResourceAuthentication`](ResourceAuthentication.md) + +#### Defined in + +[src/ddo/types.ts:198](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L198) + +--- + +### headers + +• `Optional` **headers**: { `[verb: string]`: `string`; }[] + +#### Defined in + +[src/ddo/types.ts:200](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L200) diff --git a/docs/api-reference/interfaces/Workflow.md b/docs/api-reference/interfaces/Workflow.md index 6a0eeddc2..2356b6c2f 100644 --- a/docs/api-reference/interfaces/Workflow.md +++ b/docs/api-reference/interfaces/Workflow.md @@ -6,14 +6,25 @@ ### Properties +- [coordinationType](Workflow.md#coordinationtype) - [stages](Workflow.md#stages) ## Properties +### coordinationType + +• **coordinationType**: `"argo"` \| `"fl-coordinator"` \| `"bacalhau"` + +#### Defined in + +[src/ddo/types.ts:67](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L67) + +--- + ### stages • **stages**: [`Stage`](Stage.md)[] #### Defined in -[src/ddo/MetaData.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/ddo/MetaData.ts#L36) +[src/ddo/types.ts:68](https://github.com/nevermined-io/sdk-js/blob/bb26f8ab/src/ddo/types.ts#L68) diff --git a/docs/api-reference/interfaces/conditions.ConditionContext.md b/docs/api-reference/interfaces/conditions.ConditionContext.md deleted file mode 100644 index 1057d7421..000000000 --- a/docs/api-reference/interfaces/conditions.ConditionContext.md +++ /dev/null @@ -1,54 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ConditionContext - -# Interface: ConditionContext - -[conditions](../modules/conditions.md).ConditionContext - -## Table of contents - -### Properties - -- [creator](conditions.ConditionContext.md#creator) -- [ddo](conditions.ConditionContext.md#ddo) -- [rewards](conditions.ConditionContext.md#rewards) -- [service](conditions.ConditionContext.md#service) - -## Properties - -### creator - -• **creator**: `string` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L23) - ---- - -### ddo - -• **ddo**: [`DDO`](../classes/DDO.md) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L20) - ---- - -### rewards - -• **rewards**: `default` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:22](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L22) - ---- - -### service - -• **service**: `ServiceCommon` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:21](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L21) diff --git a/docs/api-reference/interfaces/conditions.ConditionInstance.md b/docs/api-reference/interfaces/conditions.ConditionInstance.md deleted file mode 100644 index 36b446a4b..000000000 --- a/docs/api-reference/interfaces/conditions.ConditionInstance.md +++ /dev/null @@ -1,123 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ConditionInstance - -# Interface: ConditionInstance - -[conditions](../modules/conditions.md).ConditionInstance - -## Type parameters - -| Name | -| :------ | -| `Extra` | - -## Hierarchy - -- [`ConditionInstanceSmall`](conditions.ConditionInstanceSmall.md) - - ↳ **`ConditionInstance`** - -## Table of contents - -### Properties - -- [agreementId](conditions.ConditionInstance.md#agreementid) -- [condition](conditions.ConditionInstance.md#condition) -- [id](conditions.ConditionInstance.md#id) -- [list](conditions.ConditionInstance.md#list) -- [params](conditions.ConditionInstance.md#params) -- [seed](conditions.ConditionInstance.md#seed) - -## Properties - -### agreementId - -• **agreementId**: `string` - -#### Inherited from - -[ConditionInstanceSmall](conditions.ConditionInstanceSmall.md).[agreementId](conditions.ConditionInstanceSmall.md#agreementid) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L35) - ---- - -### condition - -• **condition**: `string` - -#### Inherited from - -[ConditionInstanceSmall](conditions.ConditionInstanceSmall.md).[condition](conditions.ConditionInstanceSmall.md#condition) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L36) - ---- - -### id - -• **id**: `string` - -#### Inherited from - -[ConditionInstanceSmall](conditions.ConditionInstanceSmall.md).[id](conditions.ConditionInstanceSmall.md#id) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:34](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L34) - ---- - -### list - -• **list**: `any`[] - -#### Inherited from - -[ConditionInstanceSmall](conditions.ConditionInstanceSmall.md).[list](conditions.ConditionInstanceSmall.md#list) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L32) - ---- - -### params - -• **params**: (`method`: [`ConditionMethod`](../modules/conditions.md#conditionmethod), `arg`: `Extra`) => `Promise`<`any`[]\> - -#### Type declaration - -▸ (`method`, `arg`): `Promise`<`any`[]\> - -##### Parameters - -| Name | Type | -| :------- | :------------------------------------------------------------ | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | -| `arg` | `Extra` | - -##### Returns - -`Promise`<`any`[]\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:40](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L40) - ---- - -### seed - -• **seed**: `string` - -#### Inherited from - -[ConditionInstanceSmall](conditions.ConditionInstanceSmall.md).[seed](conditions.ConditionInstanceSmall.md#seed) - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L33) diff --git a/docs/api-reference/interfaces/conditions.ConditionInstanceSmall.md b/docs/api-reference/interfaces/conditions.ConditionInstanceSmall.md deleted file mode 100644 index 3a4b6089c..000000000 --- a/docs/api-reference/interfaces/conditions.ConditionInstanceSmall.md +++ /dev/null @@ -1,71 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ConditionInstanceSmall - -# Interface: ConditionInstanceSmall - -[conditions](../modules/conditions.md).ConditionInstanceSmall - -## Hierarchy - -- **`ConditionInstanceSmall`** - - ↳ [`ConditionInstance`](conditions.ConditionInstance.md) - -## Table of contents - -### Properties - -- [agreementId](conditions.ConditionInstanceSmall.md#agreementid) -- [condition](conditions.ConditionInstanceSmall.md#condition) -- [id](conditions.ConditionInstanceSmall.md#id) -- [list](conditions.ConditionInstanceSmall.md#list) -- [seed](conditions.ConditionInstanceSmall.md#seed) - -## Properties - -### agreementId - -• **agreementId**: `string` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:35](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L35) - ---- - -### condition - -• **condition**: `string` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:36](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L36) - ---- - -### id - -• **id**: `string` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:34](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L34) - ---- - -### list - -• **list**: `any`[] - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:32](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L32) - ---- - -### seed - -• **seed**: `string` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:33](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L33) diff --git a/docs/api-reference/interfaces/conditions.ConditionParameters.md b/docs/api-reference/interfaces/conditions.ConditionParameters.md deleted file mode 100644 index 24d6ab507..000000000 --- a/docs/api-reference/interfaces/conditions.ConditionParameters.md +++ /dev/null @@ -1,53 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [conditions](../modules/conditions.md) / ConditionParameters - -# Interface: ConditionParameters - -[conditions](../modules/conditions.md).ConditionParameters - -## Type parameters - -| Name | -| :------ | -| `Extra` | - -## Table of contents - -### Properties - -- [list](conditions.ConditionParameters.md#list) -- [params](conditions.ConditionParameters.md#params) - -## Properties - -### list - -• **list**: `any`[] - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:27](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L27) - ---- - -### params - -• **params**: (`method`: [`ConditionMethod`](../modules/conditions.md#conditionmethod), `arg`: `Extra`) => `Promise`<`any`[]\> - -#### Type declaration - -▸ (`method`, `arg`): `Promise`<`any`[]\> - -##### Parameters - -| Name | Type | -| :------- | :------------------------------------------------------------ | -| `method` | [`ConditionMethod`](../modules/conditions.md#conditionmethod) | -| `arg` | `Extra` | - -##### Returns - -`Promise`<`any`[]\> - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:28](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L28) diff --git a/docs/api-reference/interfaces/events.ContractEventSubscription.md b/docs/api-reference/interfaces/events.ContractEventSubscription.md deleted file mode 100644 index 04ddda527..000000000 --- a/docs/api-reference/interfaces/events.ContractEventSubscription.md +++ /dev/null @@ -1,29 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / ContractEventSubscription - -# Interface: ContractEventSubscription - -[events](../modules/events.md).ContractEventSubscription - -## Table of contents - -### Properties - -- [unsubscribe](events.ContractEventSubscription.md#unsubscribe) - -## Properties - -### unsubscribe - -• **unsubscribe**: () => `void` - -#### Type declaration - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[src/events/NeverminedEvent.ts:23](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L23) diff --git a/docs/api-reference/interfaces/events.EventOptions.md b/docs/api-reference/interfaces/events.EventOptions.md deleted file mode 100644 index 8874ac1d3..000000000 --- a/docs/api-reference/interfaces/events.EventOptions.md +++ /dev/null @@ -1,87 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / EventOptions - -# Interface: EventOptions - -[events](../modules/events.md).EventOptions - -## Table of contents - -### Properties - -- [eventName](events.EventOptions.md#eventname) -- [filterJsonRpc](events.EventOptions.md#filterjsonrpc) -- [filterSubgraph](events.EventOptions.md#filtersubgraph) -- [fromBlock](events.EventOptions.md#fromblock) -- [methodName](events.EventOptions.md#methodname) -- [result](events.EventOptions.md#result) -- [toBlock](events.EventOptions.md#toblock) - -## Properties - -### eventName - -• `Optional` **eventName**: `string` - -#### Defined in - -[src/events/NeverminedEvent.ts:9](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L9) - ---- - -### filterJsonRpc - -• `Optional` **filterJsonRpc**: [`Filter`](events.Filter.md) - -#### Defined in - -[src/events/NeverminedEvent.ts:10](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L10) - ---- - -### filterSubgraph - -• `Optional` **filterSubgraph**: `Record`<`string`, `unknown`\> - -#### Defined in - -[src/events/NeverminedEvent.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L11) - ---- - -### fromBlock - -• `Optional` **fromBlock**: `string` \| `number` - -#### Defined in - -[src/events/NeverminedEvent.ts:13](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L13) - ---- - -### methodName - -• `Optional` **methodName**: `string` - -#### Defined in - -[src/events/NeverminedEvent.ts:8](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L8) - ---- - -### result - -• `Optional` **result**: `Record`<`string`, `unknown`\> - -#### Defined in - -[src/events/NeverminedEvent.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L12) - ---- - -### toBlock - -• `Optional` **toBlock**: `string` \| `number` - -#### Defined in - -[src/events/NeverminedEvent.ts:14](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L14) diff --git a/docs/api-reference/interfaces/events.Filter.md b/docs/api-reference/interfaces/events.Filter.md deleted file mode 100644 index 8d3e21f03..000000000 --- a/docs/api-reference/interfaces/events.Filter.md +++ /dev/null @@ -1,9 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [events](../modules/events.md) / Filter - -# Interface: Filter - -[events](../modules/events.md).Filter - -## Indexable - -▪ [key: `string`]: `number` \| `string` \| `string`[] \| `number`[] diff --git a/docs/api-reference/interfaces/templates.AgreementInstance.md b/docs/api-reference/interfaces/templates.AgreementInstance.md deleted file mode 100644 index f84c82e1f..000000000 --- a/docs/api-reference/interfaces/templates.AgreementInstance.md +++ /dev/null @@ -1,49 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / AgreementInstance - -# Interface: AgreementInstance - -[templates](../modules/templates.md).AgreementInstance - -## Type parameters - -| Name | -| :------- | -| `Params` | - -## Table of contents - -### Properties - -- [agreementId](templates.AgreementInstance.md#agreementid) -- [instances](templates.AgreementInstance.md#instances) -- [list](templates.AgreementInstance.md#list) - -## Properties - -### agreementId - -• **agreementId**: `string` - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:50](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L50) - ---- - -### instances - -• **instances**: [`ConditionInstanceSmall`](conditions.ConditionInstanceSmall.md)[] - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:51](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L51) - ---- - -### list - -• **list**: `Params` - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:49](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L49) diff --git a/docs/api-reference/interfaces/templates.PaymentData.md b/docs/api-reference/interfaces/templates.PaymentData.md deleted file mode 100644 index c436484ee..000000000 --- a/docs/api-reference/interfaces/templates.PaymentData.md +++ /dev/null @@ -1,54 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [templates](../modules/templates.md) / PaymentData - -# Interface: PaymentData - -[templates](../modules/templates.md).PaymentData - -## Table of contents - -### Properties - -- [amounts](templates.PaymentData.md#amounts) -- [receivers](templates.PaymentData.md#receivers) -- [rewardAddress](templates.PaymentData.md#rewardaddress) -- [tokenAddress](templates.PaymentData.md#tokenaddress) - -## Properties - -### amounts - -• **amounts**: `default`[] - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:57](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L57) - ---- - -### receivers - -• **receivers**: `string`[] - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:58](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L58) - ---- - -### rewardAddress - -• **rewardAddress**: `string` - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:55](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L55) - ---- - -### tokenAddress - -• **tokenAddress**: `string` - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:56](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L56) diff --git a/docs/api-reference/modules/KeyTransfer.md b/docs/api-reference/modules/KeyTransfer.md deleted file mode 100644 index edf9aae46..000000000 --- a/docs/api-reference/modules/KeyTransfer.md +++ /dev/null @@ -1,14 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / KeyTransfer - -# Namespace: KeyTransfer - -## Table of contents - -### Classes - -- [BabyjubPublicKey](../classes/KeyTransfer.BabyjubPublicKey.md) -- [MimcCipher](../classes/KeyTransfer.MimcCipher.md) - -### Interfaces - -- [Babysig](../interfaces/KeyTransfer.Babysig.md) diff --git a/docs/api-reference/modules/conditions.md b/docs/api-reference/modules/conditions.md deleted file mode 100644 index 7eef3c0df..000000000 --- a/docs/api-reference/modules/conditions.md +++ /dev/null @@ -1,80 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / conditions - -# Namespace: conditions - -## Table of contents - -### References - -- [Condition](conditions.md#condition) -- [ConditionState](conditions.md#conditionstate) - -### Classes - -- [AaveBorrowCondition](../classes/conditions.AaveBorrowCondition.md) -- [AaveCollateralDepositCondition](../classes/conditions.AaveCollateralDepositCondition.md) -- [AaveCollateralWithdrawCondition](../classes/conditions.AaveCollateralWithdrawCondition.md) -- [AaveRepayCondition](../classes/conditions.AaveRepayCondition.md) -- [AccessCondition](../classes/conditions.AccessCondition.md) -- [ComputeExecutionCondition](../classes/conditions.ComputeExecutionCondition.md) -- [ConditionSmall](../classes/conditions.ConditionSmall.md) -- [ConsumerCondition](../classes/conditions.ConsumerCondition.md) -- [DistributeNFTCollateralCondition](../classes/conditions.DistributeNFTCollateralCondition.md) -- [EscrowPaymentCondition](../classes/conditions.EscrowPaymentCondition.md) -- [LockPaymentCondition](../classes/conditions.LockPaymentCondition.md) -- [NFT721HolderCondition](../classes/conditions.NFT721HolderCondition.md) -- [NFT721LockCondition](../classes/conditions.NFT721LockCondition.md) -- [NFTAccessCondition](../classes/conditions.NFTAccessCondition.md) -- [NFTHolderCondition](../classes/conditions.NFTHolderCondition.md) -- [NFTLockCondition](../classes/conditions.NFTLockCondition.md) -- [ProviderCondition](../classes/conditions.ProviderCondition.md) -- [TransferDIDOwnershipCondition](../classes/conditions.TransferDIDOwnershipCondition.md) -- [TransferNFT721Condition](../classes/conditions.TransferNFT721Condition.md) -- [TransferNFTCondition](../classes/conditions.TransferNFTCondition.md) - -### Interfaces - -- [ConditionContext](../interfaces/conditions.ConditionContext.md) -- [ConditionInstance](../interfaces/conditions.ConditionInstance.md) -- [ConditionInstanceSmall](../interfaces/conditions.ConditionInstanceSmall.md) -- [ConditionParameters](../interfaces/conditions.ConditionParameters.md) - -### Type Aliases - -- [ConditionMethod](conditions.md#conditionmethod) - -### Variables - -- [conditionStateNames](conditions.md#conditionstatenames) - -## References - -### Condition - -Re-exports [Condition](../classes/Condition.md) - ---- - -### ConditionState - -Re-exports [ConditionState](../enums/ConditionState.md) - -## Type Aliases - -### ConditionMethod - -Ƭ **ConditionMethod**: `"fulfill"` \| `"fulfillForDelegate"` - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L17) - -## Variables - -### conditionStateNames - -• `Const` **conditionStateNames**: `string`[] - -#### Defined in - -[src/keeper/contracts/conditions/Condition.abstract.ts:43](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/conditions/Condition.abstract.ts#L43) diff --git a/docs/api-reference/modules/events.md b/docs/api-reference/modules/events.md deleted file mode 100644 index 64d1fd870..000000000 --- a/docs/api-reference/modules/events.md +++ /dev/null @@ -1,33 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / events - -# Namespace: events - -## Table of contents - -### Classes - -- [ContractEvent](../classes/events.ContractEvent.md) -- [EventHandler](../classes/events.EventHandler.md) -- [NeverminedEvent](../classes/events.NeverminedEvent.md) -- [SubgraphEvent](../classes/events.SubgraphEvent.md) - -### Interfaces - -- [ContractEventSubscription](../interfaces/events.ContractEventSubscription.md) -- [EventEmitter](../interfaces/events.EventEmitter.md) -- [EventOptions](../interfaces/events.EventOptions.md) -- [Filter](../interfaces/events.Filter.md) - -### Type Aliases - -- [EventResult](events.md#eventresult) - -## Type Aliases - -### EventResult - -Ƭ **EventResult**: `Promise`<`any`[]\> - -#### Defined in - -[src/events/NeverminedEvent.ts:26](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/events/NeverminedEvent.ts#L26) diff --git a/docs/api-reference/modules/subgraphs.AaveBorrowCondition.md b/docs/api-reference/modules/subgraphs.AaveBorrowCondition.md deleted file mode 100644 index c5e225f32..000000000 --- a/docs/api-reference/modules/subgraphs.AaveBorrowCondition.md +++ /dev/null @@ -1,508 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AaveBorrowCondition - -# Namespace: AaveBorrowCondition - -[subgraphs](subgraphs.md).AaveBorrowCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.AaveBorrowCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.AaveBorrowCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.AaveBorrowCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.AaveBorrowCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.AaveBorrowCondition.md#initializedargs) -- [InitializedFields](subgraphs.AaveBorrowCondition.md#initializedfields) -- [InitializedFilter](subgraphs.AaveBorrowCondition.md#initializedfilter) -- [InitializedResult](subgraphs.AaveBorrowCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.AaveBorrowCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AaveBorrowCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AaveBorrowCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AaveBorrowCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AaveBorrowCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.AaveBorrowCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.AaveBorrowCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.AaveBorrowCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.AaveBorrowCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AaveBorrowCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AaveBorrowCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:60 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:54 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:48 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:91 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:87 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:65 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:83 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:128 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:123 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:96 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:118 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveBorrowCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.AaveBorrowCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:63 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveBorrowCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.AaveBorrowCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.AaveBorrowCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveBorrowCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:64 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveBorrowCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AaveBorrowCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:94 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveBorrowCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AaveBorrowCondition.md#initializedfilter), [`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AaveBorrowCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveBorrowCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:95 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveBorrowCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveBorrowCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:131 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveBorrowCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AaveBorrowCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveBorrowCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveBorrowCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveBorrowCondition.d.ts:132 diff --git a/docs/api-reference/modules/subgraphs.AaveCollateralDepositCondition.md b/docs/api-reference/modules/subgraphs.AaveCollateralDepositCondition.md deleted file mode 100644 index 5392d5e52..000000000 --- a/docs/api-reference/modules/subgraphs.AaveCollateralDepositCondition.md +++ /dev/null @@ -1,508 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AaveCollateralDepositCondition - -# Namespace: AaveCollateralDepositCondition - -[subgraphs](subgraphs.md).AaveCollateralDepositCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.AaveCollateralDepositCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.AaveCollateralDepositCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.AaveCollateralDepositCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.AaveCollateralDepositCondition.md#initializedargs) -- [InitializedFields](subgraphs.AaveCollateralDepositCondition.md#initializedfields) -- [InitializedFilter](subgraphs.AaveCollateralDepositCondition.md#initializedfilter) -- [InitializedResult](subgraphs.AaveCollateralDepositCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.AaveCollateralDepositCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AaveCollateralDepositCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.AaveCollateralDepositCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.AaveCollateralDepositCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.AaveCollateralDepositCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.AaveCollateralDepositCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AaveCollateralDepositCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AaveCollateralDepositCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:60 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:54 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:48 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:91 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:87 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:65 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:83 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:128 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:123 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:96 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:118 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCollateralDepositCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.AaveCollateralDepositCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:63 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCollateralDepositCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.AaveCollateralDepositCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.AaveCollateralDepositCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralDepositCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:64 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCollateralDepositCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AaveCollateralDepositCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:94 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCollateralDepositCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AaveCollateralDepositCondition.md#initializedfilter), [`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AaveCollateralDepositCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralDepositCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:95 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCollateralDepositCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:131 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCollateralDepositCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralDepositCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralDepositCondition.d.ts:132 diff --git a/docs/api-reference/modules/subgraphs.AaveCollateralWithdrawCondition.md b/docs/api-reference/modules/subgraphs.AaveCollateralWithdrawCondition.md deleted file mode 100644 index 07e215010..000000000 --- a/docs/api-reference/modules/subgraphs.AaveCollateralWithdrawCondition.md +++ /dev/null @@ -1,508 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AaveCollateralWithdrawCondition - -# Namespace: AaveCollateralWithdrawCondition - -[subgraphs](subgraphs.md).AaveCollateralWithdrawCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.AaveCollateralWithdrawCondition.md#initializedargs) -- [InitializedFields](subgraphs.AaveCollateralWithdrawCondition.md#initializedfields) -- [InitializedFilter](subgraphs.AaveCollateralWithdrawCondition.md#initializedfilter) -- [InitializedResult](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.AaveCollateralWithdrawCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AaveCollateralWithdrawCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.AaveCollateralWithdrawCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.AaveCollateralWithdrawCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.AaveCollateralWithdrawCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.AaveCollateralWithdrawCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AaveCollateralWithdrawCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AaveCollateralWithdrawCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:60 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:54 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:48 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:91 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:87 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:65 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:83 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:128 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:123 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:96 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:118 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCollateralWithdrawCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:63 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCollateralWithdrawCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveCollateralWithdrawCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:64 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCollateralWithdrawCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AaveCollateralWithdrawCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:94 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCollateralWithdrawCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AaveCollateralWithdrawCondition.md#initializedfilter), [`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AaveCollateralWithdrawCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCollateralWithdrawCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:95 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCollateralWithdrawCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:131 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCollateralWithdrawCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCollateralWithdrawCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCollateralWithdrawCondition.d.ts:132 diff --git a/docs/api-reference/modules/subgraphs.AaveCreditTemplate.md b/docs/api-reference/modules/subgraphs.AaveCreditTemplate.md deleted file mode 100644 index 8d6be0d1d..000000000 --- a/docs/api-reference/modules/subgraphs.AaveCreditTemplate.md +++ /dev/null @@ -1,729 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AaveCreditTemplate - -# Namespace: AaveCreditTemplate - -[subgraphs](subgraphs.md).AaveCreditTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.AaveCreditTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.AaveCreditTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.AaveCreditTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.AaveCreditTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.AaveCreditTemplate.md#initializedargs) -- [InitializedFields](subgraphs.AaveCreditTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.AaveCreditTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.AaveCreditTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.AaveCreditTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AaveCreditTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AaveCreditTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AaveCreditTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AaveCreditTemplate.md#singlequeryoptions) -- [VaultCreatedArgs](subgraphs.AaveCreditTemplate.md#vaultcreatedargs) -- [VaultCreatedFields](subgraphs.AaveCreditTemplate.md#vaultcreatedfields) -- [VaultCreatedFilter](subgraphs.AaveCreditTemplate.md#vaultcreatedfilter) -- [VaultCreatedResult](subgraphs.AaveCreditTemplate.md#vaultcreatedresult) - -### Functions - -- [getAgreementCreatedById](subgraphs.AaveCreditTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.AaveCreditTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.AaveCreditTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.AaveCreditTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AaveCreditTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AaveCreditTemplate.md#getownershiptransferreds) -- [getVaultCreatedById](subgraphs.AaveCreditTemplate.md#getvaultcreatedbyid) -- [getVaultCreateds](subgraphs.AaveCreditTemplate.md#getvaultcreateds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:2 - ---- - -### VaultCreatedArgs - -Ƭ **VaultCreatedArgs**<`K`\>: { [Property in keyof Pick]: VaultCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:238 - ---- - -### VaultCreatedFields - -Ƭ **VaultCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `_borrower` | `true` | -| `_creator` | `true` | -| `_lender` | `true` | -| `_vaultAddress` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:231 - ---- - -### VaultCreatedFilter - -Ƭ **VaultCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `_borrower?` | `string` \| `null` | -| `_borrower_contains?` | `string` \| `null` | -| `_borrower_in?` | `string`[] | -| `_borrower_not?` | `string` \| `null` | -| `_borrower_not_contains?` | `string` \| `null` | -| `_borrower_not_in?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_lender?` | `string` \| `null` | -| `_lender_contains?` | `string` \| `null` | -| `_lender_in?` | `string`[] | -| `_lender_not?` | `string` \| `null` | -| `_lender_not_contains?` | `string` \| `null` | -| `_lender_not_in?` | `string`[] | -| `_vaultAddress?` | `string` \| `null` | -| `_vaultAddress_contains?` | `string` \| `null` | -| `_vaultAddress_in?` | `string`[] | -| `_vaultAddress_not?` | `string` \| `null` | -| `_vaultAddress_not_contains?` | `string` \| `null` | -| `_vaultAddress_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:190 - ---- - -### VaultCreatedResult - -Ƭ **VaultCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `_borrower` | `string` | -| `_creator` | `string` | -| `_lender` | `string` | -| `_vaultAddress` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:224 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCreditTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.AaveCreditTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCreditTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.AaveCreditTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.AaveCreditTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AaveCreditTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCreditTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AaveCreditTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCreditTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AaveCreditTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AaveCreditTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveCreditTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCreditTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveCreditTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCreditTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AaveCreditTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveCreditTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveCreditTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:189 - ---- - -### getVaultCreatedById - -▸ **getVaultCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveCreditTemplate.md#singlequeryoptions) | -| `args` | [`VaultCreatedArgs`](subgraphs.AaveCreditTemplate.md#vaultcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:241 - ---- - -### getVaultCreateds - -▸ **getVaultCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveCreditTemplate.md#multiqueryoptions)<[`VaultCreatedFilter`](subgraphs.AaveCreditTemplate.md#vaultcreatedfilter), [`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult)\> | -| `args` | [`VaultCreatedArgs`](subgraphs.AaveCreditTemplate.md#vaultcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`VaultCreatedResult`](subgraphs.AaveCreditTemplate.md#vaultcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveCreditTemplate.d.ts:242 diff --git a/docs/api-reference/modules/subgraphs.AaveRepayCondition.md b/docs/api-reference/modules/subgraphs.AaveRepayCondition.md deleted file mode 100644 index 486c76ed9..000000000 --- a/docs/api-reference/modules/subgraphs.AaveRepayCondition.md +++ /dev/null @@ -1,508 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AaveRepayCondition - -# Namespace: AaveRepayCondition - -[subgraphs](subgraphs.md).AaveRepayCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.AaveRepayCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.AaveRepayCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.AaveRepayCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.AaveRepayCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.AaveRepayCondition.md#initializedargs) -- [InitializedFields](subgraphs.AaveRepayCondition.md#initializedfields) -- [InitializedFilter](subgraphs.AaveRepayCondition.md#initializedfilter) -- [InitializedResult](subgraphs.AaveRepayCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.AaveRepayCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AaveRepayCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AaveRepayCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AaveRepayCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AaveRepayCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AaveRepayCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.AaveRepayCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.AaveRepayCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.AaveRepayCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.AaveRepayCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AaveRepayCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AaveRepayCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:60 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:54 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:48 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:91 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:87 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:65 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:83 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:128 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:123 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:96 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:118 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveRepayCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.AaveRepayCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:63 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveRepayCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.AaveRepayCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.AaveRepayCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AaveRepayCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:64 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveRepayCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AaveRepayCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:94 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveRepayCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AaveRepayCondition.md#initializedfilter), [`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AaveRepayCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AaveRepayCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:95 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AaveRepayCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveRepayCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:131 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AaveRepayCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AaveRepayCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AaveRepayCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AaveRepayCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AaveRepayCondition.d.ts:132 diff --git a/docs/api-reference/modules/subgraphs.AccessCondition.md b/docs/api-reference/modules/subgraphs.AccessCondition.md deleted file mode 100644 index 7e63779eb..000000000 --- a/docs/api-reference/modules/subgraphs.AccessCondition.md +++ /dev/null @@ -1,516 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AccessCondition - -# Namespace: AccessCondition - -[subgraphs](subgraphs.md).AccessCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.AccessCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.AccessCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.AccessCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.AccessCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.AccessCondition.md#initializedargs) -- [InitializedFields](subgraphs.AccessCondition.md#initializedfields) -- [InitializedFilter](subgraphs.AccessCondition.md#initializedfilter) -- [InitializedResult](subgraphs.AccessCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.AccessCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AccessCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AccessCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AccessCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AccessCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AccessCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.AccessCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.AccessCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.AccessCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.AccessCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AccessCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AccessCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:68 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_documentId` | `true` | -| `_grantee` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:61 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_documentId?` | `string` \| `null` | -| `_documentId_contains?` | `string` \| `null` | -| `_documentId_in?` | `string`[] | -| `_documentId_not?` | `string` \| `null` | -| `_documentId_not_contains?` | `string` \| `null` | -| `_documentId_not_in?` | `string`[] | -| `_grantee?` | `string` \| `null` | -| `_grantee_contains?` | `string` \| `null` | -| `_grantee_in?` | `string`[] | -| `_grantee_not?` | `string` \| `null` | -| `_grantee_not_contains?` | `string` \| `null` | -| `_grantee_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_documentId` | `string` | -| `_grantee` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:54 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:99 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:95 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:73 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:91 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:136 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:131 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:104 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:126 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.AccessCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:71 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.AccessCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.AccessCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:72 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AccessCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:102 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AccessCondition.md#initializedfilter), [`InitializedResult`](subgraphs.AccessCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AccessCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:103 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:139 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AccessCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessCondition.d.ts:140 diff --git a/docs/api-reference/modules/subgraphs.AccessProofCondition.md b/docs/api-reference/modules/subgraphs.AccessProofCondition.md deleted file mode 100644 index 2a180d7b7..000000000 --- a/docs/api-reference/modules/subgraphs.AccessProofCondition.md +++ /dev/null @@ -1,542 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AccessProofCondition - -# Namespace: AccessProofCondition - -[subgraphs](subgraphs.md).AccessProofCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.AccessProofCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.AccessProofCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.AccessProofCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.AccessProofCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.AccessProofCondition.md#initializedargs) -- [InitializedFields](subgraphs.AccessProofCondition.md#initializedfields) -- [InitializedFilter](subgraphs.AccessProofCondition.md#initializedfilter) -- [InitializedResult](subgraphs.AccessProofCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.AccessProofCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AccessProofCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AccessProofCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AccessProofCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AccessProofCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AccessProofCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.AccessProofCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.AccessProofCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.AccessProofCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.AccessProofCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AccessProofCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AccessProofCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:95 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_buyer` | `true` | -| `_cipher` | `true` | -| `_conditionId` | `true` | -| `_origHash` | `true` | -| `_proof` | `true` | -| `_provider` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:85 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------- | :-------------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_buyer?` | `WeiSource`[] | -| `_buyer_contains?` | `WeiSource`[] | -| `_buyer_contains_nocase?` | `WeiSource`[] | -| `_buyer_not?` | `WeiSource`[] | -| `_buyer_not_contains?` | `WeiSource`[] | -| `_buyer_not_contains_nocase?` | `WeiSource`[] | -| `_cipher?` | `WeiSource`[] | -| `_cipher_contains?` | `WeiSource`[] | -| `_cipher_contains_nocase?` | `WeiSource`[] | -| `_cipher_not?` | `WeiSource`[] | -| `_cipher_not_contains?` | `WeiSource`[] | -| `_cipher_not_contains_nocase?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_origHash?` | `WeiSource` \| `null` | -| `_origHash_gt?` | `WeiSource` \| `null` | -| `_origHash_gte?` | `WeiSource` \| `null` | -| `_origHash_in?` | `WeiSource`[] | -| `_origHash_lt?` | `WeiSource` \| `null` | -| `_origHash_lte?` | `WeiSource` \| `null` | -| `_origHash_not?` | `WeiSource` \| `null` | -| `_origHash_not_in?` | `WeiSource`[] | -| `_proof?` | `string` \| `null` | -| `_proof_contains?` | `string` \| `null` | -| `_proof_in?` | `string`[] | -| `_proof_not?` | `string` \| `null` | -| `_proof_not_contains?` | `string` \| `null` | -| `_proof_not_in?` | `string`[] | -| `_provider?` | `WeiSource`[] | -| `_provider_contains?` | `WeiSource`[] | -| `_provider_contains_nocase?` | `WeiSource`[] | -| `_provider_not?` | `WeiSource`[] | -| `_provider_not_contains?` | `WeiSource`[] | -| `_provider_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------------------ | -| `_agreementId` | `string` | -| `_buyer` | (`Wei` \| `null`)[] | -| `_cipher` | (`Wei` \| `null`)[] | -| `_conditionId` | `string` | -| `_origHash` | `Wei` | -| `_proof` | `string` | -| `_provider` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:75 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:126 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:122 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:100 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:118 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:163 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:158 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:131 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:153 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessProofCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.AccessProofCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:98 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessProofCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.AccessProofCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.AccessProofCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.AccessProofCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:99 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessProofCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AccessProofCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:129 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessProofCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AccessProofCondition.md#initializedfilter), [`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AccessProofCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:130 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessProofCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessProofCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:166 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessProofCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AccessProofCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessProofCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofCondition.d.ts:167 diff --git a/docs/api-reference/modules/subgraphs.AccessProofTemplate.md b/docs/api-reference/modules/subgraphs.AccessProofTemplate.md deleted file mode 100644 index 3efc89981..000000000 --- a/docs/api-reference/modules/subgraphs.AccessProofTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AccessProofTemplate - -# Namespace: AccessProofTemplate - -[subgraphs](subgraphs.md).AccessProofTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.AccessProofTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.AccessProofTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.AccessProofTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.AccessProofTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.AccessProofTemplate.md#initializedargs) -- [InitializedFields](subgraphs.AccessProofTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.AccessProofTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.AccessProofTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.AccessProofTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AccessProofTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AccessProofTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AccessProofTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AccessProofTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AccessProofTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.AccessProofTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.AccessProofTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.AccessProofTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.AccessProofTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AccessProofTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AccessProofTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessProofTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.AccessProofTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessProofTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.AccessProofTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.AccessProofTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessProofTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessProofTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AccessProofTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessProofTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AccessProofTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AccessProofTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessProofTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessProofTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessProofTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessProofTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AccessProofTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessProofTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessProofTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessProofTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.AccessTemplate.md b/docs/api-reference/modules/subgraphs.AccessTemplate.md deleted file mode 100644 index 6a99eca81..000000000 --- a/docs/api-reference/modules/subgraphs.AccessTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AccessTemplate - -# Namespace: AccessTemplate - -[subgraphs](subgraphs.md).AccessTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.AccessTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.AccessTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.AccessTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.AccessTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.AccessTemplate.md#initializedargs) -- [InitializedFields](subgraphs.AccessTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.AccessTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.AccessTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.AccessTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AccessTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AccessTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AccessTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AccessTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.AccessTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.AccessTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.AccessTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.AccessTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.AccessTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AccessTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AccessTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.AccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.AccessTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.AccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.AccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AccessTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AccessTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AccessTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AccessTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AccessTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AccessTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.AgreementStoreManager.md b/docs/api-reference/modules/subgraphs.AgreementStoreManager.md deleted file mode 100644 index dc7c3d0b3..000000000 --- a/docs/api-reference/modules/subgraphs.AgreementStoreManager.md +++ /dev/null @@ -1,822 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / AgreementStoreManager - -# Namespace: AgreementStoreManager - -[subgraphs](subgraphs.md).AgreementStoreManager - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.AgreementStoreManager.md#initializedargs) -- [InitializedFields](subgraphs.AgreementStoreManager.md#initializedfields) -- [InitializedFilter](subgraphs.AgreementStoreManager.md#initializedfilter) -- [InitializedResult](subgraphs.AgreementStoreManager.md#initializedresult) -- [MultiQueryOptions](subgraphs.AgreementStoreManager.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.AgreementStoreManager.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.AgreementStoreManager.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.AgreementStoreManager.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.AgreementStoreManager.md#ownershiptransferredresult) -- [RoleAdminChangedArgs](subgraphs.AgreementStoreManager.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.AgreementStoreManager.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.AgreementStoreManager.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.AgreementStoreManager.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.AgreementStoreManager.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.AgreementStoreManager.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.AgreementStoreManager.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.AgreementStoreManager.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.AgreementStoreManager.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.AgreementStoreManager.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.AgreementStoreManager.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.AgreementStoreManager.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.AgreementStoreManager.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.AgreementStoreManager.md#getinitializedbyid) -- [getInitializeds](subgraphs.AgreementStoreManager.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.AgreementStoreManager.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.AgreementStoreManager.md#getownershiptransferreds) -- [getRoleAdminChangedById](subgraphs.AgreementStoreManager.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.AgreementStoreManager.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.AgreementStoreManager.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.AgreementStoreManager.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.AgreementStoreManager.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.AgreementStoreManager.md#getrolerevokeds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:83 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:78 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:51 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:73 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:128 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:122 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:88 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:116 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:173 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:167 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:133 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:161 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:218 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:212 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:178 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:206 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AgreementStoreManager.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.AgreementStoreManager.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AgreementStoreManager.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.AgreementStoreManager.md#initializedfilter), [`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.AgreementStoreManager.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.AgreementStoreManager.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:50 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AgreementStoreManager.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AgreementStoreManager.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:86 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AgreementStoreManager.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.AgreementStoreManager.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.AgreementStoreManager.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.AgreementStoreManager.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:87 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AgreementStoreManager.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.AgreementStoreManager.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:131 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AgreementStoreManager.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.AgreementStoreManager.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.AgreementStoreManager.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.AgreementStoreManager.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:132 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AgreementStoreManager.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.AgreementStoreManager.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:176 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AgreementStoreManager.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.AgreementStoreManager.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.AgreementStoreManager.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.AgreementStoreManager.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:177 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.AgreementStoreManager.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.AgreementStoreManager.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:221 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.AgreementStoreManager.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.AgreementStoreManager.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.AgreementStoreManager.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.AgreementStoreManager.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/AgreementStoreManager.d.ts:222 diff --git a/docs/api-reference/modules/subgraphs.ComputeExecutionCondition.md b/docs/api-reference/modules/subgraphs.ComputeExecutionCondition.md deleted file mode 100644 index e89a0b1d9..000000000 --- a/docs/api-reference/modules/subgraphs.ComputeExecutionCondition.md +++ /dev/null @@ -1,516 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / ComputeExecutionCondition - -# Namespace: ComputeExecutionCondition - -[subgraphs](subgraphs.md).ComputeExecutionCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.ComputeExecutionCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.ComputeExecutionCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.ComputeExecutionCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.ComputeExecutionCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.ComputeExecutionCondition.md#initializedargs) -- [InitializedFields](subgraphs.ComputeExecutionCondition.md#initializedfields) -- [InitializedFilter](subgraphs.ComputeExecutionCondition.md#initializedfilter) -- [InitializedResult](subgraphs.ComputeExecutionCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.ComputeExecutionCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.ComputeExecutionCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.ComputeExecutionCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.ComputeExecutionCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.ComputeExecutionCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.ComputeExecutionCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.ComputeExecutionCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.ComputeExecutionCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.ComputeExecutionCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.ComputeExecutionCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.ComputeExecutionCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:68 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------- | :----- | -| `_agreementId` | `true` | -| `_computeConsumer` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:61 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_computeConsumer?` | `string` \| `null` | -| `_computeConsumer_contains?` | `string` \| `null` | -| `_computeConsumer_in?` | `string`[] | -| `_computeConsumer_not?` | `string` \| `null` | -| `_computeConsumer_not_contains?` | `string` \| `null` | -| `_computeConsumer_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------- | :------- | -| `_agreementId` | `string` | -| `_computeConsumer` | `string` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:54 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:99 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:95 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:73 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:91 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:136 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:131 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:104 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:126 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ComputeExecutionCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.ComputeExecutionCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:71 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ComputeExecutionCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.ComputeExecutionCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.ComputeExecutionCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.ComputeExecutionCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:72 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ComputeExecutionCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.ComputeExecutionCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:102 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ComputeExecutionCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.ComputeExecutionCondition.md#initializedfilter), [`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.ComputeExecutionCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.ComputeExecutionCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:103 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ComputeExecutionCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:139 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ComputeExecutionCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ComputeExecutionCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ComputeExecutionCondition.d.ts:140 diff --git a/docs/api-reference/modules/subgraphs.ConditionStoreManager.md b/docs/api-reference/modules/subgraphs.ConditionStoreManager.md deleted file mode 100644 index aa496786a..000000000 --- a/docs/api-reference/modules/subgraphs.ConditionStoreManager.md +++ /dev/null @@ -1,1130 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / ConditionStoreManager - -# Namespace: ConditionStoreManager - -[subgraphs](subgraphs.md).ConditionStoreManager - -## Table of contents - -### Type Aliases - -- [ConditionCreatedArgs](subgraphs.ConditionStoreManager.md#conditioncreatedargs) -- [ConditionCreatedFields](subgraphs.ConditionStoreManager.md#conditioncreatedfields) -- [ConditionCreatedFilter](subgraphs.ConditionStoreManager.md#conditioncreatedfilter) -- [ConditionCreatedResult](subgraphs.ConditionStoreManager.md#conditioncreatedresult) -- [ConditionUpdatedArgs](subgraphs.ConditionStoreManager.md#conditionupdatedargs) -- [ConditionUpdatedFields](subgraphs.ConditionStoreManager.md#conditionupdatedfields) -- [ConditionUpdatedFilter](subgraphs.ConditionStoreManager.md#conditionupdatedfilter) -- [ConditionUpdatedResult](subgraphs.ConditionStoreManager.md#conditionupdatedresult) -- [InitializedArgs](subgraphs.ConditionStoreManager.md#initializedargs) -- [InitializedFields](subgraphs.ConditionStoreManager.md#initializedfields) -- [InitializedFilter](subgraphs.ConditionStoreManager.md#initializedfilter) -- [InitializedResult](subgraphs.ConditionStoreManager.md#initializedresult) -- [MultiQueryOptions](subgraphs.ConditionStoreManager.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.ConditionStoreManager.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.ConditionStoreManager.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.ConditionStoreManager.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.ConditionStoreManager.md#ownershiptransferredresult) -- [RoleAdminChangedArgs](subgraphs.ConditionStoreManager.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.ConditionStoreManager.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.ConditionStoreManager.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.ConditionStoreManager.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.ConditionStoreManager.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.ConditionStoreManager.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.ConditionStoreManager.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.ConditionStoreManager.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.ConditionStoreManager.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.ConditionStoreManager.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.ConditionStoreManager.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.ConditionStoreManager.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.ConditionStoreManager.md#singlequeryoptions) - -### Functions - -- [getConditionCreatedById](subgraphs.ConditionStoreManager.md#getconditioncreatedbyid) -- [getConditionCreateds](subgraphs.ConditionStoreManager.md#getconditioncreateds) -- [getConditionUpdatedById](subgraphs.ConditionStoreManager.md#getconditionupdatedbyid) -- [getConditionUpdateds](subgraphs.ConditionStoreManager.md#getconditionupdateds) -- [getInitializedById](subgraphs.ConditionStoreManager.md#getinitializedbyid) -- [getInitializeds](subgraphs.ConditionStoreManager.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.ConditionStoreManager.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.ConditionStoreManager.md#getownershiptransferreds) -- [getRoleAdminChangedById](subgraphs.ConditionStoreManager.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.ConditionStoreManager.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.ConditionStoreManager.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.ConditionStoreManager.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.ConditionStoreManager.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.ConditionStoreManager.md#getrolerevokeds) - -## Type Aliases - -### ConditionCreatedArgs - -Ƭ **ConditionCreatedArgs**<`K`\>: { [Property in keyof Pick]: ConditionCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:52 - ---- - -### ConditionCreatedFields - -Ƭ **ConditionCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :----- | -| `_typeRef` | `true` | -| `_who` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:47 - ---- - -### ConditionCreatedFilter - -Ƭ **ConditionCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------- | :----------------- | -| `_typeRef?` | `string` \| `null` | -| `_typeRef_contains?` | `string` \| `null` | -| `_typeRef_in?` | `string`[] | -| `_typeRef_not?` | `string` \| `null` | -| `_typeRef_not_contains?` | `string` \| `null` | -| `_typeRef_not_in?` | `string`[] | -| `_who?` | `string` \| `null` | -| `_who_contains?` | `string` \| `null` | -| `_who_in?` | `string`[] | -| `_who_not?` | `string` \| `null` | -| `_who_not_contains?` | `string` \| `null` | -| `_who_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:20 - ---- - -### ConditionCreatedResult - -Ƭ **ConditionCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :------- | -| `_typeRef` | `string` | -| `_who` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:42 - ---- - -### ConditionUpdatedArgs - -Ƭ **ConditionUpdatedArgs**<`K`\>: { [Property in keyof Pick]: ConditionUpdatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:99 - ---- - -### ConditionUpdatedFields - -Ƭ **ConditionUpdatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :----- | -| `_state` | `true` | -| `_typeRef` | `true` | -| `_who` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:93 - ---- - -### ConditionUpdatedFilter - -Ƭ **ConditionUpdatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------- | :----------------- | -| `_state?` | `number` \| `null` | -| `_state_gt?` | `number` \| `null` | -| `_state_gte?` | `number` \| `null` | -| `_state_in?` | `number`[] | -| `_state_lt?` | `number` \| `null` | -| `_state_lte?` | `number` \| `null` | -| `_state_not?` | `number` \| `null` | -| `_state_not_in?` | `number`[] | -| `_typeRef?` | `string` \| `null` | -| `_typeRef_contains?` | `string` \| `null` | -| `_typeRef_in?` | `string`[] | -| `_typeRef_not?` | `string` \| `null` | -| `_typeRef_not_contains?` | `string` \| `null` | -| `_typeRef_not_in?` | `string`[] | -| `_who?` | `string` \| `null` | -| `_who_contains?` | `string` \| `null` | -| `_who_in?` | `string`[] | -| `_who_not?` | `string` \| `null` | -| `_who_not_contains?` | `string` \| `null` | -| `_who_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:57 - ---- - -### ConditionUpdatedResult - -Ƭ **ConditionUpdatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :------- | -| `_state` | `number` | -| `_typeRef` | `string` | -| `_who` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:87 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:130 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:126 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:104 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:122 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:167 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:162 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:135 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:157 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:212 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:206 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:172 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:200 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:257 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:251 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:217 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:245 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:302 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:296 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:262 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:290 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:1 - -## Functions - -### getConditionCreatedById - -▸ **getConditionCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ConditionStoreManager.md#singlequeryoptions) | -| `args` | [`ConditionCreatedArgs`](subgraphs.ConditionStoreManager.md#conditioncreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:55 - ---- - -### getConditionCreateds - -▸ **getConditionCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ConditionStoreManager.md#multiqueryoptions)<[`ConditionCreatedFilter`](subgraphs.ConditionStoreManager.md#conditioncreatedfilter), [`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult)\> | -| `args` | [`ConditionCreatedArgs`](subgraphs.ConditionStoreManager.md#conditioncreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ConditionCreatedResult`](subgraphs.ConditionStoreManager.md#conditioncreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:56 - ---- - -### getConditionUpdatedById - -▸ **getConditionUpdatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ConditionStoreManager.md#singlequeryoptions) | -| `args` | [`ConditionUpdatedArgs`](subgraphs.ConditionStoreManager.md#conditionupdatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:102 - ---- - -### getConditionUpdateds - -▸ **getConditionUpdateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ConditionStoreManager.md#multiqueryoptions)<[`ConditionUpdatedFilter`](subgraphs.ConditionStoreManager.md#conditionupdatedfilter), [`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult)\> | -| `args` | [`ConditionUpdatedArgs`](subgraphs.ConditionStoreManager.md#conditionupdatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ConditionUpdatedResult`](subgraphs.ConditionStoreManager.md#conditionupdatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:103 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ConditionStoreManager.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.ConditionStoreManager.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:133 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ConditionStoreManager.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.ConditionStoreManager.md#initializedfilter), [`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.ConditionStoreManager.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.ConditionStoreManager.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:134 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ConditionStoreManager.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.ConditionStoreManager.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:170 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ConditionStoreManager.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.ConditionStoreManager.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.ConditionStoreManager.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ConditionStoreManager.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:171 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ConditionStoreManager.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.ConditionStoreManager.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:215 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ConditionStoreManager.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.ConditionStoreManager.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.ConditionStoreManager.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.ConditionStoreManager.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:216 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ConditionStoreManager.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.ConditionStoreManager.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:260 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ConditionStoreManager.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.ConditionStoreManager.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.ConditionStoreManager.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.ConditionStoreManager.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:261 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ConditionStoreManager.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.ConditionStoreManager.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:305 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ConditionStoreManager.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.ConditionStoreManager.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.ConditionStoreManager.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.ConditionStoreManager.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ConditionStoreManager.d.ts:306 diff --git a/docs/api-reference/modules/subgraphs.DIDRegistry.md b/docs/api-reference/modules/subgraphs.DIDRegistry.md deleted file mode 100644 index bd61feda9..000000000 --- a/docs/api-reference/modules/subgraphs.DIDRegistry.md +++ /dev/null @@ -1,3149 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / DIDRegistry - -# Namespace: DIDRegistry - -[subgraphs](subgraphs.md).DIDRegistry - -## Table of contents - -### Type Aliases - -- [ActedOnBehalfArgs](subgraphs.DIDRegistry.md#actedonbehalfargs) -- [ActedOnBehalfFields](subgraphs.DIDRegistry.md#actedonbehalffields) -- [ActedOnBehalfFilter](subgraphs.DIDRegistry.md#actedonbehalffilter) -- [ActedOnBehalfResult](subgraphs.DIDRegistry.md#actedonbehalfresult) -- [DIDAttributeRegisteredArgs](subgraphs.DIDRegistry.md#didattributeregisteredargs) -- [DIDAttributeRegisteredFields](subgraphs.DIDRegistry.md#didattributeregisteredfields) -- [DIDAttributeRegisteredFilter](subgraphs.DIDRegistry.md#didattributeregisteredfilter) -- [DIDAttributeRegisteredResult](subgraphs.DIDRegistry.md#didattributeregisteredresult) -- [DIDOwnershipTransferredArgs](subgraphs.DIDRegistry.md#didownershiptransferredargs) -- [DIDOwnershipTransferredFields](subgraphs.DIDRegistry.md#didownershiptransferredfields) -- [DIDOwnershipTransferredFilter](subgraphs.DIDRegistry.md#didownershiptransferredfilter) -- [DIDOwnershipTransferredResult](subgraphs.DIDRegistry.md#didownershiptransferredresult) -- [DIDPermissionGrantedArgs](subgraphs.DIDRegistry.md#didpermissiongrantedargs) -- [DIDPermissionGrantedFields](subgraphs.DIDRegistry.md#didpermissiongrantedfields) -- [DIDPermissionGrantedFilter](subgraphs.DIDRegistry.md#didpermissiongrantedfilter) -- [DIDPermissionGrantedResult](subgraphs.DIDRegistry.md#didpermissiongrantedresult) -- [DIDPermissionRevokedArgs](subgraphs.DIDRegistry.md#didpermissionrevokedargs) -- [DIDPermissionRevokedFields](subgraphs.DIDRegistry.md#didpermissionrevokedfields) -- [DIDPermissionRevokedFilter](subgraphs.DIDRegistry.md#didpermissionrevokedfilter) -- [DIDPermissionRevokedResult](subgraphs.DIDRegistry.md#didpermissionrevokedresult) -- [DIDProvenanceDelegateAddedArgs](subgraphs.DIDRegistry.md#didprovenancedelegateaddedargs) -- [DIDProvenanceDelegateAddedFields](subgraphs.DIDRegistry.md#didprovenancedelegateaddedfields) -- [DIDProvenanceDelegateAddedFilter](subgraphs.DIDRegistry.md#didprovenancedelegateaddedfilter) -- [DIDProvenanceDelegateAddedResult](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult) -- [DIDProvenanceDelegateRemovedArgs](subgraphs.DIDRegistry.md#didprovenancedelegateremovedargs) -- [DIDProvenanceDelegateRemovedFields](subgraphs.DIDRegistry.md#didprovenancedelegateremovedfields) -- [DIDProvenanceDelegateRemovedFilter](subgraphs.DIDRegistry.md#didprovenancedelegateremovedfilter) -- [DIDProvenanceDelegateRemovedResult](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult) -- [DIDProviderAddedArgs](subgraphs.DIDRegistry.md#didprovideraddedargs) -- [DIDProviderAddedFields](subgraphs.DIDRegistry.md#didprovideraddedfields) -- [DIDProviderAddedFilter](subgraphs.DIDRegistry.md#didprovideraddedfilter) -- [DIDProviderAddedResult](subgraphs.DIDRegistry.md#didprovideraddedresult) -- [DIDProviderRemovedArgs](subgraphs.DIDRegistry.md#didproviderremovedargs) -- [DIDProviderRemovedFields](subgraphs.DIDRegistry.md#didproviderremovedfields) -- [DIDProviderRemovedFilter](subgraphs.DIDRegistry.md#didproviderremovedfilter) -- [DIDProviderRemovedResult](subgraphs.DIDRegistry.md#didproviderremovedresult) -- [DIDRoyaltiesAddedArgs](subgraphs.DIDRegistry.md#didroyaltiesaddedargs) -- [DIDRoyaltiesAddedFields](subgraphs.DIDRegistry.md#didroyaltiesaddedfields) -- [DIDRoyaltiesAddedFilter](subgraphs.DIDRegistry.md#didroyaltiesaddedfilter) -- [DIDRoyaltiesAddedResult](subgraphs.DIDRegistry.md#didroyaltiesaddedresult) -- [DIDRoyaltyRecipientChangedArgs](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedargs) -- [DIDRoyaltyRecipientChangedFields](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedfields) -- [DIDRoyaltyRecipientChangedFilter](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedfilter) -- [DIDRoyaltyRecipientChangedResult](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult) -- [InitializedArgs](subgraphs.DIDRegistry.md#initializedargs) -- [InitializedFields](subgraphs.DIDRegistry.md#initializedfields) -- [InitializedFilter](subgraphs.DIDRegistry.md#initializedfilter) -- [InitializedResult](subgraphs.DIDRegistry.md#initializedresult) -- [MultiQueryOptions](subgraphs.DIDRegistry.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.DIDRegistry.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.DIDRegistry.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.DIDRegistry.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.DIDRegistry.md#ownershiptransferredresult) -- [ProvenanceAttributeRegisteredArgs](subgraphs.DIDRegistry.md#provenanceattributeregisteredargs) -- [ProvenanceAttributeRegisteredFields](subgraphs.DIDRegistry.md#provenanceattributeregisteredfields) -- [ProvenanceAttributeRegisteredFilter](subgraphs.DIDRegistry.md#provenanceattributeregisteredfilter) -- [ProvenanceAttributeRegisteredResult](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult) -- [SingleQueryOptions](subgraphs.DIDRegistry.md#singlequeryoptions) -- [UsedArgs](subgraphs.DIDRegistry.md#usedargs) -- [UsedFields](subgraphs.DIDRegistry.md#usedfields) -- [UsedFilter](subgraphs.DIDRegistry.md#usedfilter) -- [UsedResult](subgraphs.DIDRegistry.md#usedresult) -- [WasAssociatedWithArgs](subgraphs.DIDRegistry.md#wasassociatedwithargs) -- [WasAssociatedWithFields](subgraphs.DIDRegistry.md#wasassociatedwithfields) -- [WasAssociatedWithFilter](subgraphs.DIDRegistry.md#wasassociatedwithfilter) -- [WasAssociatedWithResult](subgraphs.DIDRegistry.md#wasassociatedwithresult) -- [WasDerivedFromArgs](subgraphs.DIDRegistry.md#wasderivedfromargs) -- [WasDerivedFromFields](subgraphs.DIDRegistry.md#wasderivedfromfields) -- [WasDerivedFromFilter](subgraphs.DIDRegistry.md#wasderivedfromfilter) -- [WasDerivedFromResult](subgraphs.DIDRegistry.md#wasderivedfromresult) -- [WasGeneratedByArgs](subgraphs.DIDRegistry.md#wasgeneratedbyargs) -- [WasGeneratedByFields](subgraphs.DIDRegistry.md#wasgeneratedbyfields) -- [WasGeneratedByFilter](subgraphs.DIDRegistry.md#wasgeneratedbyfilter) -- [WasGeneratedByResult](subgraphs.DIDRegistry.md#wasgeneratedbyresult) - -### Functions - -- [getActedOnBehalfById](subgraphs.DIDRegistry.md#getactedonbehalfbyid) -- [getActedOnBehalfs](subgraphs.DIDRegistry.md#getactedonbehalfs) -- [getDIDAttributeRegisteredById](subgraphs.DIDRegistry.md#getdidattributeregisteredbyid) -- [getDIDAttributeRegistereds](subgraphs.DIDRegistry.md#getdidattributeregistereds) -- [getDIDOwnershipTransferredById](subgraphs.DIDRegistry.md#getdidownershiptransferredbyid) -- [getDIDOwnershipTransferreds](subgraphs.DIDRegistry.md#getdidownershiptransferreds) -- [getDIDPermissionGrantedById](subgraphs.DIDRegistry.md#getdidpermissiongrantedbyid) -- [getDIDPermissionGranteds](subgraphs.DIDRegistry.md#getdidpermissiongranteds) -- [getDIDPermissionRevokedById](subgraphs.DIDRegistry.md#getdidpermissionrevokedbyid) -- [getDIDPermissionRevokeds](subgraphs.DIDRegistry.md#getdidpermissionrevokeds) -- [getDIDProvenanceDelegateAddedById](subgraphs.DIDRegistry.md#getdidprovenancedelegateaddedbyid) -- [getDIDProvenanceDelegateAddeds](subgraphs.DIDRegistry.md#getdidprovenancedelegateaddeds) -- [getDIDProvenanceDelegateRemovedById](subgraphs.DIDRegistry.md#getdidprovenancedelegateremovedbyid) -- [getDIDProvenanceDelegateRemoveds](subgraphs.DIDRegistry.md#getdidprovenancedelegateremoveds) -- [getDIDProviderAddedById](subgraphs.DIDRegistry.md#getdidprovideraddedbyid) -- [getDIDProviderAddeds](subgraphs.DIDRegistry.md#getdidprovideraddeds) -- [getDIDProviderRemovedById](subgraphs.DIDRegistry.md#getdidproviderremovedbyid) -- [getDIDProviderRemoveds](subgraphs.DIDRegistry.md#getdidproviderremoveds) -- [getDIDRoyaltiesAddedById](subgraphs.DIDRegistry.md#getdidroyaltiesaddedbyid) -- [getDIDRoyaltiesAddeds](subgraphs.DIDRegistry.md#getdidroyaltiesaddeds) -- [getDIDRoyaltyRecipientChangedById](subgraphs.DIDRegistry.md#getdidroyaltyrecipientchangedbyid) -- [getDIDRoyaltyRecipientChangeds](subgraphs.DIDRegistry.md#getdidroyaltyrecipientchangeds) -- [getInitializedById](subgraphs.DIDRegistry.md#getinitializedbyid) -- [getInitializeds](subgraphs.DIDRegistry.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.DIDRegistry.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.DIDRegistry.md#getownershiptransferreds) -- [getProvenanceAttributeRegisteredById](subgraphs.DIDRegistry.md#getprovenanceattributeregisteredbyid) -- [getProvenanceAttributeRegistereds](subgraphs.DIDRegistry.md#getprovenanceattributeregistereds) -- [getUsedById](subgraphs.DIDRegistry.md#getusedbyid) -- [getUseds](subgraphs.DIDRegistry.md#getuseds) -- [getWasAssociatedWithById](subgraphs.DIDRegistry.md#getwasassociatedwithbyid) -- [getWasAssociatedWiths](subgraphs.DIDRegistry.md#getwasassociatedwiths) -- [getWasDerivedFromById](subgraphs.DIDRegistry.md#getwasderivedfrombyid) -- [getWasDerivedFroms](subgraphs.DIDRegistry.md#getwasderivedfroms) -- [getWasGeneratedByById](subgraphs.DIDRegistry.md#getwasgeneratedbybyid) -- [getWasGeneratedBys](subgraphs.DIDRegistry.md#getwasgeneratedbys) - -## Type Aliases - -### ActedOnBehalfArgs - -Ƭ **ActedOnBehalfArgs**<`K`\>: { [Property in keyof Pick]: ActedOnBehalfFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:109 - ---- - -### ActedOnBehalfFields - -Ƭ **ActedOnBehalfFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_activityId` | `true` | -| `_attributes` | `true` | -| `_blockNumberUpdated` | `true` | -| `_delegateAgentId` | `true` | -| `_entityDid` | `true` | -| `_responsibleAgentId` | `true` | -| `id` | `true` | -| `provId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:99 - ---- - -### ActedOnBehalfFilter - -Ƭ **ActedOnBehalfFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :-------------------- | -| `_activityId?` | `string` \| `null` | -| `_activityId_contains?` | `string` \| `null` | -| `_activityId_in?` | `string`[] | -| `_activityId_not?` | `string` \| `null` | -| `_activityId_not_contains?` | `string` \| `null` | -| `_activityId_not_in?` | `string`[] | -| `_attributes?` | `string` \| `null` | -| `_attributes_contains?` | `string` \| `null` | -| `_attributes_contains_nocase?` | `string` \| `null` | -| `_attributes_ends_with?` | `string` \| `null` | -| `_attributes_ends_with_nocase?` | `string` \| `null` | -| `_attributes_gt?` | `string` \| `null` | -| `_attributes_gte?` | `string` \| `null` | -| `_attributes_in?` | `string`[] | -| `_attributes_lt?` | `string` \| `null` | -| `_attributes_lte?` | `string` \| `null` | -| `_attributes_not?` | `string` \| `null` | -| `_attributes_not_contains?` | `string` \| `null` | -| `_attributes_not_contains_nocase?` | `string` \| `null` | -| `_attributes_not_ends_with?` | `string` \| `null` | -| `_attributes_not_ends_with_nocase?` | `string` \| `null` | -| `_attributes_not_in?` | `string`[] | -| `_attributes_not_starts_with?` | `string` \| `null` | -| `_attributes_not_starts_with_nocase?` | `string` \| `null` | -| `_attributes_starts_with?` | `string` \| `null` | -| `_attributes_starts_with_nocase?` | `string` \| `null` | -| `_blockNumberUpdated?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_in?` | `WeiSource`[] | -| `_blockNumberUpdated_lt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_lte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not_in?` | `WeiSource`[] | -| `_delegateAgentId?` | `string` \| `null` | -| `_delegateAgentId_contains?` | `string` \| `null` | -| `_delegateAgentId_in?` | `string`[] | -| `_delegateAgentId_not?` | `string` \| `null` | -| `_delegateAgentId_not_contains?` | `string` \| `null` | -| `_delegateAgentId_not_in?` | `string`[] | -| `_entityDid?` | `string` \| `null` | -| `_entityDid_contains?` | `string` \| `null` | -| `_entityDid_in?` | `string`[] | -| `_entityDid_not?` | `string` \| `null` | -| `_entityDid_not_contains?` | `string` \| `null` | -| `_entityDid_not_in?` | `string`[] | -| `_responsibleAgentId?` | `string` \| `null` | -| `_responsibleAgentId_contains?` | `string` \| `null` | -| `_responsibleAgentId_in?` | `string`[] | -| `_responsibleAgentId_not?` | `string` \| `null` | -| `_responsibleAgentId_not_contains?` | `string` \| `null` | -| `_responsibleAgentId_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `provId?` | `string` \| `null` | -| `provId_contains?` | `string` \| `null` | -| `provId_in?` | `string`[] | -| `provId_not?` | `string` \| `null` | -| `provId_not_contains?` | `string` \| `null` | -| `provId_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:21 - ---- - -### ActedOnBehalfResult - -Ƭ **ActedOnBehalfResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_activityId` | `string` | -| `_attributes` | `string` | -| `_blockNumberUpdated` | `Wei` | -| `_delegateAgentId` | `string` | -| `_entityDid` | `string` | -| `_responsibleAgentId` | `string` | -| `id` | `string` | -| `provId` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:89 - ---- - -### DIDAttributeRegisteredArgs - -Ƭ **DIDAttributeRegisteredArgs**<`K`\>: { [Property in keyof Pick]: DIDAttributeRegisteredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:194 - ---- - -### DIDAttributeRegisteredFields - -Ƭ **DIDAttributeRegisteredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_blockNumberUpdated` | `true` | -| `_checksum` | `true` | -| `_did` | `true` | -| `_lastUpdatedBy` | `true` | -| `_owner` | `true` | -| `_value` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:185 - ---- - -### DIDAttributeRegisteredFilter - -Ƭ **DIDAttributeRegisteredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------- | :-------------------- | -| `_blockNumberUpdated?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_in?` | `WeiSource`[] | -| `_blockNumberUpdated_lt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_lte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not_in?` | `WeiSource`[] | -| `_checksum?` | `string` \| `null` | -| `_checksum_contains?` | `string` \| `null` | -| `_checksum_in?` | `string`[] | -| `_checksum_not?` | `string` \| `null` | -| `_checksum_not_contains?` | `string` \| `null` | -| `_checksum_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_lastUpdatedBy?` | `string` \| `null` | -| `_lastUpdatedBy_contains?` | `string` \| `null` | -| `_lastUpdatedBy_in?` | `string`[] | -| `_lastUpdatedBy_not?` | `string` \| `null` | -| `_lastUpdatedBy_not_contains?` | `string` \| `null` | -| `_lastUpdatedBy_not_in?` | `string`[] | -| `_owner?` | `string` \| `null` | -| `_owner_contains?` | `string` \| `null` | -| `_owner_in?` | `string`[] | -| `_owner_not?` | `string` \| `null` | -| `_owner_not_contains?` | `string` \| `null` | -| `_owner_not_in?` | `string`[] | -| `_value?` | `string` \| `null` | -| `_value_contains?` | `string` \| `null` | -| `_value_contains_nocase?` | `string` \| `null` | -| `_value_ends_with?` | `string` \| `null` | -| `_value_ends_with_nocase?` | `string` \| `null` | -| `_value_gt?` | `string` \| `null` | -| `_value_gte?` | `string` \| `null` | -| `_value_in?` | `string`[] | -| `_value_lt?` | `string` \| `null` | -| `_value_lte?` | `string` \| `null` | -| `_value_not?` | `string` \| `null` | -| `_value_not_contains?` | `string` \| `null` | -| `_value_not_contains_nocase?` | `string` \| `null` | -| `_value_not_ends_with?` | `string` \| `null` | -| `_value_not_ends_with_nocase?` | `string` \| `null` | -| `_value_not_in?` | `string`[] | -| `_value_not_starts_with?` | `string` \| `null` | -| `_value_not_starts_with_nocase?` | `string` \| `null` | -| `_value_starts_with?` | `string` \| `null` | -| `_value_starts_with_nocase?` | `string` \| `null` | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:114 - ---- - -### DIDAttributeRegisteredResult - -Ƭ **DIDAttributeRegisteredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_blockNumberUpdated` | `Wei` | -| `_checksum` | `string` | -| `_did` | `string` | -| `_lastUpdatedBy` | `string` | -| `_owner` | `string` | -| `_value` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:176 - ---- - -### DIDOwnershipTransferredArgs - -Ƭ **DIDOwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: DIDOwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:239 - ---- - -### DIDOwnershipTransferredFields - -Ƭ **DIDOwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------- | :----- | -| `_did` | `true` | -| `_newOwner` | `true` | -| `_previousOwner` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:233 - ---- - -### DIDOwnershipTransferredFilter - -Ƭ **DIDOwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------------- | :----------------- | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_newOwner?` | `string` \| `null` | -| `_newOwner_contains?` | `string` \| `null` | -| `_newOwner_in?` | `string`[] | -| `_newOwner_not?` | `string` \| `null` | -| `_newOwner_not_contains?` | `string` \| `null` | -| `_newOwner_not_in?` | `string`[] | -| `_previousOwner?` | `string` \| `null` | -| `_previousOwner_contains?` | `string` \| `null` | -| `_previousOwner_in?` | `string`[] | -| `_previousOwner_not?` | `string` \| `null` | -| `_previousOwner_not_contains?` | `string` \| `null` | -| `_previousOwner_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:199 - ---- - -### DIDOwnershipTransferredResult - -Ƭ **DIDOwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------- | :------- | -| `_did` | `string` | -| `_newOwner` | `string` | -| `_previousOwner` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:227 - ---- - -### DIDPermissionGrantedArgs - -Ƭ **DIDPermissionGrantedArgs**<`K`\>: { [Property in keyof Pick]: DIDPermissionGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:284 - ---- - -### DIDPermissionGrantedFields - -Ƭ **DIDPermissionGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :----- | -| `_did` | `true` | -| `_grantee` | `true` | -| `_owner` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:278 - ---- - -### DIDPermissionGrantedFilter - -Ƭ **DIDPermissionGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------- | :----------------- | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_grantee?` | `string` \| `null` | -| `_grantee_contains?` | `string` \| `null` | -| `_grantee_in?` | `string`[] | -| `_grantee_not?` | `string` \| `null` | -| `_grantee_not_contains?` | `string` \| `null` | -| `_grantee_not_in?` | `string`[] | -| `_owner?` | `string` \| `null` | -| `_owner_contains?` | `string` \| `null` | -| `_owner_in?` | `string`[] | -| `_owner_not?` | `string` \| `null` | -| `_owner_not_contains?` | `string` \| `null` | -| `_owner_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:244 - ---- - -### DIDPermissionGrantedResult - -Ƭ **DIDPermissionGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :------- | -| `_did` | `string` | -| `_grantee` | `string` | -| `_owner` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:272 - ---- - -### DIDPermissionRevokedArgs - -Ƭ **DIDPermissionRevokedArgs**<`K`\>: { [Property in keyof Pick]: DIDPermissionRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:329 - ---- - -### DIDPermissionRevokedFields - -Ƭ **DIDPermissionRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :----- | -| `_did` | `true` | -| `_grantee` | `true` | -| `_owner` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:323 - ---- - -### DIDPermissionRevokedFilter - -Ƭ **DIDPermissionRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------- | :----------------- | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_grantee?` | `string` \| `null` | -| `_grantee_contains?` | `string` \| `null` | -| `_grantee_in?` | `string`[] | -| `_grantee_not?` | `string` \| `null` | -| `_grantee_not_contains?` | `string` \| `null` | -| `_grantee_not_in?` | `string`[] | -| `_owner?` | `string` \| `null` | -| `_owner_contains?` | `string` \| `null` | -| `_owner_in?` | `string`[] | -| `_owner_not?` | `string` \| `null` | -| `_owner_not_contains?` | `string` \| `null` | -| `_owner_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:289 - ---- - -### DIDPermissionRevokedResult - -Ƭ **DIDPermissionRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :------- | -| `_did` | `string` | -| `_grantee` | `string` | -| `_owner` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:317 - ---- - -### DIDProvenanceDelegateAddedArgs - -Ƭ **DIDProvenanceDelegateAddedArgs**<`K`\>: { [Property in keyof Pick]: DIDProvenanceDelegateAddedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:366 - ---- - -### DIDProvenanceDelegateAddedFields - -Ƭ **DIDProvenanceDelegateAddedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :----- | -| `_delegate` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:361 - ---- - -### DIDProvenanceDelegateAddedFilter - -Ƭ **DIDProvenanceDelegateAddedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------ | :----------------- | -| `_delegate?` | `string` \| `null` | -| `_delegate_contains?` | `string` \| `null` | -| `_delegate_in?` | `string`[] | -| `_delegate_not?` | `string` \| `null` | -| `_delegate_not_contains?` | `string` \| `null` | -| `_delegate_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:334 - ---- - -### DIDProvenanceDelegateAddedResult - -Ƭ **DIDProvenanceDelegateAddedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `_delegate` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:356 - ---- - -### DIDProvenanceDelegateRemovedArgs - -Ƭ **DIDProvenanceDelegateRemovedArgs**<`K`\>: { [Property in keyof Pick]: DIDProvenanceDelegateRemovedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:409 - ---- - -### DIDProvenanceDelegateRemovedFields - -Ƭ **DIDProvenanceDelegateRemovedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :----- | -| `_delegate` | `true` | -| `_did` | `true` | -| `id` | `true` | -| `state` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:403 - ---- - -### DIDProvenanceDelegateRemovedFilter - -Ƭ **DIDProvenanceDelegateRemovedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------ | :------------------ | -| `_delegate?` | `string` \| `null` | -| `_delegate_contains?` | `string` \| `null` | -| `_delegate_in?` | `string`[] | -| `_delegate_not?` | `string` \| `null` | -| `_delegate_not_contains?` | `string` \| `null` | -| `_delegate_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `state?` | `boolean` \| `null` | -| `state_in?` | `boolean`[] | -| `state_not?` | `boolean` \| `null` | -| `state_not_in?` | `boolean`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:371 - ---- - -### DIDProvenanceDelegateRemovedResult - -Ƭ **DIDProvenanceDelegateRemovedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :-------- | -| `_delegate` | `string` | -| `_did` | `string` | -| `id` | `string` | -| `state` | `boolean` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:397 - ---- - -### DIDProviderAddedArgs - -Ƭ **DIDProviderAddedArgs**<`K`\>: { [Property in keyof Pick]: DIDProviderAddedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:446 - ---- - -### DIDProviderAddedFields - -Ƭ **DIDProviderAddedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :----- | -| `_did` | `true` | -| `_provider` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:441 - ---- - -### DIDProviderAddedFilter - -Ƭ **DIDProviderAddedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------ | :----------------- | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_provider?` | `string` \| `null` | -| `_provider_contains?` | `string` \| `null` | -| `_provider_in?` | `string`[] | -| `_provider_not?` | `string` \| `null` | -| `_provider_not_contains?` | `string` \| `null` | -| `_provider_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:414 - ---- - -### DIDProviderAddedResult - -Ƭ **DIDProviderAddedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `_did` | `string` | -| `_provider` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:436 - ---- - -### DIDProviderRemovedArgs - -Ƭ **DIDProviderRemovedArgs**<`K`\>: { [Property in keyof Pick]: DIDProviderRemovedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:489 - ---- - -### DIDProviderRemovedFields - -Ƭ **DIDProviderRemovedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :----- | -| `_did` | `true` | -| `_provider` | `true` | -| `id` | `true` | -| `state` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:483 - ---- - -### DIDProviderRemovedFilter - -Ƭ **DIDProviderRemovedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------ | :------------------ | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_provider?` | `string` \| `null` | -| `_provider_contains?` | `string` \| `null` | -| `_provider_in?` | `string`[] | -| `_provider_not?` | `string` \| `null` | -| `_provider_not_contains?` | `string` \| `null` | -| `_provider_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `state?` | `boolean` \| `null` | -| `state_in?` | `boolean`[] | -| `state_not?` | `boolean` \| `null` | -| `state_not_in?` | `boolean`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:451 - ---- - -### DIDProviderRemovedResult - -Ƭ **DIDProviderRemovedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :-------- | -| `_did` | `string` | -| `_provider` | `string` | -| `id` | `string` | -| `state` | `boolean` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:477 - ---- - -### DIDRoyaltiesAddedArgs - -Ƭ **DIDRoyaltiesAddedArgs**<`K`\>: { [Property in keyof Pick]: DIDRoyaltiesAddedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:526 - ---- - -### DIDRoyaltiesAddedFields - -Ƭ **DIDRoyaltiesAddedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :----- | -| `addr` | `true` | -| `did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:521 - ---- - -### DIDRoyaltiesAddedFilter - -Ƭ **DIDRoyaltiesAddedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------- | :----------------- | -| `addr?` | `string` \| `null` | -| `addr_contains?` | `string` \| `null` | -| `addr_in?` | `string`[] | -| `addr_not?` | `string` \| `null` | -| `addr_not_contains?` | `string` \| `null` | -| `addr_not_in?` | `string`[] | -| `did?` | `string` \| `null` | -| `did_contains?` | `string` \| `null` | -| `did_in?` | `string`[] | -| `did_not?` | `string` \| `null` | -| `did_not_contains?` | `string` \| `null` | -| `did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:494 - ---- - -### DIDRoyaltiesAddedResult - -Ƭ **DIDRoyaltiesAddedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :------- | -| `addr` | `string` | -| `did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:516 - ---- - -### DIDRoyaltyRecipientChangedArgs - -Ƭ **DIDRoyaltyRecipientChangedArgs**<`K`\>: { [Property in keyof Pick]: DIDRoyaltyRecipientChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:563 - ---- - -### DIDRoyaltyRecipientChangedFields - -Ƭ **DIDRoyaltyRecipientChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :----- | -| `addr` | `true` | -| `did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:558 - ---- - -### DIDRoyaltyRecipientChangedFilter - -Ƭ **DIDRoyaltyRecipientChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------- | :----------------- | -| `addr?` | `string` \| `null` | -| `addr_contains?` | `string` \| `null` | -| `addr_in?` | `string`[] | -| `addr_not?` | `string` \| `null` | -| `addr_not_contains?` | `string` \| `null` | -| `addr_not_in?` | `string`[] | -| `did?` | `string` \| `null` | -| `did_contains?` | `string` \| `null` | -| `did_in?` | `string`[] | -| `did_not?` | `string` \| `null` | -| `did_not_contains?` | `string` \| `null` | -| `did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:531 - ---- - -### DIDRoyaltyRecipientChangedResult - -Ƭ **DIDRoyaltyRecipientChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :------- | -| `addr` | `string` | -| `did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:553 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:594 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:590 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:568 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:586 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:631 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:626 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:599 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:621 - ---- - -### ProvenanceAttributeRegisteredArgs - -Ƭ **ProvenanceAttributeRegisteredArgs**<`K`\>: { [Property in keyof Pick]: ProvenanceAttributeRegisteredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:742 - ---- - -### ProvenanceAttributeRegisteredFields - -Ƭ **ProvenanceAttributeRegisteredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_activityId` | `true` | -| `_agentId` | `true` | -| `_agentInvolvedId` | `true` | -| `_attributes` | `true` | -| `_blockNumberUpdated` | `true` | -| `_did` | `true` | -| `_method` | `true` | -| `_relatedDid` | `true` | -| `id` | `true` | -| `provId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:730 - ---- - -### ProvenanceAttributeRegisteredFilter - -Ƭ **ProvenanceAttributeRegisteredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :-------------------- | -| `_activityId?` | `string` \| `null` | -| `_activityId_contains?` | `string` \| `null` | -| `_activityId_in?` | `string`[] | -| `_activityId_not?` | `string` \| `null` | -| `_activityId_not_contains?` | `string` \| `null` | -| `_activityId_not_in?` | `string`[] | -| `_agentId?` | `string` \| `null` | -| `_agentId_contains?` | `string` \| `null` | -| `_agentId_in?` | `string`[] | -| `_agentId_not?` | `string` \| `null` | -| `_agentId_not_contains?` | `string` \| `null` | -| `_agentId_not_in?` | `string`[] | -| `_agentInvolvedId?` | `string` \| `null` | -| `_agentInvolvedId_contains?` | `string` \| `null` | -| `_agentInvolvedId_in?` | `string`[] | -| `_agentInvolvedId_not?` | `string` \| `null` | -| `_agentInvolvedId_not_contains?` | `string` \| `null` | -| `_agentInvolvedId_not_in?` | `string`[] | -| `_attributes?` | `string` \| `null` | -| `_attributes_contains?` | `string` \| `null` | -| `_attributes_contains_nocase?` | `string` \| `null` | -| `_attributes_ends_with?` | `string` \| `null` | -| `_attributes_ends_with_nocase?` | `string` \| `null` | -| `_attributes_gt?` | `string` \| `null` | -| `_attributes_gte?` | `string` \| `null` | -| `_attributes_in?` | `string`[] | -| `_attributes_lt?` | `string` \| `null` | -| `_attributes_lte?` | `string` \| `null` | -| `_attributes_not?` | `string` \| `null` | -| `_attributes_not_contains?` | `string` \| `null` | -| `_attributes_not_contains_nocase?` | `string` \| `null` | -| `_attributes_not_ends_with?` | `string` \| `null` | -| `_attributes_not_ends_with_nocase?` | `string` \| `null` | -| `_attributes_not_in?` | `string`[] | -| `_attributes_not_starts_with?` | `string` \| `null` | -| `_attributes_not_starts_with_nocase?` | `string` \| `null` | -| `_attributes_starts_with?` | `string` \| `null` | -| `_attributes_starts_with_nocase?` | `string` \| `null` | -| `_blockNumberUpdated?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_in?` | `WeiSource`[] | -| `_blockNumberUpdated_lt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_lte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not_in?` | `WeiSource`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_method?` | `number` \| `null` | -| `_method_gt?` | `number` \| `null` | -| `_method_gte?` | `number` \| `null` | -| `_method_in?` | `number`[] | -| `_method_lt?` | `number` \| `null` | -| `_method_lte?` | `number` \| `null` | -| `_method_not?` | `number` \| `null` | -| `_method_not_in?` | `number`[] | -| `_relatedDid?` | `string` \| `null` | -| `_relatedDid_contains?` | `string` \| `null` | -| `_relatedDid_in?` | `string`[] | -| `_relatedDid_not?` | `string` \| `null` | -| `_relatedDid_not_contains?` | `string` \| `null` | -| `_relatedDid_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `provId?` | `string` \| `null` | -| `provId_contains?` | `string` \| `null` | -| `provId_in?` | `string`[] | -| `provId_not?` | `string` \| `null` | -| `provId_not_contains?` | `string` \| `null` | -| `provId_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:636 - ---- - -### ProvenanceAttributeRegisteredResult - -Ƭ **ProvenanceAttributeRegisteredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_activityId` | `string` | -| `_agentId` | `string` | -| `_agentInvolvedId` | `string` | -| `_attributes` | `string` | -| `_blockNumberUpdated` | `Wei` | -| `_did` | `string` | -| `_method` | `number` | -| `_relatedDid` | `string` | -| `id` | `string` | -| `provId` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:718 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:2 - ---- - -### UsedArgs - -Ƭ **UsedArgs**<`K`\>: { [Property in keyof Pick]: UsedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------- | -| `K` | extends keyof [`UsedResult`](subgraphs.DIDRegistry.md#usedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:827 - ---- - -### UsedFields - -Ƭ **UsedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_activityId` | `true` | -| `_agentId` | `true` | -| `_attributes` | `true` | -| `_blockNumberUpdated` | `true` | -| `_did` | `true` | -| `id` | `true` | -| `provId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:818 - ---- - -### UsedFilter - -Ƭ **UsedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :-------------------- | -| `_activityId?` | `string` \| `null` | -| `_activityId_contains?` | `string` \| `null` | -| `_activityId_in?` | `string`[] | -| `_activityId_not?` | `string` \| `null` | -| `_activityId_not_contains?` | `string` \| `null` | -| `_activityId_not_in?` | `string`[] | -| `_agentId?` | `string` \| `null` | -| `_agentId_contains?` | `string` \| `null` | -| `_agentId_in?` | `string`[] | -| `_agentId_not?` | `string` \| `null` | -| `_agentId_not_contains?` | `string` \| `null` | -| `_agentId_not_in?` | `string`[] | -| `_attributes?` | `string` \| `null` | -| `_attributes_contains?` | `string` \| `null` | -| `_attributes_contains_nocase?` | `string` \| `null` | -| `_attributes_ends_with?` | `string` \| `null` | -| `_attributes_ends_with_nocase?` | `string` \| `null` | -| `_attributes_gt?` | `string` \| `null` | -| `_attributes_gte?` | `string` \| `null` | -| `_attributes_in?` | `string`[] | -| `_attributes_lt?` | `string` \| `null` | -| `_attributes_lte?` | `string` \| `null` | -| `_attributes_not?` | `string` \| `null` | -| `_attributes_not_contains?` | `string` \| `null` | -| `_attributes_not_contains_nocase?` | `string` \| `null` | -| `_attributes_not_ends_with?` | `string` \| `null` | -| `_attributes_not_ends_with_nocase?` | `string` \| `null` | -| `_attributes_not_in?` | `string`[] | -| `_attributes_not_starts_with?` | `string` \| `null` | -| `_attributes_not_starts_with_nocase?` | `string` \| `null` | -| `_attributes_starts_with?` | `string` \| `null` | -| `_attributes_starts_with_nocase?` | `string` \| `null` | -| `_blockNumberUpdated?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_in?` | `WeiSource`[] | -| `_blockNumberUpdated_lt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_lte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not_in?` | `WeiSource`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `provId?` | `string` \| `null` | -| `provId_contains?` | `string` \| `null` | -| `provId_in?` | `string`[] | -| `provId_not?` | `string` \| `null` | -| `provId_not_contains?` | `string` \| `null` | -| `provId_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:747 - ---- - -### UsedResult - -Ƭ **UsedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_activityId` | `string` | -| `_agentId` | `string` | -| `_attributes` | `string` | -| `_blockNumberUpdated` | `Wei` | -| `_did` | `string` | -| `id` | `string` | -| `provId` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:809 - ---- - -### WasAssociatedWithArgs - -Ƭ **WasAssociatedWithArgs**<`K`\>: { [Property in keyof Pick]: WasAssociatedWithFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:912 - ---- - -### WasAssociatedWithFields - -Ƭ **WasAssociatedWithFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_activityId` | `true` | -| `_agentId` | `true` | -| `_attributes` | `true` | -| `_blockNumberUpdated` | `true` | -| `_entityDid` | `true` | -| `id` | `true` | -| `provId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:903 - ---- - -### WasAssociatedWithFilter - -Ƭ **WasAssociatedWithFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :-------------------- | -| `_activityId?` | `string` \| `null` | -| `_activityId_contains?` | `string` \| `null` | -| `_activityId_in?` | `string`[] | -| `_activityId_not?` | `string` \| `null` | -| `_activityId_not_contains?` | `string` \| `null` | -| `_activityId_not_in?` | `string`[] | -| `_agentId?` | `string` \| `null` | -| `_agentId_contains?` | `string` \| `null` | -| `_agentId_in?` | `string`[] | -| `_agentId_not?` | `string` \| `null` | -| `_agentId_not_contains?` | `string` \| `null` | -| `_agentId_not_in?` | `string`[] | -| `_attributes?` | `string` \| `null` | -| `_attributes_contains?` | `string` \| `null` | -| `_attributes_contains_nocase?` | `string` \| `null` | -| `_attributes_ends_with?` | `string` \| `null` | -| `_attributes_ends_with_nocase?` | `string` \| `null` | -| `_attributes_gt?` | `string` \| `null` | -| `_attributes_gte?` | `string` \| `null` | -| `_attributes_in?` | `string`[] | -| `_attributes_lt?` | `string` \| `null` | -| `_attributes_lte?` | `string` \| `null` | -| `_attributes_not?` | `string` \| `null` | -| `_attributes_not_contains?` | `string` \| `null` | -| `_attributes_not_contains_nocase?` | `string` \| `null` | -| `_attributes_not_ends_with?` | `string` \| `null` | -| `_attributes_not_ends_with_nocase?` | `string` \| `null` | -| `_attributes_not_in?` | `string`[] | -| `_attributes_not_starts_with?` | `string` \| `null` | -| `_attributes_not_starts_with_nocase?` | `string` \| `null` | -| `_attributes_starts_with?` | `string` \| `null` | -| `_attributes_starts_with_nocase?` | `string` \| `null` | -| `_blockNumberUpdated?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_in?` | `WeiSource`[] | -| `_blockNumberUpdated_lt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_lte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not_in?` | `WeiSource`[] | -| `_entityDid?` | `string` \| `null` | -| `_entityDid_contains?` | `string` \| `null` | -| `_entityDid_in?` | `string`[] | -| `_entityDid_not?` | `string` \| `null` | -| `_entityDid_not_contains?` | `string` \| `null` | -| `_entityDid_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `provId?` | `string` \| `null` | -| `provId_contains?` | `string` \| `null` | -| `provId_in?` | `string`[] | -| `provId_not?` | `string` \| `null` | -| `provId_not_contains?` | `string` \| `null` | -| `provId_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:832 - ---- - -### WasAssociatedWithResult - -Ƭ **WasAssociatedWithResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_activityId` | `string` | -| `_agentId` | `string` | -| `_attributes` | `string` | -| `_blockNumberUpdated` | `Wei` | -| `_entityDid` | `string` | -| `id` | `string` | -| `provId` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:894 - ---- - -### WasDerivedFromArgs - -Ƭ **WasDerivedFromArgs**<`K`\>: { [Property in keyof Pick]: WasDerivedFromFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1005 - ---- - -### WasDerivedFromFields - -Ƭ **WasDerivedFromFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_activityId` | `true` | -| `_agentId` | `true` | -| `_attributes` | `true` | -| `_blockNumberUpdated` | `true` | -| `_newEntityDid` | `true` | -| `_usedEntityDid` | `true` | -| `id` | `true` | -| `provId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:995 - ---- - -### WasDerivedFromFilter - -Ƭ **WasDerivedFromFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :-------------------- | -| `_activityId?` | `string` \| `null` | -| `_activityId_contains?` | `string` \| `null` | -| `_activityId_in?` | `string`[] | -| `_activityId_not?` | `string` \| `null` | -| `_activityId_not_contains?` | `string` \| `null` | -| `_activityId_not_in?` | `string`[] | -| `_agentId?` | `string` \| `null` | -| `_agentId_contains?` | `string` \| `null` | -| `_agentId_in?` | `string`[] | -| `_agentId_not?` | `string` \| `null` | -| `_agentId_not_contains?` | `string` \| `null` | -| `_agentId_not_in?` | `string`[] | -| `_attributes?` | `string` \| `null` | -| `_attributes_contains?` | `string` \| `null` | -| `_attributes_contains_nocase?` | `string` \| `null` | -| `_attributes_ends_with?` | `string` \| `null` | -| `_attributes_ends_with_nocase?` | `string` \| `null` | -| `_attributes_gt?` | `string` \| `null` | -| `_attributes_gte?` | `string` \| `null` | -| `_attributes_in?` | `string`[] | -| `_attributes_lt?` | `string` \| `null` | -| `_attributes_lte?` | `string` \| `null` | -| `_attributes_not?` | `string` \| `null` | -| `_attributes_not_contains?` | `string` \| `null` | -| `_attributes_not_contains_nocase?` | `string` \| `null` | -| `_attributes_not_ends_with?` | `string` \| `null` | -| `_attributes_not_ends_with_nocase?` | `string` \| `null` | -| `_attributes_not_in?` | `string`[] | -| `_attributes_not_starts_with?` | `string` \| `null` | -| `_attributes_not_starts_with_nocase?` | `string` \| `null` | -| `_attributes_starts_with?` | `string` \| `null` | -| `_attributes_starts_with_nocase?` | `string` \| `null` | -| `_blockNumberUpdated?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_in?` | `WeiSource`[] | -| `_blockNumberUpdated_lt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_lte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not_in?` | `WeiSource`[] | -| `_newEntityDid?` | `string` \| `null` | -| `_newEntityDid_contains?` | `string` \| `null` | -| `_newEntityDid_in?` | `string`[] | -| `_newEntityDid_not?` | `string` \| `null` | -| `_newEntityDid_not_contains?` | `string` \| `null` | -| `_newEntityDid_not_in?` | `string`[] | -| `_usedEntityDid?` | `string` \| `null` | -| `_usedEntityDid_contains?` | `string` \| `null` | -| `_usedEntityDid_in?` | `string`[] | -| `_usedEntityDid_not?` | `string` \| `null` | -| `_usedEntityDid_not_contains?` | `string` \| `null` | -| `_usedEntityDid_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `provId?` | `string` \| `null` | -| `provId_contains?` | `string` \| `null` | -| `provId_in?` | `string`[] | -| `provId_not?` | `string` \| `null` | -| `provId_not_contains?` | `string` \| `null` | -| `provId_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:917 - ---- - -### WasDerivedFromResult - -Ƭ **WasDerivedFromResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_activityId` | `string` | -| `_agentId` | `string` | -| `_attributes` | `string` | -| `_blockNumberUpdated` | `Wei` | -| `_newEntityDid` | `string` | -| `_usedEntityDid` | `string` | -| `id` | `string` | -| `provId` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:985 - ---- - -### WasGeneratedByArgs - -Ƭ **WasGeneratedByArgs**<`K`\>: { [Property in keyof Pick]: WasGeneratedByFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1090 - ---- - -### WasGeneratedByFields - -Ƭ **WasGeneratedByFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_activityId` | `true` | -| `_agentId` | `true` | -| `_attributes` | `true` | -| `_blockNumberUpdated` | `true` | -| `_did` | `true` | -| `id` | `true` | -| `provId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1081 - ---- - -### WasGeneratedByFilter - -Ƭ **WasGeneratedByFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :-------------------- | -| `_activityId?` | `string` \| `null` | -| `_activityId_contains?` | `string` \| `null` | -| `_activityId_in?` | `string`[] | -| `_activityId_not?` | `string` \| `null` | -| `_activityId_not_contains?` | `string` \| `null` | -| `_activityId_not_in?` | `string`[] | -| `_agentId?` | `string` \| `null` | -| `_agentId_contains?` | `string` \| `null` | -| `_agentId_in?` | `string`[] | -| `_agentId_not?` | `string` \| `null` | -| `_agentId_not_contains?` | `string` \| `null` | -| `_agentId_not_in?` | `string`[] | -| `_attributes?` | `string` \| `null` | -| `_attributes_contains?` | `string` \| `null` | -| `_attributes_contains_nocase?` | `string` \| `null` | -| `_attributes_ends_with?` | `string` \| `null` | -| `_attributes_ends_with_nocase?` | `string` \| `null` | -| `_attributes_gt?` | `string` \| `null` | -| `_attributes_gte?` | `string` \| `null` | -| `_attributes_in?` | `string`[] | -| `_attributes_lt?` | `string` \| `null` | -| `_attributes_lte?` | `string` \| `null` | -| `_attributes_not?` | `string` \| `null` | -| `_attributes_not_contains?` | `string` \| `null` | -| `_attributes_not_contains_nocase?` | `string` \| `null` | -| `_attributes_not_ends_with?` | `string` \| `null` | -| `_attributes_not_ends_with_nocase?` | `string` \| `null` | -| `_attributes_not_in?` | `string`[] | -| `_attributes_not_starts_with?` | `string` \| `null` | -| `_attributes_not_starts_with_nocase?` | `string` \| `null` | -| `_attributes_starts_with?` | `string` \| `null` | -| `_attributes_starts_with_nocase?` | `string` \| `null` | -| `_blockNumberUpdated?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_gte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_in?` | `WeiSource`[] | -| `_blockNumberUpdated_lt?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_lte?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not?` | `WeiSource` \| `null` | -| `_blockNumberUpdated_not_in?` | `WeiSource`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `provId?` | `string` \| `null` | -| `provId_contains?` | `string` \| `null` | -| `provId_in?` | `string`[] | -| `provId_not?` | `string` \| `null` | -| `provId_not_contains?` | `string` \| `null` | -| `provId_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1010 - ---- - -### WasGeneratedByResult - -Ƭ **WasGeneratedByResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_activityId` | `string` | -| `_agentId` | `string` | -| `_attributes` | `string` | -| `_blockNumberUpdated` | `Wei` | -| `_did` | `string` | -| `id` | `string` | -| `provId` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1072 - -## Functions - -### getActedOnBehalfById - -▸ **getActedOnBehalfById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`ActedOnBehalfArgs`](subgraphs.DIDRegistry.md#actedonbehalfargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:112 - ---- - -### getActedOnBehalfs - -▸ **getActedOnBehalfs**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`ActedOnBehalfFilter`](subgraphs.DIDRegistry.md#actedonbehalffilter), [`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult)\> | -| `args` | [`ActedOnBehalfArgs`](subgraphs.DIDRegistry.md#actedonbehalfargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ActedOnBehalfResult`](subgraphs.DIDRegistry.md#actedonbehalfresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:113 - ---- - -### getDIDAttributeRegisteredById - -▸ **getDIDAttributeRegisteredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDAttributeRegisteredArgs`](subgraphs.DIDRegistry.md#didattributeregisteredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:197 - ---- - -### getDIDAttributeRegistereds - -▸ **getDIDAttributeRegistereds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDAttributeRegisteredFilter`](subgraphs.DIDRegistry.md#didattributeregisteredfilter), [`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult)\> | -| `args` | [`DIDAttributeRegisteredArgs`](subgraphs.DIDRegistry.md#didattributeregisteredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDAttributeRegisteredResult`](subgraphs.DIDRegistry.md#didattributeregisteredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:198 - ---- - -### getDIDOwnershipTransferredById - -▸ **getDIDOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDOwnershipTransferredArgs`](subgraphs.DIDRegistry.md#didownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:242 - ---- - -### getDIDOwnershipTransferreds - -▸ **getDIDOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDOwnershipTransferredFilter`](subgraphs.DIDRegistry.md#didownershiptransferredfilter), [`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult)\> | -| `args` | [`DIDOwnershipTransferredArgs`](subgraphs.DIDRegistry.md#didownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDOwnershipTransferredResult`](subgraphs.DIDRegistry.md#didownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:243 - ---- - -### getDIDPermissionGrantedById - -▸ **getDIDPermissionGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDPermissionGrantedArgs`](subgraphs.DIDRegistry.md#didpermissiongrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:287 - ---- - -### getDIDPermissionGranteds - -▸ **getDIDPermissionGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDPermissionGrantedFilter`](subgraphs.DIDRegistry.md#didpermissiongrantedfilter), [`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult)\> | -| `args` | [`DIDPermissionGrantedArgs`](subgraphs.DIDRegistry.md#didpermissiongrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDPermissionGrantedResult`](subgraphs.DIDRegistry.md#didpermissiongrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:288 - ---- - -### getDIDPermissionRevokedById - -▸ **getDIDPermissionRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDPermissionRevokedArgs`](subgraphs.DIDRegistry.md#didpermissionrevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:332 - ---- - -### getDIDPermissionRevokeds - -▸ **getDIDPermissionRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDPermissionRevokedFilter`](subgraphs.DIDRegistry.md#didpermissionrevokedfilter), [`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult)\> | -| `args` | [`DIDPermissionRevokedArgs`](subgraphs.DIDRegistry.md#didpermissionrevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDPermissionRevokedResult`](subgraphs.DIDRegistry.md#didpermissionrevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:333 - ---- - -### getDIDProvenanceDelegateAddedById - -▸ **getDIDProvenanceDelegateAddedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDProvenanceDelegateAddedArgs`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:369 - ---- - -### getDIDProvenanceDelegateAddeds - -▸ **getDIDProvenanceDelegateAddeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDProvenanceDelegateAddedFilter`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedfilter), [`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult)\> | -| `args` | [`DIDProvenanceDelegateAddedArgs`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProvenanceDelegateAddedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateaddedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:370 - ---- - -### getDIDProvenanceDelegateRemovedById - -▸ **getDIDProvenanceDelegateRemovedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDProvenanceDelegateRemovedArgs`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:412 - ---- - -### getDIDProvenanceDelegateRemoveds - -▸ **getDIDProvenanceDelegateRemoveds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDProvenanceDelegateRemovedFilter`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedfilter), [`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult)\> | -| `args` | [`DIDProvenanceDelegateRemovedArgs`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProvenanceDelegateRemovedResult`](subgraphs.DIDRegistry.md#didprovenancedelegateremovedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:413 - ---- - -### getDIDProviderAddedById - -▸ **getDIDProviderAddedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDProviderAddedArgs`](subgraphs.DIDRegistry.md#didprovideraddedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:449 - ---- - -### getDIDProviderAddeds - -▸ **getDIDProviderAddeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDProviderAddedFilter`](subgraphs.DIDRegistry.md#didprovideraddedfilter), [`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult)\> | -| `args` | [`DIDProviderAddedArgs`](subgraphs.DIDRegistry.md#didprovideraddedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProviderAddedResult`](subgraphs.DIDRegistry.md#didprovideraddedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:450 - ---- - -### getDIDProviderRemovedById - -▸ **getDIDProviderRemovedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDProviderRemovedArgs`](subgraphs.DIDRegistry.md#didproviderremovedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:492 - ---- - -### getDIDProviderRemoveds - -▸ **getDIDProviderRemoveds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDProviderRemovedFilter`](subgraphs.DIDRegistry.md#didproviderremovedfilter), [`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult)\> | -| `args` | [`DIDProviderRemovedArgs`](subgraphs.DIDRegistry.md#didproviderremovedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDProviderRemovedResult`](subgraphs.DIDRegistry.md#didproviderremovedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:493 - ---- - -### getDIDRoyaltiesAddedById - -▸ **getDIDRoyaltiesAddedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDRoyaltiesAddedArgs`](subgraphs.DIDRegistry.md#didroyaltiesaddedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:529 - ---- - -### getDIDRoyaltiesAddeds - -▸ **getDIDRoyaltiesAddeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDRoyaltiesAddedFilter`](subgraphs.DIDRegistry.md#didroyaltiesaddedfilter), [`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult)\> | -| `args` | [`DIDRoyaltiesAddedArgs`](subgraphs.DIDRegistry.md#didroyaltiesaddedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDRoyaltiesAddedResult`](subgraphs.DIDRegistry.md#didroyaltiesaddedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:530 - ---- - -### getDIDRoyaltyRecipientChangedById - -▸ **getDIDRoyaltyRecipientChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`DIDRoyaltyRecipientChangedArgs`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:566 - ---- - -### getDIDRoyaltyRecipientChangeds - -▸ **getDIDRoyaltyRecipientChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`DIDRoyaltyRecipientChangedFilter`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedfilter), [`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult)\> | -| `args` | [`DIDRoyaltyRecipientChangedArgs`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`DIDRoyaltyRecipientChangedResult`](subgraphs.DIDRegistry.md#didroyaltyrecipientchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:567 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.DIDRegistry.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:597 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.DIDRegistry.md#initializedfilter), [`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.DIDRegistry.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDRegistry.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:598 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.DIDRegistry.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:634 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.DIDRegistry.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.DIDRegistry.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDRegistry.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:635 - ---- - -### getProvenanceAttributeRegisteredById - -▸ **getProvenanceAttributeRegisteredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`ProvenanceAttributeRegisteredArgs`](subgraphs.DIDRegistry.md#provenanceattributeregisteredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:745 - ---- - -### getProvenanceAttributeRegistereds - -▸ **getProvenanceAttributeRegistereds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`ProvenanceAttributeRegisteredFilter`](subgraphs.DIDRegistry.md#provenanceattributeregisteredfilter), [`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult)\> | -| `args` | [`ProvenanceAttributeRegisteredArgs`](subgraphs.DIDRegistry.md#provenanceattributeregisteredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ProvenanceAttributeRegisteredResult`](subgraphs.DIDRegistry.md#provenanceattributeregisteredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:746 - ---- - -### getUsedById - -▸ **getUsedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`UsedResult`](subgraphs.DIDRegistry.md#usedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------- | -| `K` | extends keyof [`UsedResult`](subgraphs.DIDRegistry.md#usedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`UsedArgs`](subgraphs.DIDRegistry.md#usedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`UsedResult`](subgraphs.DIDRegistry.md#usedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:830 - ---- - -### getUseds - -▸ **getUseds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`UsedResult`](subgraphs.DIDRegistry.md#usedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------- | -| `K` | extends keyof [`UsedResult`](subgraphs.DIDRegistry.md#usedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`UsedFilter`](subgraphs.DIDRegistry.md#usedfilter), [`UsedResult`](subgraphs.DIDRegistry.md#usedresult)\> | -| `args` | [`UsedArgs`](subgraphs.DIDRegistry.md#usedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`UsedResult`](subgraphs.DIDRegistry.md#usedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:831 - ---- - -### getWasAssociatedWithById - -▸ **getWasAssociatedWithById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`WasAssociatedWithArgs`](subgraphs.DIDRegistry.md#wasassociatedwithargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:915 - ---- - -### getWasAssociatedWiths - -▸ **getWasAssociatedWiths**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`WasAssociatedWithFilter`](subgraphs.DIDRegistry.md#wasassociatedwithfilter), [`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult)\> | -| `args` | [`WasAssociatedWithArgs`](subgraphs.DIDRegistry.md#wasassociatedwithargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`WasAssociatedWithResult`](subgraphs.DIDRegistry.md#wasassociatedwithresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:916 - ---- - -### getWasDerivedFromById - -▸ **getWasDerivedFromById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`WasDerivedFromArgs`](subgraphs.DIDRegistry.md#wasderivedfromargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1008 - ---- - -### getWasDerivedFroms - -▸ **getWasDerivedFroms**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`WasDerivedFromFilter`](subgraphs.DIDRegistry.md#wasderivedfromfilter), [`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult)\> | -| `args` | [`WasDerivedFromArgs`](subgraphs.DIDRegistry.md#wasderivedfromargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`WasDerivedFromResult`](subgraphs.DIDRegistry.md#wasderivedfromresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1009 - ---- - -### getWasGeneratedByById - -▸ **getWasGeneratedByById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDRegistry.md#singlequeryoptions) | -| `args` | [`WasGeneratedByArgs`](subgraphs.DIDRegistry.md#wasgeneratedbyargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1093 - ---- - -### getWasGeneratedBys - -▸ **getWasGeneratedBys**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDRegistry.md#multiqueryoptions)<[`WasGeneratedByFilter`](subgraphs.DIDRegistry.md#wasgeneratedbyfilter), [`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult)\> | -| `args` | [`WasGeneratedByArgs`](subgraphs.DIDRegistry.md#wasgeneratedbyargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`WasGeneratedByResult`](subgraphs.DIDRegistry.md#wasgeneratedbyresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDRegistry.d.ts:1094 diff --git a/docs/api-reference/modules/subgraphs.DIDSalesTemplate.md b/docs/api-reference/modules/subgraphs.DIDSalesTemplate.md deleted file mode 100644 index 9359399b9..000000000 --- a/docs/api-reference/modules/subgraphs.DIDSalesTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / DIDSalesTemplate - -# Namespace: DIDSalesTemplate - -[subgraphs](subgraphs.md).DIDSalesTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.DIDSalesTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.DIDSalesTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.DIDSalesTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.DIDSalesTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.DIDSalesTemplate.md#initializedargs) -- [InitializedFields](subgraphs.DIDSalesTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.DIDSalesTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.DIDSalesTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.DIDSalesTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.DIDSalesTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.DIDSalesTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.DIDSalesTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.DIDSalesTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.DIDSalesTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.DIDSalesTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.DIDSalesTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.DIDSalesTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.DIDSalesTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.DIDSalesTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDSalesTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.DIDSalesTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDSalesTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.DIDSalesTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.DIDSalesTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.DIDSalesTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDSalesTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.DIDSalesTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDSalesTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.DIDSalesTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.DIDSalesTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.DIDSalesTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DIDSalesTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.DIDSalesTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DIDSalesTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.DIDSalesTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.DIDSalesTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DIDSalesTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DIDSalesTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.Dispenser.md b/docs/api-reference/modules/subgraphs.Dispenser.md deleted file mode 100644 index 559e2a022..000000000 --- a/docs/api-reference/modules/subgraphs.Dispenser.md +++ /dev/null @@ -1,663 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / Dispenser - -# Namespace: Dispenser - -[subgraphs](subgraphs.md).Dispenser - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.Dispenser.md#initializedargs) -- [InitializedFields](subgraphs.Dispenser.md#initializedfields) -- [InitializedFilter](subgraphs.Dispenser.md#initializedfilter) -- [InitializedResult](subgraphs.Dispenser.md#initializedresult) -- [MultiQueryOptions](subgraphs.Dispenser.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.Dispenser.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.Dispenser.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.Dispenser.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.Dispenser.md#ownershiptransferredresult) -- [RequestFrequencyExceededArgs](subgraphs.Dispenser.md#requestfrequencyexceededargs) -- [RequestFrequencyExceededFields](subgraphs.Dispenser.md#requestfrequencyexceededfields) -- [RequestFrequencyExceededFilter](subgraphs.Dispenser.md#requestfrequencyexceededfilter) -- [RequestFrequencyExceededResult](subgraphs.Dispenser.md#requestfrequencyexceededresult) -- [RequestLimitExceededArgs](subgraphs.Dispenser.md#requestlimitexceededargs) -- [RequestLimitExceededFields](subgraphs.Dispenser.md#requestlimitexceededfields) -- [RequestLimitExceededFilter](subgraphs.Dispenser.md#requestlimitexceededfilter) -- [RequestLimitExceededResult](subgraphs.Dispenser.md#requestlimitexceededresult) -- [SingleQueryOptions](subgraphs.Dispenser.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.Dispenser.md#getinitializedbyid) -- [getInitializeds](subgraphs.Dispenser.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.Dispenser.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.Dispenser.md#getownershiptransferreds) -- [getRequestFrequencyExceededById](subgraphs.Dispenser.md#getrequestfrequencyexceededbyid) -- [getRequestFrequencyExceededs](subgraphs.Dispenser.md#getrequestfrequencyexceededs) -- [getRequestLimitExceededById](subgraphs.Dispenser.md#getrequestlimitexceededbyid) -- [getRequestLimitExceededs](subgraphs.Dispenser.md#getrequestlimitexceededs) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.Dispenser.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:47 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:43 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:21 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:39 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:84 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:79 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:52 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:74 - ---- - -### RequestFrequencyExceededArgs - -Ƭ **RequestFrequencyExceededArgs**<`K`\>: { [Property in keyof Pick]: RequestFrequencyExceededFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:123 - ---- - -### RequestFrequencyExceededFields - -Ƭ **RequestFrequencyExceededFields**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :----- | -| `id` | `true` | -| `minPeriod` | `true` | -| `requester` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:118 - ---- - -### RequestFrequencyExceededFilter - -Ƭ **RequestFrequencyExceededFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------ | :-------------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `minPeriod?` | `WeiSource` \| `null` | -| `minPeriod_gt?` | `WeiSource` \| `null` | -| `minPeriod_gte?` | `WeiSource` \| `null` | -| `minPeriod_in?` | `WeiSource`[] | -| `minPeriod_lt?` | `WeiSource` \| `null` | -| `minPeriod_lte?` | `WeiSource` \| `null` | -| `minPeriod_not?` | `WeiSource` \| `null` | -| `minPeriod_not_in?` | `WeiSource`[] | -| `requester?` | `string` \| `null` | -| `requester_contains?` | `string` \| `null` | -| `requester_in?` | `string`[] | -| `requester_not?` | `string` \| `null` | -| `requester_not_contains?` | `string` \| `null` | -| `requester_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:89 - ---- - -### RequestFrequencyExceededResult - -Ƭ **RequestFrequencyExceededResult**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `id` | `string` | -| `minPeriod` | `Wei` | -| `requester` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:113 - ---- - -### RequestLimitExceededArgs - -Ƭ **RequestLimitExceededArgs**<`K`\>: { [Property in keyof Pick]: RequestLimitExceededFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:172 - ---- - -### RequestLimitExceededFields - -Ƭ **RequestLimitExceededFields**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :----- | -| `amount` | `true` | -| `id` | `true` | -| `maxAmount` | `true` | -| `requester` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:166 - ---- - -### RequestLimitExceededFilter - -Ƭ **RequestLimitExceededFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------ | :-------------------- | -| `amount?` | `WeiSource` \| `null` | -| `amount_gt?` | `WeiSource` \| `null` | -| `amount_gte?` | `WeiSource` \| `null` | -| `amount_in?` | `WeiSource`[] | -| `amount_lt?` | `WeiSource` \| `null` | -| `amount_lte?` | `WeiSource` \| `null` | -| `amount_not?` | `WeiSource` \| `null` | -| `amount_not_in?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `maxAmount?` | `WeiSource` \| `null` | -| `maxAmount_gt?` | `WeiSource` \| `null` | -| `maxAmount_gte?` | `WeiSource` \| `null` | -| `maxAmount_in?` | `WeiSource`[] | -| `maxAmount_lt?` | `WeiSource` \| `null` | -| `maxAmount_lte?` | `WeiSource` \| `null` | -| `maxAmount_not?` | `WeiSource` \| `null` | -| `maxAmount_not_in?` | `WeiSource`[] | -| `requester?` | `string` \| `null` | -| `requester_contains?` | `string` \| `null` | -| `requester_in?` | `string`[] | -| `requester_not?` | `string` \| `null` | -| `requester_not_contains?` | `string` \| `null` | -| `requester_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:128 - ---- - -### RequestLimitExceededResult - -Ƭ **RequestLimitExceededResult**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `amount` | `Wei` | -| `id` | `string` | -| `maxAmount` | `Wei` | -| `requester` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:160 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:2 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.Dispenser.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.Dispenser.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.Dispenser.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.Dispenser.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.Dispenser.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:50 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.Dispenser.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.Dispenser.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.Dispenser.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.Dispenser.md#initializedfilter), [`InitializedResult`](subgraphs.Dispenser.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.Dispenser.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.Dispenser.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:51 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.Dispenser.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.Dispenser.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:87 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.Dispenser.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.Dispenser.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.Dispenser.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.Dispenser.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:88 - ---- - -### getRequestFrequencyExceededById - -▸ **getRequestFrequencyExceededById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.Dispenser.md#singlequeryoptions) | -| `args` | [`RequestFrequencyExceededArgs`](subgraphs.Dispenser.md#requestfrequencyexceededargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:126 - ---- - -### getRequestFrequencyExceededs - -▸ **getRequestFrequencyExceededs**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.Dispenser.md#multiqueryoptions)<[`RequestFrequencyExceededFilter`](subgraphs.Dispenser.md#requestfrequencyexceededfilter), [`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult)\> | -| `args` | [`RequestFrequencyExceededArgs`](subgraphs.Dispenser.md#requestfrequencyexceededargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RequestFrequencyExceededResult`](subgraphs.Dispenser.md#requestfrequencyexceededresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:127 - ---- - -### getRequestLimitExceededById - -▸ **getRequestLimitExceededById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.Dispenser.md#singlequeryoptions) | -| `args` | [`RequestLimitExceededArgs`](subgraphs.Dispenser.md#requestlimitexceededargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:175 - ---- - -### getRequestLimitExceededs - -▸ **getRequestLimitExceededs**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.Dispenser.md#multiqueryoptions)<[`RequestLimitExceededFilter`](subgraphs.Dispenser.md#requestlimitexceededfilter), [`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult)\> | -| `args` | [`RequestLimitExceededArgs`](subgraphs.Dispenser.md#requestlimitexceededargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RequestLimitExceededResult`](subgraphs.Dispenser.md#requestlimitexceededresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/Dispenser.d.ts:176 diff --git a/docs/api-reference/modules/subgraphs.DistributeNFTCollateralCondition.md b/docs/api-reference/modules/subgraphs.DistributeNFTCollateralCondition.md deleted file mode 100644 index 996cd0296..000000000 --- a/docs/api-reference/modules/subgraphs.DistributeNFTCollateralCondition.md +++ /dev/null @@ -1,381 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / DistributeNFTCollateralCondition - -# Namespace: DistributeNFTCollateralCondition - -[subgraphs](subgraphs.md).DistributeNFTCollateralCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.DistributeNFTCollateralCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.DistributeNFTCollateralCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.DistributeNFTCollateralCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult) -- [MultiQueryOptions](subgraphs.DistributeNFTCollateralCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.DistributeNFTCollateralCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.DistributeNFTCollateralCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.DistributeNFTCollateralCondition.md#getfulfilleds) -- [getOwnershipTransferredById](subgraphs.DistributeNFTCollateralCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.DistributeNFTCollateralCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:76 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_contract` | `true` | -| `_did` | `true` | -| `_receiver` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:68 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_contract?` | `string` \| `null` | -| `_contract_contains?` | `string` \| `null` | -| `_contract_in?` | `string`[] | -| `_contract_not?` | `string` \| `null` | -| `_contract_not_contains?` | `string` \| `null` | -| `_contract_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_receiver?` | `string` \| `null` | -| `_receiver_contains?` | `string` \| `null` | -| `_receiver_in?` | `string`[] | -| `_receiver_not?` | `string` \| `null` | -| `_receiver_not_contains?` | `string` \| `null` | -| `_receiver_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_contract` | `string` | -| `_did` | `string` | -| `_receiver` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:60 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:113 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:108 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:81 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:103 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DistributeNFTCollateralCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:79 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DistributeNFTCollateralCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.DistributeNFTCollateralCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:80 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.DistributeNFTCollateralCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:116 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.DistributeNFTCollateralCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.DistributeNFTCollateralCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/DistributeNFTCollateralCondition.d.ts:117 diff --git a/docs/api-reference/modules/subgraphs.EscrowComputeExecutionTemplate.md b/docs/api-reference/modules/subgraphs.EscrowComputeExecutionTemplate.md deleted file mode 100644 index eb2641cf1..000000000 --- a/docs/api-reference/modules/subgraphs.EscrowComputeExecutionTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / EscrowComputeExecutionTemplate - -# Namespace: EscrowComputeExecutionTemplate - -[subgraphs](subgraphs.md).EscrowComputeExecutionTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.EscrowComputeExecutionTemplate.md#initializedargs) -- [InitializedFields](subgraphs.EscrowComputeExecutionTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.EscrowComputeExecutionTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.EscrowComputeExecutionTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.EscrowComputeExecutionTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.EscrowComputeExecutionTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.EscrowComputeExecutionTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.EscrowComputeExecutionTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.EscrowComputeExecutionTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.EscrowComputeExecutionTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.EscrowComputeExecutionTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.EscrowComputeExecutionTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.EscrowComputeExecutionTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.EscrowComputeExecutionTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.EscrowComputeExecutionTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.EscrowComputeExecutionTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.EscrowComputeExecutionTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.EscrowComputeExecutionTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.EscrowComputeExecutionTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowComputeExecutionTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.EscrowComputeExecutionTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.EscrowComputeExecutionTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowComputeExecutionTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowComputeExecutionTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.EscrowPaymentCondition.md b/docs/api-reference/modules/subgraphs.EscrowPaymentCondition.md deleted file mode 100644 index 1d64095e6..000000000 --- a/docs/api-reference/modules/subgraphs.EscrowPaymentCondition.md +++ /dev/null @@ -1,675 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / EscrowPaymentCondition - -# Namespace: EscrowPaymentCondition - -[subgraphs](subgraphs.md).EscrowPaymentCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.EscrowPaymentCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.EscrowPaymentCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.EscrowPaymentCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.EscrowPaymentCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.EscrowPaymentCondition.md#initializedargs) -- [InitializedFields](subgraphs.EscrowPaymentCondition.md#initializedfields) -- [InitializedFilter](subgraphs.EscrowPaymentCondition.md#initializedfilter) -- [InitializedResult](subgraphs.EscrowPaymentCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.EscrowPaymentCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.EscrowPaymentCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.EscrowPaymentCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.EscrowPaymentCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult) -- [ReceivedArgs](subgraphs.EscrowPaymentCondition.md#receivedargs) -- [ReceivedFields](subgraphs.EscrowPaymentCondition.md#receivedfields) -- [ReceivedFilter](subgraphs.EscrowPaymentCondition.md#receivedfilter) -- [ReceivedResult](subgraphs.EscrowPaymentCondition.md#receivedresult) -- [SingleQueryOptions](subgraphs.EscrowPaymentCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.EscrowPaymentCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.EscrowPaymentCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.EscrowPaymentCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.EscrowPaymentCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.EscrowPaymentCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.EscrowPaymentCondition.md#getownershiptransferreds) -- [getReceivedById](subgraphs.EscrowPaymentCondition.md#getreceivedbyid) -- [getReceiveds](subgraphs.EscrowPaymentCondition.md#getreceiveds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:77 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `_agreementId` | `true` | -| `_amounts` | `true` | -| `_conditionId` | `true` | -| `_receivers` | `true` | -| `_tokenAddress` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:69 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amounts?` | `WeiSource`[] | -| `_amounts_contains?` | `WeiSource`[] | -| `_amounts_contains_nocase?` | `WeiSource`[] | -| `_amounts_not?` | `WeiSource`[] | -| `_amounts_not_contains?` | `WeiSource`[] | -| `_amounts_not_contains_nocase?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_receivers?` | `string`[] | -| `_receivers_contains?` | `string`[] | -| `_receivers_contains_nocase?` | `string`[] | -| `_receivers_not?` | `string`[] | -| `_receivers_not_contains?` | `string`[] | -| `_receivers_not_contains_nocase?` | `string`[] | -| `_tokenAddress?` | `string` \| `null` | -| `_tokenAddress_contains?` | `string` \| `null` | -| `_tokenAddress_in?` | `string`[] | -| `_tokenAddress_not?` | `string` \| `null` | -| `_tokenAddress_not_contains?` | `string` \| `null` | -| `_tokenAddress_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :--------------------- | -| `_agreementId` | `string` | -| `_amounts` | (`Wei` \| `null`)[] | -| `_conditionId` | `string` | -| `_receivers` | (`string` \| `null`)[] | -| `_tokenAddress` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:61 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:108 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:104 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:82 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:100 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:145 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:140 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:113 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:135 - ---- - -### ReceivedArgs - -Ƭ **ReceivedArgs**<`K`\>: { [Property in keyof Pick]: ReceivedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:184 - ---- - -### ReceivedFields - -Ƭ **ReceivedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :----- | -| `_from` | `true` | -| `_value` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:179 - ---- - -### ReceivedFilter - -Ƭ **ReceivedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :-------------------- | -| `_from?` | `string` \| `null` | -| `_from_contains?` | `string` \| `null` | -| `_from_in?` | `string`[] | -| `_from_not?` | `string` \| `null` | -| `_from_not_contains?` | `string` \| `null` | -| `_from_not_in?` | `string`[] | -| `_value?` | `WeiSource` \| `null` | -| `_value_gt?` | `WeiSource` \| `null` | -| `_value_gte?` | `WeiSource` \| `null` | -| `_value_in?` | `WeiSource`[] | -| `_value_lt?` | `WeiSource` \| `null` | -| `_value_lte?` | `WeiSource` \| `null` | -| `_value_not?` | `WeiSource` \| `null` | -| `_value_not_in?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:150 - ---- - -### ReceivedResult - -Ƭ **ReceivedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :------- | -| `_from` | `string` | -| `_value` | `Wei` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:174 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.EscrowPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:80 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.EscrowPaymentCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.EscrowPaymentCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.EscrowPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.EscrowPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:81 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.EscrowPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:111 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.EscrowPaymentCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.EscrowPaymentCondition.md#initializedfilter), [`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.EscrowPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.EscrowPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:112 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:148 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.EscrowPaymentCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:149 - ---- - -### getReceivedById - -▸ **getReceivedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`ReceivedArgs`](subgraphs.EscrowPaymentCondition.md#receivedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:187 - ---- - -### getReceiveds - -▸ **getReceiveds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.EscrowPaymentCondition.md#multiqueryoptions)<[`ReceivedFilter`](subgraphs.EscrowPaymentCondition.md#receivedfilter), [`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult)\> | -| `args` | [`ReceivedArgs`](subgraphs.EscrowPaymentCondition.md#receivedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ReceivedResult`](subgraphs.EscrowPaymentCondition.md#receivedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/EscrowPaymentCondition.d.ts:188 diff --git a/docs/api-reference/modules/subgraphs.HashLockCondition.md b/docs/api-reference/modules/subgraphs.HashLockCondition.md deleted file mode 100644 index a51f21d19..000000000 --- a/docs/api-reference/modules/subgraphs.HashLockCondition.md +++ /dev/null @@ -1,351 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / HashLockCondition - -# Namespace: HashLockCondition - -[subgraphs](subgraphs.md).HashLockCondition - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.HashLockCondition.md#initializedargs) -- [InitializedFields](subgraphs.HashLockCondition.md#initializedfields) -- [InitializedFilter](subgraphs.HashLockCondition.md#initializedfilter) -- [InitializedResult](subgraphs.HashLockCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.HashLockCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.HashLockCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.HashLockCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.HashLockCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.HashLockCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.HashLockCondition.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.HashLockCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.HashLockCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.HashLockCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.HashLockCondition.md#getownershiptransferreds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:83 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:78 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:51 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:73 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.HashLockCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.HashLockCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.HashLockCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.HashLockCondition.md#initializedfilter), [`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.HashLockCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.HashLockCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:50 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.HashLockCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.HashLockCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:86 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.HashLockCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.HashLockCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.HashLockCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.HashLockCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/HashLockCondition.d.ts:87 diff --git a/docs/api-reference/modules/subgraphs.LockPaymentCondition.md b/docs/api-reference/modules/subgraphs.LockPaymentCondition.md deleted file mode 100644 index 372d4a27b..000000000 --- a/docs/api-reference/modules/subgraphs.LockPaymentCondition.md +++ /dev/null @@ -1,1011 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / LockPaymentCondition - -# Namespace: LockPaymentCondition - -[subgraphs](subgraphs.md).LockPaymentCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.LockPaymentCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.LockPaymentCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.LockPaymentCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.LockPaymentCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.LockPaymentCondition.md#initializedargs) -- [InitializedFields](subgraphs.LockPaymentCondition.md#initializedfields) -- [InitializedFilter](subgraphs.LockPaymentCondition.md#initializedfilter) -- [InitializedResult](subgraphs.LockPaymentCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.LockPaymentCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.LockPaymentCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.LockPaymentCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.LockPaymentCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.LockPaymentCondition.md#ownershiptransferredresult) -- [RoleAdminChangedArgs](subgraphs.LockPaymentCondition.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.LockPaymentCondition.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.LockPaymentCondition.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.LockPaymentCondition.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.LockPaymentCondition.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.LockPaymentCondition.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.LockPaymentCondition.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.LockPaymentCondition.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.LockPaymentCondition.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.LockPaymentCondition.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.LockPaymentCondition.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.LockPaymentCondition.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.LockPaymentCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.LockPaymentCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.LockPaymentCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.LockPaymentCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.LockPaymentCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.LockPaymentCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.LockPaymentCondition.md#getownershiptransferreds) -- [getRoleAdminChangedById](subgraphs.LockPaymentCondition.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.LockPaymentCondition.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.LockPaymentCondition.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.LockPaymentCondition.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.LockPaymentCondition.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.LockPaymentCondition.md#getrolerevokeds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:93 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------- | :----- | -| `_agreementId` | `true` | -| `_amounts` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `_receivers` | `true` | -| `_rewardAddress` | `true` | -| `_tokenAddress` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:83 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amounts?` | `WeiSource`[] | -| `_amounts_contains?` | `WeiSource`[] | -| `_amounts_contains_nocase?` | `WeiSource`[] | -| `_amounts_not?` | `WeiSource`[] | -| `_amounts_not_contains?` | `WeiSource`[] | -| `_amounts_not_contains_nocase?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_receivers?` | `string`[] | -| `_receivers_contains?` | `string`[] | -| `_receivers_contains_nocase?` | `string`[] | -| `_receivers_not?` | `string`[] | -| `_receivers_not_contains?` | `string`[] | -| `_receivers_not_contains_nocase?` | `string`[] | -| `_rewardAddress?` | `string` \| `null` | -| `_rewardAddress_contains?` | `string` \| `null` | -| `_rewardAddress_in?` | `string`[] | -| `_rewardAddress_not?` | `string` \| `null` | -| `_rewardAddress_not_contains?` | `string` \| `null` | -| `_rewardAddress_not_in?` | `string`[] | -| `_tokenAddress?` | `string` \| `null` | -| `_tokenAddress_contains?` | `string` \| `null` | -| `_tokenAddress_in?` | `string`[] | -| `_tokenAddress_not?` | `string` \| `null` | -| `_tokenAddress_not_contains?` | `string` \| `null` | -| `_tokenAddress_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------------------- | -| `_agreementId` | `string` | -| `_amounts` | (`Wei` \| `null`)[] | -| `_conditionId` | `string` | -| `_did` | `string` | -| `_receivers` | (`string` \| `null`)[] | -| `_rewardAddress` | `string` | -| `_tokenAddress` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:73 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:124 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:120 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:98 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:116 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:161 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:156 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:129 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:151 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:206 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:200 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:166 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:194 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:251 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:245 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:211 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:239 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:296 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:290 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:256 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:284 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.LockPaymentCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.LockPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:96 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.LockPaymentCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.LockPaymentCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.LockPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.LockPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:97 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.LockPaymentCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.LockPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:127 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.LockPaymentCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.LockPaymentCondition.md#initializedfilter), [`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.LockPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.LockPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:128 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.LockPaymentCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.LockPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:164 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.LockPaymentCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.LockPaymentCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.LockPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.LockPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:165 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.LockPaymentCondition.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.LockPaymentCondition.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:209 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.LockPaymentCondition.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.LockPaymentCondition.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.LockPaymentCondition.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.LockPaymentCondition.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:210 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.LockPaymentCondition.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.LockPaymentCondition.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:254 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.LockPaymentCondition.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.LockPaymentCondition.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.LockPaymentCondition.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.LockPaymentCondition.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:255 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.LockPaymentCondition.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.LockPaymentCondition.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:299 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.LockPaymentCondition.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.LockPaymentCondition.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.LockPaymentCondition.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.LockPaymentCondition.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/LockPaymentCondition.d.ts:300 diff --git a/docs/api-reference/modules/subgraphs.NFT721AccessProofTemplate.md b/docs/api-reference/modules/subgraphs.NFT721AccessProofTemplate.md deleted file mode 100644 index ac5e1645b..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721AccessProofTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721AccessProofTemplate - -# Namespace: NFT721AccessProofTemplate - -[subgraphs](subgraphs.md).NFT721AccessProofTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFT721AccessProofTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFT721AccessProofTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721AccessProofTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721AccessProofTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721AccessProofTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFT721AccessProofTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFT721AccessProofTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFT721AccessProofTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFT721AccessProofTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721AccessProofTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721AccessProofTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721AccessProofTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessProofTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessProofTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessProofTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessProofTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721AccessProofTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessProofTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721AccessProofTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721AccessProofTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessProofTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessProofTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessProofTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessProofTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessProofTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFT721AccessSwapTemplate.md b/docs/api-reference/modules/subgraphs.NFT721AccessSwapTemplate.md deleted file mode 100644 index 7e8044d1d..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721AccessSwapTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721AccessSwapTemplate - -# Namespace: NFT721AccessSwapTemplate - -[subgraphs](subgraphs.md).NFT721AccessSwapTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFT721AccessSwapTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFT721AccessSwapTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721AccessSwapTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721AccessSwapTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721AccessSwapTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFT721AccessSwapTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFT721AccessSwapTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFT721AccessSwapTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFT721AccessSwapTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721AccessSwapTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721AccessSwapTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721AccessSwapTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessSwapTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessSwapTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessSwapTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessSwapTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721AccessSwapTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessSwapTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721AccessSwapTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721AccessSwapTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessSwapTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessSwapTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessSwapTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessSwapTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessSwapTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFT721AccessTemplate.md b/docs/api-reference/modules/subgraphs.NFT721AccessTemplate.md deleted file mode 100644 index 5006d3837..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721AccessTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721AccessTemplate - -# Namespace: NFT721AccessTemplate - -[subgraphs](subgraphs.md).NFT721AccessTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFT721AccessTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFT721AccessTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFT721AccessTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFT721AccessTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFT721AccessTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721AccessTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721AccessTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721AccessTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721AccessTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721AccessTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721AccessTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFT721AccessTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFT721AccessTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFT721AccessTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFT721AccessTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721AccessTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721AccessTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721AccessTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721AccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFT721AccessTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721AccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721AccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721AccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721AccessTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721AccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721AccessTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721AccessTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721AccessTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721AccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721AccessTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFT721EscrowPaymentCondition.md b/docs/api-reference/modules/subgraphs.NFT721EscrowPaymentCondition.md deleted file mode 100644 index 714e90a41..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721EscrowPaymentCondition.md +++ /dev/null @@ -1,685 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721EscrowPaymentCondition - -# Namespace: NFT721EscrowPaymentCondition - -[subgraphs](subgraphs.md).NFT721EscrowPaymentCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.NFT721EscrowPaymentCondition.md#initializedargs) -- [InitializedFields](subgraphs.NFT721EscrowPaymentCondition.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721EscrowPaymentCondition.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721EscrowPaymentCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult) -- [ReceivedArgs](subgraphs.NFT721EscrowPaymentCondition.md#receivedargs) -- [ReceivedFields](subgraphs.NFT721EscrowPaymentCondition.md#receivedfields) -- [ReceivedFilter](subgraphs.NFT721EscrowPaymentCondition.md#receivedfilter) -- [ReceivedResult](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult) -- [SingleQueryOptions](subgraphs.NFT721EscrowPaymentCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.NFT721EscrowPaymentCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.NFT721EscrowPaymentCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.NFT721EscrowPaymentCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721EscrowPaymentCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721EscrowPaymentCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721EscrowPaymentCondition.md#getownershiptransferreds) -- [getReceivedById](subgraphs.NFT721EscrowPaymentCondition.md#getreceivedbyid) -- [getReceiveds](subgraphs.NFT721EscrowPaymentCondition.md#getreceiveds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:87 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `_agreementId` | `true` | -| `_amounts` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `_receivers` | `true` | -| `_tokenAddress` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:78 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :-------------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amounts?` | `WeiSource` \| `null` | -| `_amounts_gt?` | `WeiSource` \| `null` | -| `_amounts_gte?` | `WeiSource` \| `null` | -| `_amounts_in?` | `WeiSource`[] | -| `_amounts_lt?` | `WeiSource` \| `null` | -| `_amounts_lte?` | `WeiSource` \| `null` | -| `_amounts_not?` | `WeiSource` \| `null` | -| `_amounts_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_receivers?` | `string` \| `null` | -| `_receivers_contains?` | `string` \| `null` | -| `_receivers_in?` | `string`[] | -| `_receivers_not?` | `string` \| `null` | -| `_receivers_not_contains?` | `string` \| `null` | -| `_receivers_not_in?` | `string`[] | -| `_tokenAddress?` | `string` \| `null` | -| `_tokenAddress_contains?` | `string` \| `null` | -| `_tokenAddress_in?` | `string`[] | -| `_tokenAddress_not?` | `string` \| `null` | -| `_tokenAddress_not_contains?` | `string` \| `null` | -| `_tokenAddress_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `_agreementId` | `string` | -| `_amounts` | `Wei` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `_receivers` | `string` | -| `_tokenAddress` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:69 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:118 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:114 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:92 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:110 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:155 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:150 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:123 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:145 - ---- - -### ReceivedArgs - -Ƭ **ReceivedArgs**<`K`\>: { [Property in keyof Pick]: ReceivedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:194 - ---- - -### ReceivedFields - -Ƭ **ReceivedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :----- | -| `_from` | `true` | -| `_value` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:189 - ---- - -### ReceivedFilter - -Ƭ **ReceivedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :-------------------- | -| `_from?` | `string` \| `null` | -| `_from_contains?` | `string` \| `null` | -| `_from_in?` | `string`[] | -| `_from_not?` | `string` \| `null` | -| `_from_not_contains?` | `string` \| `null` | -| `_from_not_in?` | `string`[] | -| `_value?` | `WeiSource` \| `null` | -| `_value_gt?` | `WeiSource` \| `null` | -| `_value_gte?` | `WeiSource` \| `null` | -| `_value_in?` | `WeiSource`[] | -| `_value_lt?` | `WeiSource` \| `null` | -| `_value_lte?` | `WeiSource` \| `null` | -| `_value_not?` | `WeiSource` \| `null` | -| `_value_not_in?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:160 - ---- - -### ReceivedResult - -Ƭ **ReceivedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :------- | -| `_from` | `string` | -| `_value` | `Wei` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:184 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:90 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721EscrowPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:91 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721EscrowPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:121 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721EscrowPaymentCondition.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721EscrowPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721EscrowPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:122 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:158 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721EscrowPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:159 - ---- - -### getReceivedById - -▸ **getReceivedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`ReceivedArgs`](subgraphs.NFT721EscrowPaymentCondition.md#receivedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:197 - ---- - -### getReceiveds - -▸ **getReceiveds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721EscrowPaymentCondition.md#multiqueryoptions)<[`ReceivedFilter`](subgraphs.NFT721EscrowPaymentCondition.md#receivedfilter), [`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult)\> | -| `args` | [`ReceivedArgs`](subgraphs.NFT721EscrowPaymentCondition.md#receivedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFT721EscrowPaymentCondition.md#receivedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721EscrowPaymentCondition.d.ts:198 diff --git a/docs/api-reference/modules/subgraphs.NFT721HolderCondition.md b/docs/api-reference/modules/subgraphs.NFT721HolderCondition.md deleted file mode 100644 index 3ba9c095d..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721HolderCondition.md +++ /dev/null @@ -1,526 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721HolderCondition - -# Namespace: NFT721HolderCondition - -[subgraphs](subgraphs.md).NFT721HolderCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.NFT721HolderCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.NFT721HolderCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.NFT721HolderCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.NFT721HolderCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.NFT721HolderCondition.md#initializedargs) -- [InitializedFields](subgraphs.NFT721HolderCondition.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721HolderCondition.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721HolderCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721HolderCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721HolderCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721HolderCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721HolderCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFT721HolderCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.NFT721HolderCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.NFT721HolderCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.NFT721HolderCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721HolderCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721HolderCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721HolderCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:79 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_address` | `true` | -| `_agreementId` | `true` | -| `_amount` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:71 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :-------------------- | -| `_address?` | `string` \| `null` | -| `_address_contains?` | `string` \| `null` | -| `_address_in?` | `string`[] | -| `_address_not?` | `string` \| `null` | -| `_address_not_contains?` | `string` \| `null` | -| `_address_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amount?` | `WeiSource` \| `null` | -| `_amount_gt?` | `WeiSource` \| `null` | -| `_amount_gte?` | `WeiSource` \| `null` | -| `_amount_in?` | `WeiSource`[] | -| `_amount_lt?` | `WeiSource` \| `null` | -| `_amount_lte?` | `WeiSource` \| `null` | -| `_amount_not?` | `WeiSource` \| `null` | -| `_amount_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_address` | `string` | -| `_agreementId` | `string` | -| `_amount` | `Wei` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:63 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:110 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:106 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:84 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:102 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:147 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:142 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:115 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:137 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721HolderCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.NFT721HolderCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:82 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721HolderCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.NFT721HolderCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.NFT721HolderCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721HolderCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:83 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721HolderCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721HolderCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:113 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721HolderCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721HolderCondition.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721HolderCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721HolderCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:114 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721HolderCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721HolderCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:150 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721HolderCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721HolderCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721HolderCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721HolderCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721HolderCondition.d.ts:151 diff --git a/docs/api-reference/modules/subgraphs.NFT721LockCondition.md b/docs/api-reference/modules/subgraphs.NFT721LockCondition.md deleted file mode 100644 index 66a0c72f9..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721LockCondition.md +++ /dev/null @@ -1,391 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721LockCondition - -# Namespace: NFT721LockCondition - -[subgraphs](subgraphs.md).NFT721LockCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.NFT721LockCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.NFT721LockCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.NFT721LockCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.NFT721LockCondition.md#fulfilledresult) -- [MultiQueryOptions](subgraphs.NFT721LockCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721LockCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721LockCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721LockCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721LockCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFT721LockCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.NFT721LockCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.NFT721LockCondition.md#getfulfilleds) -- [getOwnershipTransferredById](subgraphs.NFT721LockCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721LockCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:87 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_agreementId` | `true` | -| `_amount` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `_lockAddress` | `true` | -| `_nftContractAddress` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:78 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------------- | :-------------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amount?` | `WeiSource` \| `null` | -| `_amount_gt?` | `WeiSource` \| `null` | -| `_amount_gte?` | `WeiSource` \| `null` | -| `_amount_in?` | `WeiSource`[] | -| `_amount_lt?` | `WeiSource` \| `null` | -| `_amount_lte?` | `WeiSource` \| `null` | -| `_amount_not?` | `WeiSource` \| `null` | -| `_amount_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_lockAddress?` | `string` \| `null` | -| `_lockAddress_contains?` | `string` \| `null` | -| `_lockAddress_in?` | `string`[] | -| `_lockAddress_not?` | `string` \| `null` | -| `_lockAddress_not_contains?` | `string` \| `null` | -| `_lockAddress_not_in?` | `string`[] | -| `_nftContractAddress?` | `string` \| `null` | -| `_nftContractAddress_contains?` | `string` \| `null` | -| `_nftContractAddress_in?` | `string`[] | -| `_nftContractAddress_not?` | `string` \| `null` | -| `_nftContractAddress_not_contains?` | `string` \| `null` | -| `_nftContractAddress_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_agreementId` | `string` | -| `_amount` | `Wei` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `_lockAddress` | `string` | -| `_nftContractAddress` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:69 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:124 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:119 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:92 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:114 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721LockCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.NFT721LockCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:90 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721LockCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.NFT721LockCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.NFT721LockCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFT721LockCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:91 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721LockCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721LockCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:127 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721LockCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721LockCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721LockCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721LockCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721LockCondition.d.ts:128 diff --git a/docs/api-reference/modules/subgraphs.NFT721SalesTemplate.md b/docs/api-reference/modules/subgraphs.NFT721SalesTemplate.md deleted file mode 100644 index 1ad99e421..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721SalesTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721SalesTemplate - -# Namespace: NFT721SalesTemplate - -[subgraphs](subgraphs.md).NFT721SalesTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFT721SalesTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFT721SalesTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFT721SalesTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFT721SalesTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFT721SalesTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721SalesTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721SalesTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721SalesTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721SalesTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721SalesTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721SalesTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFT721SalesTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFT721SalesTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFT721SalesTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFT721SalesTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721SalesTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721SalesTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721SalesTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721SalesTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721SalesTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721SalesTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFT721SalesTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721SalesTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721SalesTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721SalesTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721SalesTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721SalesTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721SalesTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721SalesTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721SalesTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFT721SalesWithAccessTemplate.md b/docs/api-reference/modules/subgraphs.NFT721SalesWithAccessTemplate.md deleted file mode 100644 index 9ccdb5471..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721SalesWithAccessTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721SalesWithAccessTemplate - -# Namespace: NFT721SalesWithAccessTemplate - -[subgraphs](subgraphs.md).NFT721SalesWithAccessTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFT721SalesWithAccessTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFT721SalesWithAccessTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721SalesWithAccessTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721SalesWithAccessTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFT721SalesWithAccessTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFT721SalesWithAccessTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFT721SalesWithAccessTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFT721SalesWithAccessTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721SalesWithAccessTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721SalesWithAccessTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721SalesWithAccessTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721SalesWithAccessTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721SalesWithAccessTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721SalesWithAccessTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721SalesWithAccessTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721SalesWithAccessTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721SalesWithAccessTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721SalesWithAccessTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721SalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721SalesWithAccessTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFT721Upgradeable.md b/docs/api-reference/modules/subgraphs.NFT721Upgradeable.md deleted file mode 100644 index 9e3eccb57..000000000 --- a/docs/api-reference/modules/subgraphs.NFT721Upgradeable.md +++ /dev/null @@ -1,1450 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFT721Upgradeable - -# Namespace: NFT721Upgradeable - -[subgraphs](subgraphs.md).NFT721Upgradeable - -## Table of contents - -### Type Aliases - -- [ApprovalArgs](subgraphs.NFT721Upgradeable.md#approvalargs) -- [ApprovalFields](subgraphs.NFT721Upgradeable.md#approvalfields) -- [ApprovalFilter](subgraphs.NFT721Upgradeable.md#approvalfilter) -- [ApprovalForAllArgs](subgraphs.NFT721Upgradeable.md#approvalforallargs) -- [ApprovalForAllFields](subgraphs.NFT721Upgradeable.md#approvalforallfields) -- [ApprovalForAllFilter](subgraphs.NFT721Upgradeable.md#approvalforallfilter) -- [ApprovalForAllResult](subgraphs.NFT721Upgradeable.md#approvalforallresult) -- [ApprovalResult](subgraphs.NFT721Upgradeable.md#approvalresult) -- [InitializedArgs](subgraphs.NFT721Upgradeable.md#initializedargs) -- [InitializedFields](subgraphs.NFT721Upgradeable.md#initializedfields) -- [InitializedFilter](subgraphs.NFT721Upgradeable.md#initializedfilter) -- [InitializedResult](subgraphs.NFT721Upgradeable.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFT721Upgradeable.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFT721Upgradeable.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFT721Upgradeable.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFT721Upgradeable.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult) -- [ProxyApprovalArgs](subgraphs.NFT721Upgradeable.md#proxyapprovalargs) -- [ProxyApprovalFields](subgraphs.NFT721Upgradeable.md#proxyapprovalfields) -- [ProxyApprovalFilter](subgraphs.NFT721Upgradeable.md#proxyapprovalfilter) -- [ProxyApprovalResult](subgraphs.NFT721Upgradeable.md#proxyapprovalresult) -- [RoleAdminChangedArgs](subgraphs.NFT721Upgradeable.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.NFT721Upgradeable.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.NFT721Upgradeable.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.NFT721Upgradeable.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.NFT721Upgradeable.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.NFT721Upgradeable.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.NFT721Upgradeable.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.NFT721Upgradeable.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.NFT721Upgradeable.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.NFT721Upgradeable.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.NFT721Upgradeable.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.NFT721Upgradeable.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.NFT721Upgradeable.md#singlequeryoptions) -- [TransferArgs](subgraphs.NFT721Upgradeable.md#transferargs) -- [TransferFields](subgraphs.NFT721Upgradeable.md#transferfields) -- [TransferFilter](subgraphs.NFT721Upgradeable.md#transferfilter) -- [TransferResult](subgraphs.NFT721Upgradeable.md#transferresult) - -### Functions - -- [getApprovalById](subgraphs.NFT721Upgradeable.md#getapprovalbyid) -- [getApprovalForAllById](subgraphs.NFT721Upgradeable.md#getapprovalforallbyid) -- [getApprovalForAlls](subgraphs.NFT721Upgradeable.md#getapprovalforalls) -- [getApprovals](subgraphs.NFT721Upgradeable.md#getapprovals) -- [getInitializedById](subgraphs.NFT721Upgradeable.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFT721Upgradeable.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFT721Upgradeable.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFT721Upgradeable.md#getownershiptransferreds) -- [getProxyApprovalById](subgraphs.NFT721Upgradeable.md#getproxyapprovalbyid) -- [getProxyApprovals](subgraphs.NFT721Upgradeable.md#getproxyapprovals) -- [getRoleAdminChangedById](subgraphs.NFT721Upgradeable.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.NFT721Upgradeable.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.NFT721Upgradeable.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.NFT721Upgradeable.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.NFT721Upgradeable.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.NFT721Upgradeable.md#getrolerevokeds) -- [getTransferById](subgraphs.NFT721Upgradeable.md#gettransferbyid) -- [getTransfers](subgraphs.NFT721Upgradeable.md#gettransfers) - -## Type Aliases - -### ApprovalArgs - -Ƭ **ApprovalArgs**<`K`\>: { [Property in keyof Pick]: ApprovalFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:63 - ---- - -### ApprovalFields - -Ƭ **ApprovalFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :----- | -| `approved` | `true` | -| `id` | `true` | -| `owner` | `true` | -| `tokenId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:57 - ---- - -### ApprovalFilter - -Ƭ **ApprovalFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------- | :-------------------- | -| `approved?` | `string` \| `null` | -| `approved_contains?` | `string` \| `null` | -| `approved_in?` | `string`[] | -| `approved_not?` | `string` \| `null` | -| `approved_not_contains?` | `string` \| `null` | -| `approved_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `owner?` | `string` \| `null` | -| `owner_contains?` | `string` \| `null` | -| `owner_in?` | `string`[] | -| `owner_not?` | `string` \| `null` | -| `owner_not_contains?` | `string` \| `null` | -| `owner_not_in?` | `string`[] | -| `tokenId?` | `WeiSource` \| `null` | -| `tokenId_gt?` | `WeiSource` \| `null` | -| `tokenId_gte?` | `WeiSource` \| `null` | -| `tokenId_in?` | `WeiSource`[] | -| `tokenId_lt?` | `WeiSource` \| `null` | -| `tokenId_lte?` | `WeiSource` \| `null` | -| `tokenId_not?` | `WeiSource` \| `null` | -| `tokenId_not_in?` | `WeiSource`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:21 - ---- - -### ApprovalForAllArgs - -Ƭ **ApprovalForAllArgs**<`K`\>: { [Property in keyof Pick]: ApprovalForAllFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:106 - ---- - -### ApprovalForAllFields - -Ƭ **ApprovalForAllFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :----- | -| `approved` | `true` | -| `id` | `true` | -| `operator` | `true` | -| `owner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:100 - ---- - -### ApprovalForAllFilter - -Ƭ **ApprovalForAllFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------- | :------------------ | -| `approved?` | `boolean` \| `null` | -| `approved_in?` | `boolean`[] | -| `approved_not?` | `boolean` \| `null` | -| `approved_not_in?` | `boolean`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `operator?` | `string` \| `null` | -| `operator_contains?` | `string` \| `null` | -| `operator_in?` | `string`[] | -| `operator_not?` | `string` \| `null` | -| `operator_not_contains?` | `string` \| `null` | -| `operator_not_in?` | `string`[] | -| `owner?` | `string` \| `null` | -| `owner_contains?` | `string` \| `null` | -| `owner_in?` | `string`[] | -| `owner_not?` | `string` \| `null` | -| `owner_not_contains?` | `string` \| `null` | -| `owner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:68 - ---- - -### ApprovalForAllResult - -Ƭ **ApprovalForAllResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :-------- | -| `approved` | `boolean` | -| `id` | `string` | -| `operator` | `string` | -| `owner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:94 - ---- - -### ApprovalResult - -Ƭ **ApprovalResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :------- | -| `approved` | `string` | -| `id` | `string` | -| `owner` | `string` | -| `tokenId` | `Wei` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:51 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:137 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:133 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:111 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:129 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:174 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:169 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:142 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:164 - ---- - -### ProxyApprovalArgs - -Ƭ **ProxyApprovalArgs**<`K`\>: { [Property in keyof Pick]: ProxyApprovalFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:217 - ---- - -### ProxyApprovalFields - -Ƭ **ProxyApprovalFields**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :----- | -| `approved` | `true` | -| `id` | `true` | -| `operator` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:211 - ---- - -### ProxyApprovalFilter - -Ƭ **ProxyApprovalFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :----------------------- | :------------------ | -| `approved?` | `boolean` \| `null` | -| `approved_in?` | `boolean`[] | -| `approved_not?` | `boolean` \| `null` | -| `approved_not_in?` | `boolean`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `operator?` | `string` \| `null` | -| `operator_contains?` | `string` \| `null` | -| `operator_in?` | `string`[] | -| `operator_not?` | `string` \| `null` | -| `operator_not_contains?` | `string` \| `null` | -| `operator_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:179 - ---- - -### ProxyApprovalResult - -Ƭ **ProxyApprovalResult**: `Object` - -#### Type declaration - -| Name | Type | -| :--------- | :-------- | -| `approved` | `boolean` | -| `id` | `string` | -| `operator` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:205 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:262 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:256 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:222 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:250 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:307 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:301 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:267 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:295 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:352 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:346 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:312 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:340 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:2 - ---- - -### TransferArgs - -Ƭ **TransferArgs**<`K`\>: { [Property in keyof Pick]: TransferFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:399 - ---- - -### TransferFields - -Ƭ **TransferFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `from` | `true` | -| `id` | `true` | -| `to` | `true` | -| `tokenId` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:393 - ---- - -### TransferFilter - -Ƭ **TransferFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------- | :-------------------- | -| `from?` | `string` \| `null` | -| `from_contains?` | `string` \| `null` | -| `from_in?` | `string`[] | -| `from_not?` | `string` \| `null` | -| `from_not_contains?` | `string` \| `null` | -| `from_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `to?` | `string` \| `null` | -| `to_contains?` | `string` \| `null` | -| `to_in?` | `string`[] | -| `to_not?` | `string` \| `null` | -| `to_not_contains?` | `string` \| `null` | -| `to_not_in?` | `string`[] | -| `tokenId?` | `WeiSource` \| `null` | -| `tokenId_gt?` | `WeiSource` \| `null` | -| `tokenId_gte?` | `WeiSource` \| `null` | -| `tokenId_in?` | `WeiSource`[] | -| `tokenId_lt?` | `WeiSource` \| `null` | -| `tokenId_lte?` | `WeiSource` \| `null` | -| `tokenId_not?` | `WeiSource` \| `null` | -| `tokenId_not_in?` | `WeiSource`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:357 - ---- - -### TransferResult - -Ƭ **TransferResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `from` | `string` | -| `id` | `string` | -| `to` | `string` | -| `tokenId` | `Wei` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:387 - -## Functions - -### getApprovalById - -▸ **getApprovalById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`ApprovalArgs`](subgraphs.NFT721Upgradeable.md#approvalargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:66 - ---- - -### getApprovalForAllById - -▸ **getApprovalForAllById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`ApprovalForAllArgs`](subgraphs.NFT721Upgradeable.md#approvalforallargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:109 - ---- - -### getApprovalForAlls - -▸ **getApprovalForAlls**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`ApprovalForAllFilter`](subgraphs.NFT721Upgradeable.md#approvalforallfilter), [`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult)\> | -| `args` | [`ApprovalForAllArgs`](subgraphs.NFT721Upgradeable.md#approvalforallargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ApprovalForAllResult`](subgraphs.NFT721Upgradeable.md#approvalforallresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:110 - ---- - -### getApprovals - -▸ **getApprovals**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`ApprovalFilter`](subgraphs.NFT721Upgradeable.md#approvalfilter), [`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult)\> | -| `args` | [`ApprovalArgs`](subgraphs.NFT721Upgradeable.md#approvalargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ApprovalResult`](subgraphs.NFT721Upgradeable.md#approvalresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:67 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFT721Upgradeable.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:140 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFT721Upgradeable.md#initializedfilter), [`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFT721Upgradeable.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFT721Upgradeable.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:141 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721Upgradeable.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:177 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFT721Upgradeable.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFT721Upgradeable.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFT721Upgradeable.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:178 - ---- - -### getProxyApprovalById - -▸ **getProxyApprovalById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`ProxyApprovalArgs`](subgraphs.NFT721Upgradeable.md#proxyapprovalargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:220 - ---- - -### getProxyApprovals - -▸ **getProxyApprovals**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`ProxyApprovalFilter`](subgraphs.NFT721Upgradeable.md#proxyapprovalfilter), [`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult)\> | -| `args` | [`ProxyApprovalArgs`](subgraphs.NFT721Upgradeable.md#proxyapprovalargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ProxyApprovalResult`](subgraphs.NFT721Upgradeable.md#proxyapprovalresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:221 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.NFT721Upgradeable.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:265 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.NFT721Upgradeable.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.NFT721Upgradeable.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NFT721Upgradeable.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:266 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.NFT721Upgradeable.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:310 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.NFT721Upgradeable.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.NFT721Upgradeable.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NFT721Upgradeable.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:311 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.NFT721Upgradeable.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:355 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.NFT721Upgradeable.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.NFT721Upgradeable.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NFT721Upgradeable.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:356 - ---- - -### getTransferById - -▸ **getTransferById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFT721Upgradeable.md#singlequeryoptions) | -| `args` | [`TransferArgs`](subgraphs.NFT721Upgradeable.md#transferargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:402 - ---- - -### getTransfers - -▸ **getTransfers**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------ | -| `K` | extends keyof [`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFT721Upgradeable.md#multiqueryoptions)<[`TransferFilter`](subgraphs.NFT721Upgradeable.md#transferfilter), [`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult)\> | -| `args` | [`TransferArgs`](subgraphs.NFT721Upgradeable.md#transferargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`TransferResult`](subgraphs.NFT721Upgradeable.md#transferresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFT721Upgradeable.d.ts:403 diff --git a/docs/api-reference/modules/subgraphs.NFTAccessCondition.md b/docs/api-reference/modules/subgraphs.NFTAccessCondition.md deleted file mode 100644 index 58e09f65e..000000000 --- a/docs/api-reference/modules/subgraphs.NFTAccessCondition.md +++ /dev/null @@ -1,516 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTAccessCondition - -# Namespace: NFTAccessCondition - -[subgraphs](subgraphs.md).NFTAccessCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.NFTAccessCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.NFTAccessCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.NFTAccessCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.NFTAccessCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.NFTAccessCondition.md#initializedargs) -- [InitializedFields](subgraphs.NFTAccessCondition.md#initializedfields) -- [InitializedFilter](subgraphs.NFTAccessCondition.md#initializedfilter) -- [InitializedResult](subgraphs.NFTAccessCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTAccessCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTAccessCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTAccessCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTAccessCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTAccessCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTAccessCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.NFTAccessCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.NFTAccessCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.NFTAccessCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTAccessCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTAccessCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTAccessCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:68 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_documentId` | `true` | -| `_grantee` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:61 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_documentId?` | `string` \| `null` | -| `_documentId_contains?` | `string` \| `null` | -| `_documentId_in?` | `string`[] | -| `_documentId_not?` | `string` \| `null` | -| `_documentId_not_contains?` | `string` \| `null` | -| `_documentId_not_in?` | `string`[] | -| `_grantee?` | `string` \| `null` | -| `_grantee_contains?` | `string` \| `null` | -| `_grantee_in?` | `string`[] | -| `_grantee_not?` | `string` \| `null` | -| `_grantee_not_contains?` | `string` \| `null` | -| `_grantee_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_documentId` | `string` | -| `_grantee` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:54 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:99 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:95 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:73 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:91 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:136 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:131 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:104 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:126 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.NFTAccessCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:71 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.NFTAccessCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.NFTAccessCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTAccessCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:72 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:102 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTAccessCondition.md#initializedfilter), [`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:103 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:139 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTAccessCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessCondition.d.ts:140 diff --git a/docs/api-reference/modules/subgraphs.NFTAccessProofTemplate.md b/docs/api-reference/modules/subgraphs.NFTAccessProofTemplate.md deleted file mode 100644 index 41cde21b2..000000000 --- a/docs/api-reference/modules/subgraphs.NFTAccessProofTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTAccessProofTemplate - -# Namespace: NFTAccessProofTemplate - -[subgraphs](subgraphs.md).NFTAccessProofTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFTAccessProofTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFTAccessProofTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFTAccessProofTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFTAccessProofTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFTAccessProofTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFTAccessProofTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFTAccessProofTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTAccessProofTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTAccessProofTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFTAccessProofTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFTAccessProofTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFTAccessProofTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTAccessProofTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTAccessProofTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTAccessProofTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessProofTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessProofTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessProofTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessProofTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessProofTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessProofTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTAccessProofTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessProofTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessProofTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessProofTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessProofTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessProofTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessProofTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFTAccessSwapTemplate.md b/docs/api-reference/modules/subgraphs.NFTAccessSwapTemplate.md deleted file mode 100644 index f627eb71f..000000000 --- a/docs/api-reference/modules/subgraphs.NFTAccessSwapTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTAccessSwapTemplate - -# Namespace: NFTAccessSwapTemplate - -[subgraphs](subgraphs.md).NFTAccessSwapTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFTAccessSwapTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFTAccessSwapTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFTAccessSwapTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFTAccessSwapTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTAccessSwapTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTAccessSwapTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFTAccessSwapTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFTAccessSwapTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFTAccessSwapTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTAccessSwapTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTAccessSwapTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTAccessSwapTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessSwapTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessSwapTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessSwapTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessSwapTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessSwapTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessSwapTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTAccessSwapTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessSwapTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessSwapTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessSwapTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessSwapTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessSwapTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessSwapTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFTAccessTemplate.md b/docs/api-reference/modules/subgraphs.NFTAccessTemplate.md deleted file mode 100644 index 2d887878e..000000000 --- a/docs/api-reference/modules/subgraphs.NFTAccessTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTAccessTemplate - -# Namespace: NFTAccessTemplate - -[subgraphs](subgraphs.md).NFTAccessTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFTAccessTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFTAccessTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFTAccessTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFTAccessTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFTAccessTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFTAccessTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFTAccessTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFTAccessTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTAccessTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTAccessTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTAccessTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTAccessTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTAccessTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFTAccessTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFTAccessTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFTAccessTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTAccessTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTAccessTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTAccessTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTAccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFTAccessTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTAccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTAccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTAccessTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTAccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTAccessTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTAccessTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTAccessTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTAccessTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTAccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTAccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTAccessTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFTEscrowPaymentCondition.md b/docs/api-reference/modules/subgraphs.NFTEscrowPaymentCondition.md deleted file mode 100644 index 98728c46c..000000000 --- a/docs/api-reference/modules/subgraphs.NFTEscrowPaymentCondition.md +++ /dev/null @@ -1,685 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTEscrowPaymentCondition - -# Namespace: NFTEscrowPaymentCondition - -[subgraphs](subgraphs.md).NFTEscrowPaymentCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.NFTEscrowPaymentCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.NFTEscrowPaymentCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.NFTEscrowPaymentCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.NFTEscrowPaymentCondition.md#initializedargs) -- [InitializedFields](subgraphs.NFTEscrowPaymentCondition.md#initializedfields) -- [InitializedFilter](subgraphs.NFTEscrowPaymentCondition.md#initializedfilter) -- [InitializedResult](subgraphs.NFTEscrowPaymentCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTEscrowPaymentCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult) -- [ReceivedArgs](subgraphs.NFTEscrowPaymentCondition.md#receivedargs) -- [ReceivedFields](subgraphs.NFTEscrowPaymentCondition.md#receivedfields) -- [ReceivedFilter](subgraphs.NFTEscrowPaymentCondition.md#receivedfilter) -- [ReceivedResult](subgraphs.NFTEscrowPaymentCondition.md#receivedresult) -- [SingleQueryOptions](subgraphs.NFTEscrowPaymentCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.NFTEscrowPaymentCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.NFTEscrowPaymentCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.NFTEscrowPaymentCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTEscrowPaymentCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTEscrowPaymentCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTEscrowPaymentCondition.md#getownershiptransferreds) -- [getReceivedById](subgraphs.NFTEscrowPaymentCondition.md#getreceivedbyid) -- [getReceiveds](subgraphs.NFTEscrowPaymentCondition.md#getreceiveds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:87 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `_agreementId` | `true` | -| `_amounts` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `_receivers` | `true` | -| `_tokenAddress` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:78 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :-------------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amounts?` | `WeiSource` \| `null` | -| `_amounts_gt?` | `WeiSource` \| `null` | -| `_amounts_gte?` | `WeiSource` \| `null` | -| `_amounts_in?` | `WeiSource`[] | -| `_amounts_lt?` | `WeiSource` \| `null` | -| `_amounts_lte?` | `WeiSource` \| `null` | -| `_amounts_not?` | `WeiSource` \| `null` | -| `_amounts_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_receivers?` | `string` \| `null` | -| `_receivers_contains?` | `string` \| `null` | -| `_receivers_in?` | `string`[] | -| `_receivers_not?` | `string` \| `null` | -| `_receivers_not_contains?` | `string` \| `null` | -| `_receivers_not_in?` | `string`[] | -| `_tokenAddress?` | `string` \| `null` | -| `_tokenAddress_contains?` | `string` \| `null` | -| `_tokenAddress_in?` | `string`[] | -| `_tokenAddress_not?` | `string` \| `null` | -| `_tokenAddress_not_contains?` | `string` \| `null` | -| `_tokenAddress_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `_agreementId` | `string` | -| `_amounts` | `Wei` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `_receivers` | `string` | -| `_tokenAddress` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:69 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:118 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:114 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:92 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:110 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:155 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:150 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:123 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:145 - ---- - -### ReceivedArgs - -Ƭ **ReceivedArgs**<`K`\>: { [Property in keyof Pick]: ReceivedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:194 - ---- - -### ReceivedFields - -Ƭ **ReceivedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :----- | -| `_from` | `true` | -| `_value` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:189 - ---- - -### ReceivedFilter - -Ƭ **ReceivedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :-------------------- | -| `_from?` | `string` \| `null` | -| `_from_contains?` | `string` \| `null` | -| `_from_in?` | `string`[] | -| `_from_not?` | `string` \| `null` | -| `_from_not_contains?` | `string` \| `null` | -| `_from_not_in?` | `string`[] | -| `_value?` | `WeiSource` \| `null` | -| `_value_gt?` | `WeiSource` \| `null` | -| `_value_gte?` | `WeiSource` \| `null` | -| `_value_in?` | `WeiSource`[] | -| `_value_lt?` | `WeiSource` \| `null` | -| `_value_lte?` | `WeiSource` \| `null` | -| `_value_not?` | `WeiSource` \| `null` | -| `_value_not_in?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:160 - ---- - -### ReceivedResult - -Ƭ **ReceivedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :------- | -| `_from` | `string` | -| `_value` | `Wei` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:184 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:90 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTEscrowPaymentCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:91 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTEscrowPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:121 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTEscrowPaymentCondition.md#initializedfilter), [`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTEscrowPaymentCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTEscrowPaymentCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:122 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:158 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTEscrowPaymentCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:159 - ---- - -### getReceivedById - -▸ **getReceivedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#singlequeryoptions) | -| `args` | [`ReceivedArgs`](subgraphs.NFTEscrowPaymentCondition.md#receivedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:197 - ---- - -### getReceiveds - -▸ **getReceiveds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTEscrowPaymentCondition.md#multiqueryoptions)<[`ReceivedFilter`](subgraphs.NFTEscrowPaymentCondition.md#receivedfilter), [`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult)\> | -| `args` | [`ReceivedArgs`](subgraphs.NFTEscrowPaymentCondition.md#receivedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ReceivedResult`](subgraphs.NFTEscrowPaymentCondition.md#receivedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTEscrowPaymentCondition.d.ts:198 diff --git a/docs/api-reference/modules/subgraphs.NFTHolderCondition.md b/docs/api-reference/modules/subgraphs.NFTHolderCondition.md deleted file mode 100644 index 39301691b..000000000 --- a/docs/api-reference/modules/subgraphs.NFTHolderCondition.md +++ /dev/null @@ -1,526 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTHolderCondition - -# Namespace: NFTHolderCondition - -[subgraphs](subgraphs.md).NFTHolderCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.NFTHolderCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.NFTHolderCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.NFTHolderCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.NFTHolderCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.NFTHolderCondition.md#initializedargs) -- [InitializedFields](subgraphs.NFTHolderCondition.md#initializedfields) -- [InitializedFilter](subgraphs.NFTHolderCondition.md#initializedfilter) -- [InitializedResult](subgraphs.NFTHolderCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTHolderCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTHolderCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTHolderCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTHolderCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTHolderCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTHolderCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.NFTHolderCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.NFTHolderCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.NFTHolderCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTHolderCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTHolderCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTHolderCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:79 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_address` | `true` | -| `_agreementId` | `true` | -| `_amount` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:71 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :-------------------- | -| `_address?` | `string` \| `null` | -| `_address_contains?` | `string` \| `null` | -| `_address_in?` | `string`[] | -| `_address_not?` | `string` \| `null` | -| `_address_not_contains?` | `string` \| `null` | -| `_address_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amount?` | `WeiSource` \| `null` | -| `_amount_gt?` | `WeiSource` \| `null` | -| `_amount_gte?` | `WeiSource` \| `null` | -| `_amount_in?` | `WeiSource`[] | -| `_amount_lt?` | `WeiSource` \| `null` | -| `_amount_lte?` | `WeiSource` \| `null` | -| `_amount_not?` | `WeiSource` \| `null` | -| `_amount_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_address` | `string` | -| `_agreementId` | `string` | -| `_amount` | `Wei` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:63 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:110 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:106 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:84 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:102 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:147 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:142 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:115 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:137 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTHolderCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.NFTHolderCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:82 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTHolderCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.NFTHolderCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.NFTHolderCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTHolderCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:83 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTHolderCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTHolderCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:113 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTHolderCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTHolderCondition.md#initializedfilter), [`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTHolderCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTHolderCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:114 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTHolderCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTHolderCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:150 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTHolderCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTHolderCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTHolderCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTHolderCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTHolderCondition.d.ts:151 diff --git a/docs/api-reference/modules/subgraphs.NFTLockCondition.md b/docs/api-reference/modules/subgraphs.NFTLockCondition.md deleted file mode 100644 index 4d89bd640..000000000 --- a/docs/api-reference/modules/subgraphs.NFTLockCondition.md +++ /dev/null @@ -1,542 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTLockCondition - -# Namespace: NFTLockCondition - -[subgraphs](subgraphs.md).NFTLockCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.NFTLockCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.NFTLockCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.NFTLockCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.NFTLockCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.NFTLockCondition.md#initializedargs) -- [InitializedFields](subgraphs.NFTLockCondition.md#initializedfields) -- [InitializedFilter](subgraphs.NFTLockCondition.md#initializedfilter) -- [InitializedResult](subgraphs.NFTLockCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTLockCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTLockCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTLockCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTLockCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTLockCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTLockCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.NFTLockCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.NFTLockCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.NFTLockCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTLockCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTLockCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTLockCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:95 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :----- | -| `_agreementId` | `true` | -| `_amount` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `_lockAddress` | `true` | -| `_nftContractAddress` | `true` | -| `_receiver` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:85 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------------- | :-------------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amount?` | `WeiSource` \| `null` | -| `_amount_gt?` | `WeiSource` \| `null` | -| `_amount_gte?` | `WeiSource` \| `null` | -| `_amount_in?` | `WeiSource`[] | -| `_amount_lt?` | `WeiSource` \| `null` | -| `_amount_lte?` | `WeiSource` \| `null` | -| `_amount_not?` | `WeiSource` \| `null` | -| `_amount_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_lockAddress?` | `string` \| `null` | -| `_lockAddress_contains?` | `string` \| `null` | -| `_lockAddress_in?` | `string`[] | -| `_lockAddress_not?` | `string` \| `null` | -| `_lockAddress_not_contains?` | `string` \| `null` | -| `_lockAddress_not_in?` | `string`[] | -| `_nftContractAddress?` | `string` \| `null` | -| `_nftContractAddress_contains?` | `string` \| `null` | -| `_nftContractAddress_in?` | `string`[] | -| `_nftContractAddress_not?` | `string` \| `null` | -| `_nftContractAddress_not_contains?` | `string` \| `null` | -| `_nftContractAddress_not_in?` | `string`[] | -| `_receiver?` | `string` \| `null` | -| `_receiver_contains?` | `string` \| `null` | -| `_receiver_in?` | `string`[] | -| `_receiver_not?` | `string` \| `null` | -| `_receiver_not_contains?` | `string` \| `null` | -| `_receiver_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------- | -| `_agreementId` | `string` | -| `_amount` | `Wei` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `_lockAddress` | `string` | -| `_nftContractAddress` | `string` | -| `_receiver` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:75 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:126 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:122 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:100 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:118 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:163 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:158 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:131 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:153 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTLockCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.NFTLockCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:98 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTLockCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.NFTLockCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.NFTLockCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.NFTLockCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:99 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTLockCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTLockCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:129 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTLockCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTLockCondition.md#initializedfilter), [`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTLockCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTLockCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:130 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTLockCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTLockCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:166 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTLockCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTLockCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTLockCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTLockCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTLockCondition.d.ts:167 diff --git a/docs/api-reference/modules/subgraphs.NFTSalesTemplate.md b/docs/api-reference/modules/subgraphs.NFTSalesTemplate.md deleted file mode 100644 index 25985f5c6..000000000 --- a/docs/api-reference/modules/subgraphs.NFTSalesTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTSalesTemplate - -# Namespace: NFTSalesTemplate - -[subgraphs](subgraphs.md).NFTSalesTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFTSalesTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFTSalesTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFTSalesTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFTSalesTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFTSalesTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFTSalesTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFTSalesTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFTSalesTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTSalesTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTSalesTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTSalesTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTSalesTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTSalesTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFTSalesTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFTSalesTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFTSalesTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTSalesTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTSalesTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTSalesTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTSalesTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTSalesTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTSalesTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFTSalesTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTSalesTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTSalesTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTSalesTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTSalesTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTSalesTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTSalesTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTSalesTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTSalesTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTSalesTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTSalesTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTSalesTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NFTSalesWithAccessTemplate.md b/docs/api-reference/modules/subgraphs.NFTSalesWithAccessTemplate.md deleted file mode 100644 index 5c72e69f8..000000000 --- a/docs/api-reference/modules/subgraphs.NFTSalesWithAccessTemplate.md +++ /dev/null @@ -1,564 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NFTSalesWithAccessTemplate - -# Namespace: NFTSalesWithAccessTemplate - -[subgraphs](subgraphs.md).NFTSalesWithAccessTemplate - -## Table of contents - -### Type Aliases - -- [AgreementCreatedArgs](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedargs) -- [AgreementCreatedFields](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedfields) -- [AgreementCreatedFilter](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedfilter) -- [AgreementCreatedResult](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult) -- [InitializedArgs](subgraphs.NFTSalesWithAccessTemplate.md#initializedargs) -- [InitializedFields](subgraphs.NFTSalesWithAccessTemplate.md#initializedfields) -- [InitializedFilter](subgraphs.NFTSalesWithAccessTemplate.md#initializedfilter) -- [InitializedResult](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult) -- [MultiQueryOptions](subgraphs.NFTSalesWithAccessTemplate.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.NFTSalesWithAccessTemplate.md#singlequeryoptions) - -### Functions - -- [getAgreementCreatedById](subgraphs.NFTSalesWithAccessTemplate.md#getagreementcreatedbyid) -- [getAgreementCreateds](subgraphs.NFTSalesWithAccessTemplate.md#getagreementcreateds) -- [getInitializedById](subgraphs.NFTSalesWithAccessTemplate.md#getinitializedbyid) -- [getInitializeds](subgraphs.NFTSalesWithAccessTemplate.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NFTSalesWithAccessTemplate.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NFTSalesWithAccessTemplate.md#getownershiptransferreds) - -## Type Aliases - -### AgreementCreatedArgs - -Ƭ **AgreementCreatedArgs**<`K`\>: { [Property in keyof Pick]: AgreementCreatedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:117 - ---- - -### AgreementCreatedFields - -Ƭ **AgreementCreatedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `_accessConsumer` | `true` | -| `_accessProvider` | `true` | -| `_agreementId` | `true` | -| `_conditionIdSeeds` | `true` | -| `_conditionIds` | `true` | -| `_creator` | `true` | -| `_did` | `true` | -| `_idSeed` | `true` | -| `_timeLocks` | `true` | -| `_timeOuts` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:104 - ---- - -### AgreementCreatedFilter - -Ƭ **AgreementCreatedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------------------- | :----------------- | -| `_accessConsumer?` | `string` \| `null` | -| `_accessConsumer_contains?` | `string` \| `null` | -| `_accessConsumer_in?` | `string`[] | -| `_accessConsumer_not?` | `string` \| `null` | -| `_accessConsumer_not_contains?` | `string` \| `null` | -| `_accessConsumer_not_in?` | `string`[] | -| `_accessProvider?` | `string` \| `null` | -| `_accessProvider_contains?` | `string` \| `null` | -| `_accessProvider_in?` | `string`[] | -| `_accessProvider_not?` | `string` \| `null` | -| `_accessProvider_not_contains?` | `string` \| `null` | -| `_accessProvider_not_in?` | `string`[] | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionIdSeeds?` | `string`[] | -| `_conditionIdSeeds_contains?` | `string`[] | -| `_conditionIdSeeds_contains_nocase?` | `string`[] | -| `_conditionIdSeeds_not?` | `string`[] | -| `_conditionIdSeeds_not_contains?` | `string`[] | -| `_conditionIdSeeds_not_contains_nocase?` | `string`[] | -| `_conditionIds?` | `string`[] | -| `_conditionIds_contains?` | `string`[] | -| `_conditionIds_contains_nocase?` | `string`[] | -| `_conditionIds_not?` | `string`[] | -| `_conditionIds_not_contains?` | `string`[] | -| `_conditionIds_not_contains_nocase?` | `string`[] | -| `_creator?` | `string` \| `null` | -| `_creator_contains?` | `string` \| `null` | -| `_creator_in?` | `string`[] | -| `_creator_not?` | `string` \| `null` | -| `_creator_not_contains?` | `string` \| `null` | -| `_creator_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_idSeed?` | `string` \| `null` | -| `_idSeed_contains?` | `string` \| `null` | -| `_idSeed_in?` | `string`[] | -| `_idSeed_not?` | `string` \| `null` | -| `_idSeed_not_contains?` | `string` \| `null` | -| `_idSeed_not_in?` | `string`[] | -| `_timeLocks?` | `WeiSource`[] | -| `_timeLocks_contains?` | `WeiSource`[] | -| `_timeLocks_contains_nocase?` | `WeiSource`[] | -| `_timeLocks_not?` | `WeiSource`[] | -| `_timeLocks_not_contains?` | `WeiSource`[] | -| `_timeLocks_not_contains_nocase?` | `WeiSource`[] | -| `_timeOuts?` | `WeiSource`[] | -| `_timeOuts_contains?` | `WeiSource`[] | -| `_timeOuts_contains_nocase?` | `WeiSource`[] | -| `_timeOuts_not?` | `WeiSource`[] | -| `_timeOuts_not_contains?` | `WeiSource`[] | -| `_timeOuts_not_contains_nocase?` | `WeiSource`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:21 - ---- - -### AgreementCreatedResult - -Ƭ **AgreementCreatedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :--------------------- | -| `_accessConsumer` | `string` | -| `_accessProvider` | `string` | -| `_agreementId` | `string` | -| `_conditionIdSeeds` | (`string` \| `null`)[] | -| `_conditionIds` | (`string` \| `null`)[] | -| `_creator` | `string` | -| `_did` | `string` | -| `_idSeed` | `string` | -| `_timeLocks` | (`Wei` \| `null`)[] | -| `_timeOuts` | (`Wei` \| `null`)[] | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:91 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:148 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:144 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:122 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:140 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:185 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:180 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:153 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:175 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:2 - -## Functions - -### getAgreementCreatedById - -▸ **getAgreementCreatedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTSalesWithAccessTemplate.md#singlequeryoptions) | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:120 - ---- - -### getAgreementCreateds - -▸ **getAgreementCreateds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTSalesWithAccessTemplate.md#multiqueryoptions)<[`AgreementCreatedFilter`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedfilter), [`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult)\> | -| `args` | [`AgreementCreatedArgs`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`AgreementCreatedResult`](subgraphs.NFTSalesWithAccessTemplate.md#agreementcreatedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:121 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTSalesWithAccessTemplate.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NFTSalesWithAccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:151 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTSalesWithAccessTemplate.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NFTSalesWithAccessTemplate.md#initializedfilter), [`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NFTSalesWithAccessTemplate.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NFTSalesWithAccessTemplate.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:152 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NFTSalesWithAccessTemplate.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:188 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NFTSalesWithAccessTemplate.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NFTSalesWithAccessTemplate.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NFTSalesWithAccessTemplate.d.ts:189 diff --git a/docs/api-reference/modules/subgraphs.NeverminedConfig.md b/docs/api-reference/modules/subgraphs.NeverminedConfig.md deleted file mode 100644 index ca88b0ead..000000000 --- a/docs/api-reference/modules/subgraphs.NeverminedConfig.md +++ /dev/null @@ -1,971 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NeverminedConfig - -# Namespace: NeverminedConfig - -[subgraphs](subgraphs.md).NeverminedConfig - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.NeverminedConfig.md#initializedargs) -- [InitializedFields](subgraphs.NeverminedConfig.md#initializedfields) -- [InitializedFilter](subgraphs.NeverminedConfig.md#initializedfilter) -- [InitializedResult](subgraphs.NeverminedConfig.md#initializedresult) -- [MultiQueryOptions](subgraphs.NeverminedConfig.md#multiqueryoptions) -- [NeverminedConfigChangeArgs](subgraphs.NeverminedConfig.md#neverminedconfigchangeargs) -- [NeverminedConfigChangeFields](subgraphs.NeverminedConfig.md#neverminedconfigchangefields) -- [NeverminedConfigChangeFilter](subgraphs.NeverminedConfig.md#neverminedconfigchangefilter) -- [NeverminedConfigChangeResult](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult) -- [OwnershipTransferredArgs](subgraphs.NeverminedConfig.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NeverminedConfig.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NeverminedConfig.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NeverminedConfig.md#ownershiptransferredresult) -- [RoleAdminChangedArgs](subgraphs.NeverminedConfig.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.NeverminedConfig.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.NeverminedConfig.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.NeverminedConfig.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.NeverminedConfig.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.NeverminedConfig.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.NeverminedConfig.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.NeverminedConfig.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.NeverminedConfig.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.NeverminedConfig.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.NeverminedConfig.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.NeverminedConfig.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.NeverminedConfig.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.NeverminedConfig.md#getinitializedbyid) -- [getInitializeds](subgraphs.NeverminedConfig.md#getinitializeds) -- [getNeverminedConfigChangeById](subgraphs.NeverminedConfig.md#getneverminedconfigchangebyid) -- [getNeverminedConfigChanges](subgraphs.NeverminedConfig.md#getneverminedconfigchanges) -- [getOwnershipTransferredById](subgraphs.NeverminedConfig.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NeverminedConfig.md#getownershiptransferreds) -- [getRoleAdminChangedById](subgraphs.NeverminedConfig.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.NeverminedConfig.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.NeverminedConfig.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.NeverminedConfig.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.NeverminedConfig.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.NeverminedConfig.md#getrolerevokeds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:9 - ---- - -### NeverminedConfigChangeArgs - -Ƭ **NeverminedConfigChangeArgs**<`K`\>: { [Property in keyof Pick]: NeverminedConfigChangeFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:83 - ---- - -### NeverminedConfigChangeFields - -Ƭ **NeverminedConfigChangeFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :----- | -| `_parameter` | `true` | -| `_whoChanged` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:78 - ---- - -### NeverminedConfigChangeFilter - -Ƭ **NeverminedConfigChangeFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------- | :----------------- | -| `_parameter?` | `string` \| `null` | -| `_parameter_contains?` | `string` \| `null` | -| `_parameter_in?` | `string`[] | -| `_parameter_not?` | `string` \| `null` | -| `_parameter_not_contains?` | `string` \| `null` | -| `_parameter_not_in?` | `string`[] | -| `_whoChanged?` | `string` \| `null` | -| `_whoChanged_contains?` | `string` \| `null` | -| `_whoChanged_in?` | `string`[] | -| `_whoChanged_not?` | `string` \| `null` | -| `_whoChanged_not_contains?` | `string` \| `null` | -| `_whoChanged_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:51 - ---- - -### NeverminedConfigChangeResult - -Ƭ **NeverminedConfigChangeResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :------- | -| `_parameter` | `string` | -| `_whoChanged` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:73 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:120 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:115 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:88 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:110 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:165 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:159 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:125 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:153 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:210 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:204 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:170 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:198 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:255 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:249 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:215 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:243 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedConfig.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NeverminedConfig.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedConfig.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NeverminedConfig.md#initializedfilter), [`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NeverminedConfig.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedConfig.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:50 - ---- - -### getNeverminedConfigChangeById - -▸ **getNeverminedConfigChangeById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedConfig.md#singlequeryoptions) | -| `args` | [`NeverminedConfigChangeArgs`](subgraphs.NeverminedConfig.md#neverminedconfigchangeargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:86 - ---- - -### getNeverminedConfigChanges - -▸ **getNeverminedConfigChanges**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedConfig.md#multiqueryoptions)<[`NeverminedConfigChangeFilter`](subgraphs.NeverminedConfig.md#neverminedconfigchangefilter), [`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult)\> | -| `args` | [`NeverminedConfigChangeArgs`](subgraphs.NeverminedConfig.md#neverminedconfigchangeargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`NeverminedConfigChangeResult`](subgraphs.NeverminedConfig.md#neverminedconfigchangeresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:87 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedConfig.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NeverminedConfig.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:123 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedConfig.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NeverminedConfig.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NeverminedConfig.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedConfig.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:124 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedConfig.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.NeverminedConfig.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:168 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedConfig.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.NeverminedConfig.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.NeverminedConfig.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedConfig.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:169 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedConfig.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.NeverminedConfig.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:213 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedConfig.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.NeverminedConfig.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.NeverminedConfig.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedConfig.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:214 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedConfig.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.NeverminedConfig.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:258 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedConfig.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.NeverminedConfig.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.NeverminedConfig.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedConfig.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedConfig.d.ts:259 diff --git a/docs/api-reference/modules/subgraphs.NeverminedToken.md b/docs/api-reference/modules/subgraphs.NeverminedToken.md deleted file mode 100644 index 55e43dc9c..000000000 --- a/docs/api-reference/modules/subgraphs.NeverminedToken.md +++ /dev/null @@ -1,1140 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / NeverminedToken - -# Namespace: NeverminedToken - -[subgraphs](subgraphs.md).NeverminedToken - -## Table of contents - -### Type Aliases - -- [ApprovalArgs](subgraphs.NeverminedToken.md#approvalargs) -- [ApprovalFields](subgraphs.NeverminedToken.md#approvalfields) -- [ApprovalFilter](subgraphs.NeverminedToken.md#approvalfilter) -- [ApprovalResult](subgraphs.NeverminedToken.md#approvalresult) -- [InitializedArgs](subgraphs.NeverminedToken.md#initializedargs) -- [InitializedFields](subgraphs.NeverminedToken.md#initializedfields) -- [InitializedFilter](subgraphs.NeverminedToken.md#initializedfilter) -- [InitializedResult](subgraphs.NeverminedToken.md#initializedresult) -- [MultiQueryOptions](subgraphs.NeverminedToken.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.NeverminedToken.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.NeverminedToken.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.NeverminedToken.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.NeverminedToken.md#ownershiptransferredresult) -- [RoleAdminChangedArgs](subgraphs.NeverminedToken.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.NeverminedToken.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.NeverminedToken.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.NeverminedToken.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.NeverminedToken.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.NeverminedToken.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.NeverminedToken.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.NeverminedToken.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.NeverminedToken.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.NeverminedToken.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.NeverminedToken.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.NeverminedToken.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.NeverminedToken.md#singlequeryoptions) -- [TransferArgs](subgraphs.NeverminedToken.md#transferargs) -- [TransferFields](subgraphs.NeverminedToken.md#transferfields) -- [TransferFilter](subgraphs.NeverminedToken.md#transferfilter) -- [TransferResult](subgraphs.NeverminedToken.md#transferresult) - -### Functions - -- [getApprovalById](subgraphs.NeverminedToken.md#getapprovalbyid) -- [getApprovals](subgraphs.NeverminedToken.md#getapprovals) -- [getInitializedById](subgraphs.NeverminedToken.md#getinitializedbyid) -- [getInitializeds](subgraphs.NeverminedToken.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.NeverminedToken.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.NeverminedToken.md#getownershiptransferreds) -- [getRoleAdminChangedById](subgraphs.NeverminedToken.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.NeverminedToken.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.NeverminedToken.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.NeverminedToken.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.NeverminedToken.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.NeverminedToken.md#getrolerevokeds) -- [getTransferById](subgraphs.NeverminedToken.md#gettransferbyid) -- [getTransfers](subgraphs.NeverminedToken.md#gettransfers) - -## Type Aliases - -### ApprovalArgs - -Ƭ **ApprovalArgs**<`K`\>: { [Property in keyof Pick]: ApprovalFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:63 - ---- - -### ApprovalFields - -Ƭ **ApprovalFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `owner` | `true` | -| `spender` | `true` | -| `value` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:57 - ---- - -### ApprovalFilter - -Ƭ **ApprovalFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :-------------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `owner?` | `string` \| `null` | -| `owner_contains?` | `string` \| `null` | -| `owner_in?` | `string`[] | -| `owner_not?` | `string` \| `null` | -| `owner_not_contains?` | `string` \| `null` | -| `owner_not_in?` | `string`[] | -| `spender?` | `string` \| `null` | -| `spender_contains?` | `string` \| `null` | -| `spender_in?` | `string`[] | -| `spender_not?` | `string` \| `null` | -| `spender_not_contains?` | `string` \| `null` | -| `spender_not_in?` | `string`[] | -| `value?` | `WeiSource` \| `null` | -| `value_gt?` | `WeiSource` \| `null` | -| `value_gte?` | `WeiSource` \| `null` | -| `value_in?` | `WeiSource`[] | -| `value_lt?` | `WeiSource` \| `null` | -| `value_lte?` | `WeiSource` \| `null` | -| `value_not?` | `WeiSource` \| `null` | -| `value_not_in?` | `WeiSource`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:21 - ---- - -### ApprovalResult - -Ƭ **ApprovalResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `owner` | `string` | -| `spender` | `string` | -| `value` | `Wei` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:51 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:94 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:90 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:68 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:86 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:131 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:126 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:99 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:121 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:176 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:170 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:136 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:164 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:221 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:215 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:181 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:209 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:266 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:260 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:226 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:254 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:2 - ---- - -### TransferArgs - -Ƭ **TransferArgs**<`K`\>: { [Property in keyof Pick]: TransferFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`TransferResult`](subgraphs.NeverminedToken.md#transferresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:313 - ---- - -### TransferFields - -Ƭ **TransferFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :----- | -| `from` | `true` | -| `id` | `true` | -| `to` | `true` | -| `value` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:307 - ---- - -### TransferFilter - -Ƭ **TransferFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------- | :-------------------- | -| `from?` | `string` \| `null` | -| `from_contains?` | `string` \| `null` | -| `from_in?` | `string`[] | -| `from_not?` | `string` \| `null` | -| `from_not_contains?` | `string` \| `null` | -| `from_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `to?` | `string` \| `null` | -| `to_contains?` | `string` \| `null` | -| `to_in?` | `string`[] | -| `to_not?` | `string` \| `null` | -| `to_not_contains?` | `string` \| `null` | -| `to_not_in?` | `string`[] | -| `value?` | `WeiSource` \| `null` | -| `value_gt?` | `WeiSource` \| `null` | -| `value_gte?` | `WeiSource` \| `null` | -| `value_in?` | `WeiSource`[] | -| `value_lt?` | `WeiSource` \| `null` | -| `value_lte?` | `WeiSource` \| `null` | -| `value_not?` | `WeiSource` \| `null` | -| `value_not_in?` | `WeiSource`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:271 - ---- - -### TransferResult - -Ƭ **TransferResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------- | -| `from` | `string` | -| `id` | `string` | -| `to` | `string` | -| `value` | `Wei` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:301 - -## Functions - -### getApprovalById - -▸ **getApprovalById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedToken.md#singlequeryoptions) | -| `args` | [`ApprovalArgs`](subgraphs.NeverminedToken.md#approvalargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:66 - ---- - -### getApprovals - -▸ **getApprovals**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedToken.md#multiqueryoptions)<[`ApprovalFilter`](subgraphs.NeverminedToken.md#approvalfilter), [`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult)\> | -| `args` | [`ApprovalArgs`](subgraphs.NeverminedToken.md#approvalargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`ApprovalResult`](subgraphs.NeverminedToken.md#approvalresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:67 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedToken.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.NeverminedToken.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:97 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedToken.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.NeverminedToken.md#initializedfilter), [`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.NeverminedToken.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.NeverminedToken.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:98 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedToken.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NeverminedToken.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:134 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedToken.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.NeverminedToken.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.NeverminedToken.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.NeverminedToken.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:135 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedToken.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.NeverminedToken.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:179 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedToken.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.NeverminedToken.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.NeverminedToken.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.NeverminedToken.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:180 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedToken.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.NeverminedToken.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:224 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedToken.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.NeverminedToken.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.NeverminedToken.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.NeverminedToken.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:225 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedToken.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.NeverminedToken.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:269 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedToken.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.NeverminedToken.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.NeverminedToken.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.NeverminedToken.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:270 - ---- - -### getTransferById - -▸ **getTransferById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`TransferResult`](subgraphs.NeverminedToken.md#transferresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`TransferResult`](subgraphs.NeverminedToken.md#transferresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.NeverminedToken.md#singlequeryoptions) | -| `args` | [`TransferArgs`](subgraphs.NeverminedToken.md#transferargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`TransferResult`](subgraphs.NeverminedToken.md#transferresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:316 - ---- - -### getTransfers - -▸ **getTransfers**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`TransferResult`](subgraphs.NeverminedToken.md#transferresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------- | -| `K` | extends keyof [`TransferResult`](subgraphs.NeverminedToken.md#transferresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.NeverminedToken.md#multiqueryoptions)<[`TransferFilter`](subgraphs.NeverminedToken.md#transferfilter), [`TransferResult`](subgraphs.NeverminedToken.md#transferresult)\> | -| `args` | [`TransferArgs`](subgraphs.NeverminedToken.md#transferargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`TransferResult`](subgraphs.NeverminedToken.md#transferresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/NeverminedToken.d.ts:317 diff --git a/docs/api-reference/modules/subgraphs.RewardsDistributor.md b/docs/api-reference/modules/subgraphs.RewardsDistributor.md deleted file mode 100644 index c55f5bf6c..000000000 --- a/docs/api-reference/modules/subgraphs.RewardsDistributor.md +++ /dev/null @@ -1,202 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / RewardsDistributor - -# Namespace: RewardsDistributor - -[subgraphs](subgraphs.md).RewardsDistributor - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.RewardsDistributor.md#initializedargs) -- [InitializedFields](subgraphs.RewardsDistributor.md#initializedfields) -- [InitializedFilter](subgraphs.RewardsDistributor.md#initializedfilter) -- [InitializedResult](subgraphs.RewardsDistributor.md#initializedresult) -- [MultiQueryOptions](subgraphs.RewardsDistributor.md#multiqueryoptions) -- [SingleQueryOptions](subgraphs.RewardsDistributor.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.RewardsDistributor.md#getinitializedbyid) -- [getInitializeds](subgraphs.RewardsDistributor.md#getinitializeds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:9 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.RewardsDistributor.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.RewardsDistributor.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.RewardsDistributor.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.RewardsDistributor.md#initializedfilter), [`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.RewardsDistributor.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.RewardsDistributor.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/RewardsDistributor.d.ts:50 diff --git a/docs/api-reference/modules/subgraphs.SignCondition.md b/docs/api-reference/modules/subgraphs.SignCondition.md deleted file mode 100644 index a7185f88d..000000000 --- a/docs/api-reference/modules/subgraphs.SignCondition.md +++ /dev/null @@ -1,351 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / SignCondition - -# Namespace: SignCondition - -[subgraphs](subgraphs.md).SignCondition - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.SignCondition.md#initializedargs) -- [InitializedFields](subgraphs.SignCondition.md#initializedfields) -- [InitializedFilter](subgraphs.SignCondition.md#initializedfilter) -- [InitializedResult](subgraphs.SignCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.SignCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.SignCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.SignCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.SignCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.SignCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.SignCondition.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.SignCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.SignCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.SignCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.SignCondition.md#getownershiptransferreds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.SignCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:83 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:78 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:51 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:73 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.SignCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.SignCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.SignCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.SignCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.SignCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.SignCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.SignCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.SignCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.SignCondition.md#initializedfilter), [`InitializedResult`](subgraphs.SignCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.SignCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.SignCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:50 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.SignCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.SignCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:86 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.SignCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.SignCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.SignCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.SignCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/SignCondition.d.ts:87 diff --git a/docs/api-reference/modules/subgraphs.StandardRoyalties.md b/docs/api-reference/modules/subgraphs.StandardRoyalties.md deleted file mode 100644 index abd370790..000000000 --- a/docs/api-reference/modules/subgraphs.StandardRoyalties.md +++ /dev/null @@ -1,202 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / StandardRoyalties - -# Namespace: StandardRoyalties - -[subgraphs](subgraphs.md).StandardRoyalties - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.StandardRoyalties.md#initializedargs) -- [InitializedFields](subgraphs.StandardRoyalties.md#initializedfields) -- [InitializedFilter](subgraphs.StandardRoyalties.md#initializedfilter) -- [InitializedResult](subgraphs.StandardRoyalties.md#initializedresult) -- [MultiQueryOptions](subgraphs.StandardRoyalties.md#multiqueryoptions) -- [SingleQueryOptions](subgraphs.StandardRoyalties.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.StandardRoyalties.md#getinitializedbyid) -- [getInitializeds](subgraphs.StandardRoyalties.md#getinitializeds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:9 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.StandardRoyalties.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.StandardRoyalties.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.StandardRoyalties.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.StandardRoyalties.md#initializedfilter), [`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.StandardRoyalties.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.StandardRoyalties.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/StandardRoyalties.d.ts:50 diff --git a/docs/api-reference/modules/subgraphs.TemplateStoreManager.md b/docs/api-reference/modules/subgraphs.TemplateStoreManager.md deleted file mode 100644 index 3df6b5f54..000000000 --- a/docs/api-reference/modules/subgraphs.TemplateStoreManager.md +++ /dev/null @@ -1,351 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / TemplateStoreManager - -# Namespace: TemplateStoreManager - -[subgraphs](subgraphs.md).TemplateStoreManager - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.TemplateStoreManager.md#initializedargs) -- [InitializedFields](subgraphs.TemplateStoreManager.md#initializedfields) -- [InitializedFilter](subgraphs.TemplateStoreManager.md#initializedfilter) -- [InitializedResult](subgraphs.TemplateStoreManager.md#initializedresult) -- [MultiQueryOptions](subgraphs.TemplateStoreManager.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.TemplateStoreManager.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.TemplateStoreManager.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.TemplateStoreManager.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.TemplateStoreManager.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.TemplateStoreManager.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.TemplateStoreManager.md#getinitializedbyid) -- [getInitializeds](subgraphs.TemplateStoreManager.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.TemplateStoreManager.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.TemplateStoreManager.md#getownershiptransferreds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:83 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:78 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:51 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:73 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TemplateStoreManager.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.TemplateStoreManager.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TemplateStoreManager.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.TemplateStoreManager.md#initializedfilter), [`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.TemplateStoreManager.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TemplateStoreManager.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:50 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TemplateStoreManager.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TemplateStoreManager.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:86 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TemplateStoreManager.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.TemplateStoreManager.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TemplateStoreManager.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TemplateStoreManager.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TemplateStoreManager.d.ts:87 diff --git a/docs/api-reference/modules/subgraphs.ThresholdCondition.md b/docs/api-reference/modules/subgraphs.ThresholdCondition.md deleted file mode 100644 index 5dd52c38a..000000000 --- a/docs/api-reference/modules/subgraphs.ThresholdCondition.md +++ /dev/null @@ -1,351 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / ThresholdCondition - -# Namespace: ThresholdCondition - -[subgraphs](subgraphs.md).ThresholdCondition - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.ThresholdCondition.md#initializedargs) -- [InitializedFields](subgraphs.ThresholdCondition.md#initializedfields) -- [InitializedFilter](subgraphs.ThresholdCondition.md#initializedfilter) -- [InitializedResult](subgraphs.ThresholdCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.ThresholdCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.ThresholdCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.ThresholdCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.ThresholdCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.ThresholdCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.ThresholdCondition.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.ThresholdCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.ThresholdCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.ThresholdCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.ThresholdCondition.md#getownershiptransferreds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:83 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:78 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:51 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:73 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ThresholdCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.ThresholdCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ThresholdCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.ThresholdCondition.md#initializedfilter), [`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.ThresholdCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.ThresholdCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:50 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.ThresholdCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.ThresholdCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:86 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.ThresholdCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.ThresholdCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.ThresholdCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.ThresholdCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/ThresholdCondition.d.ts:87 diff --git a/docs/api-reference/modules/subgraphs.TransferDIDOwnershipCondition.md b/docs/api-reference/modules/subgraphs.TransferDIDOwnershipCondition.md deleted file mode 100644 index 9293dd7b5..000000000 --- a/docs/api-reference/modules/subgraphs.TransferDIDOwnershipCondition.md +++ /dev/null @@ -1,516 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / TransferDIDOwnershipCondition - -# Namespace: TransferDIDOwnershipCondition - -[subgraphs](subgraphs.md).TransferDIDOwnershipCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.TransferDIDOwnershipCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.TransferDIDOwnershipCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.TransferDIDOwnershipCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.TransferDIDOwnershipCondition.md#initializedargs) -- [InitializedFields](subgraphs.TransferDIDOwnershipCondition.md#initializedfields) -- [InitializedFilter](subgraphs.TransferDIDOwnershipCondition.md#initializedfilter) -- [InitializedResult](subgraphs.TransferDIDOwnershipCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.TransferDIDOwnershipCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.TransferDIDOwnershipCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.TransferDIDOwnershipCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.TransferDIDOwnershipCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.TransferDIDOwnershipCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.TransferDIDOwnershipCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.TransferDIDOwnershipCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.TransferDIDOwnershipCondition.md#getownershiptransferreds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:68 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_conditionId` | `true` | -| `_did` | `true` | -| `_receiver` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:61 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :----------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_receiver?` | `string` \| `null` | -| `_receiver_contains?` | `string` \| `null` | -| `_receiver_in?` | `string`[] | -| `_receiver_not?` | `string` \| `null` | -| `_receiver_not_contains?` | `string` \| `null` | -| `_receiver_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:20 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_conditionId` | `string` | -| `_did` | `string` | -| `_receiver` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:54 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:99 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:95 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:73 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:91 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:136 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:131 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:104 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:126 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:1 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferDIDOwnershipCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:71 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferDIDOwnershipCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferDIDOwnershipCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:72 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferDIDOwnershipCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.TransferDIDOwnershipCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:102 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferDIDOwnershipCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.TransferDIDOwnershipCondition.md#initializedfilter), [`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.TransferDIDOwnershipCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferDIDOwnershipCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:103 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferDIDOwnershipCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:139 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferDIDOwnershipCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferDIDOwnershipCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferDIDOwnershipCondition.d.ts:140 diff --git a/docs/api-reference/modules/subgraphs.TransferNFT721Condition.md b/docs/api-reference/modules/subgraphs.TransferNFT721Condition.md deleted file mode 100644 index a0522af5a..000000000 --- a/docs/api-reference/modules/subgraphs.TransferNFT721Condition.md +++ /dev/null @@ -1,1005 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / TransferNFT721Condition - -# Namespace: TransferNFT721Condition - -[subgraphs](subgraphs.md).TransferNFT721Condition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.TransferNFT721Condition.md#fulfilledargs) -- [FulfilledFields](subgraphs.TransferNFT721Condition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.TransferNFT721Condition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.TransferNFT721Condition.md#fulfilledresult) -- [InitializedArgs](subgraphs.TransferNFT721Condition.md#initializedargs) -- [InitializedFields](subgraphs.TransferNFT721Condition.md#initializedfields) -- [InitializedFilter](subgraphs.TransferNFT721Condition.md#initializedfilter) -- [InitializedResult](subgraphs.TransferNFT721Condition.md#initializedresult) -- [MultiQueryOptions](subgraphs.TransferNFT721Condition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.TransferNFT721Condition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.TransferNFT721Condition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.TransferNFT721Condition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult) -- [RoleAdminChangedArgs](subgraphs.TransferNFT721Condition.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.TransferNFT721Condition.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.TransferNFT721Condition.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.TransferNFT721Condition.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.TransferNFT721Condition.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.TransferNFT721Condition.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.TransferNFT721Condition.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.TransferNFT721Condition.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.TransferNFT721Condition.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.TransferNFT721Condition.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.TransferNFT721Condition.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.TransferNFT721Condition.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.TransferNFT721Condition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.TransferNFT721Condition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.TransferNFT721Condition.md#getfulfilleds) -- [getInitializedById](subgraphs.TransferNFT721Condition.md#getinitializedbyid) -- [getInitializeds](subgraphs.TransferNFT721Condition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.TransferNFT721Condition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.TransferNFT721Condition.md#getownershiptransferreds) -- [getRoleAdminChangedById](subgraphs.TransferNFT721Condition.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.TransferNFT721Condition.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.TransferNFT721Condition.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.TransferNFT721Condition.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.TransferNFT721Condition.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.TransferNFT721Condition.md#getrolerevokeds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:87 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_amount` | `true` | -| `_conditionId` | `true` | -| `_contract` | `true` | -| `_did` | `true` | -| `_receiver` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:78 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :-------------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amount?` | `WeiSource` \| `null` | -| `_amount_gt?` | `WeiSource` \| `null` | -| `_amount_gte?` | `WeiSource` \| `null` | -| `_amount_in?` | `WeiSource`[] | -| `_amount_lt?` | `WeiSource` \| `null` | -| `_amount_lte?` | `WeiSource` \| `null` | -| `_amount_not?` | `WeiSource` \| `null` | -| `_amount_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_contract?` | `string` \| `null` | -| `_contract_contains?` | `string` \| `null` | -| `_contract_in?` | `string`[] | -| `_contract_not?` | `string` \| `null` | -| `_contract_not_contains?` | `string` \| `null` | -| `_contract_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_receiver?` | `string` \| `null` | -| `_receiver_contains?` | `string` \| `null` | -| `_receiver_in?` | `string`[] | -| `_receiver_not?` | `string` \| `null` | -| `_receiver_not_contains?` | `string` \| `null` | -| `_receiver_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_amount` | `Wei` | -| `_conditionId` | `string` | -| `_contract` | `string` | -| `_did` | `string` | -| `_receiver` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:69 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:118 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:114 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:92 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:110 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:155 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:150 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:123 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:145 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:200 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:194 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:160 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:188 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:245 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:239 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:205 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:233 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:290 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:284 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:250 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:278 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFT721Condition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.TransferNFT721Condition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:90 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFT721Condition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.TransferNFT721Condition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.TransferNFT721Condition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFT721Condition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:91 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFT721Condition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.TransferNFT721Condition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:121 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFT721Condition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.TransferNFT721Condition.md#initializedfilter), [`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.TransferNFT721Condition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFT721Condition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:122 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFT721Condition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TransferNFT721Condition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:158 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFT721Condition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.TransferNFT721Condition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TransferNFT721Condition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFT721Condition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:159 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFT721Condition.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.TransferNFT721Condition.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:203 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFT721Condition.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.TransferNFT721Condition.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.TransferNFT721Condition.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFT721Condition.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:204 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFT721Condition.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.TransferNFT721Condition.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:248 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFT721Condition.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.TransferNFT721Condition.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.TransferNFT721Condition.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFT721Condition.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:249 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFT721Condition.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.TransferNFT721Condition.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:293 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------ | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFT721Condition.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.TransferNFT721Condition.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.TransferNFT721Condition.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFT721Condition.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFT721Condition.d.ts:294 diff --git a/docs/api-reference/modules/subgraphs.TransferNFTCondition.md b/docs/api-reference/modules/subgraphs.TransferNFTCondition.md deleted file mode 100644 index b6cf9d178..000000000 --- a/docs/api-reference/modules/subgraphs.TransferNFTCondition.md +++ /dev/null @@ -1,1005 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / TransferNFTCondition - -# Namespace: TransferNFTCondition - -[subgraphs](subgraphs.md).TransferNFTCondition - -## Table of contents - -### Type Aliases - -- [FulfilledArgs](subgraphs.TransferNFTCondition.md#fulfilledargs) -- [FulfilledFields](subgraphs.TransferNFTCondition.md#fulfilledfields) -- [FulfilledFilter](subgraphs.TransferNFTCondition.md#fulfilledfilter) -- [FulfilledResult](subgraphs.TransferNFTCondition.md#fulfilledresult) -- [InitializedArgs](subgraphs.TransferNFTCondition.md#initializedargs) -- [InitializedFields](subgraphs.TransferNFTCondition.md#initializedfields) -- [InitializedFilter](subgraphs.TransferNFTCondition.md#initializedfilter) -- [InitializedResult](subgraphs.TransferNFTCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.TransferNFTCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.TransferNFTCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.TransferNFTCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.TransferNFTCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.TransferNFTCondition.md#ownershiptransferredresult) -- [RoleAdminChangedArgs](subgraphs.TransferNFTCondition.md#roleadminchangedargs) -- [RoleAdminChangedFields](subgraphs.TransferNFTCondition.md#roleadminchangedfields) -- [RoleAdminChangedFilter](subgraphs.TransferNFTCondition.md#roleadminchangedfilter) -- [RoleAdminChangedResult](subgraphs.TransferNFTCondition.md#roleadminchangedresult) -- [RoleGrantedArgs](subgraphs.TransferNFTCondition.md#rolegrantedargs) -- [RoleGrantedFields](subgraphs.TransferNFTCondition.md#rolegrantedfields) -- [RoleGrantedFilter](subgraphs.TransferNFTCondition.md#rolegrantedfilter) -- [RoleGrantedResult](subgraphs.TransferNFTCondition.md#rolegrantedresult) -- [RoleRevokedArgs](subgraphs.TransferNFTCondition.md#rolerevokedargs) -- [RoleRevokedFields](subgraphs.TransferNFTCondition.md#rolerevokedfields) -- [RoleRevokedFilter](subgraphs.TransferNFTCondition.md#rolerevokedfilter) -- [RoleRevokedResult](subgraphs.TransferNFTCondition.md#rolerevokedresult) -- [SingleQueryOptions](subgraphs.TransferNFTCondition.md#singlequeryoptions) - -### Functions - -- [getFulfilledById](subgraphs.TransferNFTCondition.md#getfulfilledbyid) -- [getFulfilleds](subgraphs.TransferNFTCondition.md#getfulfilleds) -- [getInitializedById](subgraphs.TransferNFTCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.TransferNFTCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.TransferNFTCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.TransferNFTCondition.md#getownershiptransferreds) -- [getRoleAdminChangedById](subgraphs.TransferNFTCondition.md#getroleadminchangedbyid) -- [getRoleAdminChangeds](subgraphs.TransferNFTCondition.md#getroleadminchangeds) -- [getRoleGrantedById](subgraphs.TransferNFTCondition.md#getrolegrantedbyid) -- [getRoleGranteds](subgraphs.TransferNFTCondition.md#getrolegranteds) -- [getRoleRevokedById](subgraphs.TransferNFTCondition.md#getrolerevokedbyid) -- [getRoleRevokeds](subgraphs.TransferNFTCondition.md#getrolerevokeds) - -## Type Aliases - -### FulfilledArgs - -Ƭ **FulfilledArgs**<`K`\>: { [Property in keyof Pick]: FulfilledFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:87 - ---- - -### FulfilledFields - -Ƭ **FulfilledFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :----- | -| `_agreementId` | `true` | -| `_amount` | `true` | -| `_conditionId` | `true` | -| `_contract` | `true` | -| `_did` | `true` | -| `_receiver` | `true` | -| `id` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:78 - ---- - -### FulfilledFilter - -Ƭ **FulfilledFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------------- | :-------------------- | -| `_agreementId?` | `string` \| `null` | -| `_agreementId_contains?` | `string` \| `null` | -| `_agreementId_in?` | `string`[] | -| `_agreementId_not?` | `string` \| `null` | -| `_agreementId_not_contains?` | `string` \| `null` | -| `_agreementId_not_in?` | `string`[] | -| `_amount?` | `WeiSource` \| `null` | -| `_amount_gt?` | `WeiSource` \| `null` | -| `_amount_gte?` | `WeiSource` \| `null` | -| `_amount_in?` | `WeiSource`[] | -| `_amount_lt?` | `WeiSource` \| `null` | -| `_amount_lte?` | `WeiSource` \| `null` | -| `_amount_not?` | `WeiSource` \| `null` | -| `_amount_not_in?` | `WeiSource`[] | -| `_conditionId?` | `string` \| `null` | -| `_conditionId_contains?` | `string` \| `null` | -| `_conditionId_in?` | `string`[] | -| `_conditionId_not?` | `string` \| `null` | -| `_conditionId_not_contains?` | `string` \| `null` | -| `_conditionId_not_in?` | `string`[] | -| `_contract?` | `string` \| `null` | -| `_contract_contains?` | `string` \| `null` | -| `_contract_in?` | `string`[] | -| `_contract_not?` | `string` \| `null` | -| `_contract_not_contains?` | `string` \| `null` | -| `_contract_not_in?` | `string`[] | -| `_did?` | `string` \| `null` | -| `_did_contains?` | `string` \| `null` | -| `_did_in?` | `string`[] | -| `_did_not?` | `string` \| `null` | -| `_did_not_contains?` | `string` \| `null` | -| `_did_not_in?` | `string`[] | -| `_receiver?` | `string` \| `null` | -| `_receiver_contains?` | `string` \| `null` | -| `_receiver_in?` | `string`[] | -| `_receiver_not?` | `string` \| `null` | -| `_receiver_not_contains?` | `string` \| `null` | -| `_receiver_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:21 - ---- - -### FulfilledResult - -Ƭ **FulfilledResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------- | :------- | -| `_agreementId` | `string` | -| `_amount` | `Wei` | -| `_conditionId` | `string` | -| `_contract` | `string` | -| `_did` | `string` | -| `_receiver` | `string` | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:69 - ---- - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:118 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:114 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:92 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:110 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:10 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:155 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:150 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:123 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:145 - ---- - -### RoleAdminChangedArgs - -Ƭ **RoleAdminChangedArgs**<`K`\>: { [Property in keyof Pick]: RoleAdminChangedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:200 - ---- - -### RoleAdminChangedFields - -Ƭ **RoleAdminChangedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :----- | -| `id` | `true` | -| `newAdminRole` | `true` | -| `previousAdminRole` | `true` | -| `role` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:194 - ---- - -### RoleAdminChangedFilter - -Ƭ **RoleAdminChangedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newAdminRole?` | `string` \| `null` | -| `newAdminRole_contains?` | `string` \| `null` | -| `newAdminRole_in?` | `string`[] | -| `newAdminRole_not?` | `string` \| `null` | -| `newAdminRole_not_contains?` | `string` \| `null` | -| `newAdminRole_not_in?` | `string`[] | -| `previousAdminRole?` | `string` \| `null` | -| `previousAdminRole_contains?` | `string` \| `null` | -| `previousAdminRole_in?` | `string`[] | -| `previousAdminRole_not?` | `string` \| `null` | -| `previousAdminRole_not_contains?` | `string` \| `null` | -| `previousAdminRole_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:160 - ---- - -### RoleAdminChangedResult - -Ƭ **RoleAdminChangedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------ | :------- | -| `id` | `string` | -| `newAdminRole` | `string` | -| `previousAdminRole` | `string` | -| `role` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:188 - ---- - -### RoleGrantedArgs - -Ƭ **RoleGrantedArgs**<`K`\>: { [Property in keyof Pick]: RoleGrantedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:245 - ---- - -### RoleGrantedFields - -Ƭ **RoleGrantedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:239 - ---- - -### RoleGrantedFilter - -Ƭ **RoleGrantedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:205 - ---- - -### RoleGrantedResult - -Ƭ **RoleGrantedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:233 - ---- - -### RoleRevokedArgs - -Ƭ **RoleRevokedArgs**<`K`\>: { [Property in keyof Pick]: RoleRevokedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:290 - ---- - -### RoleRevokedFields - -Ƭ **RoleRevokedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `account` | `true` | -| `id` | `true` | -| `role` | `true` | -| `sender` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:284 - ---- - -### RoleRevokedFilter - -Ƭ **RoleRevokedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `account?` | `string` \| `null` | -| `account_contains?` | `string` \| `null` | -| `account_in?` | `string`[] | -| `account_not?` | `string` \| `null` | -| `account_not_contains?` | `string` \| `null` | -| `account_not_in?` | `string`[] | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `role?` | `string` \| `null` | -| `role_contains?` | `string` \| `null` | -| `role_in?` | `string`[] | -| `role_not?` | `string` \| `null` | -| `role_not_contains?` | `string` \| `null` | -| `role_not_in?` | `string`[] | -| `sender?` | `string` \| `null` | -| `sender_contains?` | `string` \| `null` | -| `sender_in?` | `string`[] | -| `sender_not?` | `string` \| `null` | -| `sender_not_contains?` | `string` \| `null` | -| `sender_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:250 - ---- - -### RoleRevokedResult - -Ƭ **RoleRevokedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `account` | `string` | -| `id` | `string` | -| `role` | `string` | -| `sender` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:278 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:2 - -## Functions - -### getFulfilledById - -▸ **getFulfilledById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFTCondition.md#singlequeryoptions) | -| `args` | [`FulfilledArgs`](subgraphs.TransferNFTCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:90 - ---- - -### getFulfilleds - -▸ **getFulfilleds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------------------------------------- | -| `K` | extends keyof [`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult) | - -#### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFTCondition.md#multiqueryoptions)<[`FulfilledFilter`](subgraphs.TransferNFTCondition.md#fulfilledfilter), [`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult)\> | -| `args` | [`FulfilledArgs`](subgraphs.TransferNFTCondition.md#fulfilledargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`FulfilledResult`](subgraphs.TransferNFTCondition.md#fulfilledresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:91 - ---- - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFTCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.TransferNFTCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:121 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFTCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.TransferNFTCondition.md#initializedfilter), [`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.TransferNFTCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.TransferNFTCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:122 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFTCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TransferNFTCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:158 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFTCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.TransferNFTCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.TransferNFTCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.TransferNFTCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:159 - ---- - -### getRoleAdminChangedById - -▸ **getRoleAdminChangedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFTCondition.md#singlequeryoptions) | -| `args` | [`RoleAdminChangedArgs`](subgraphs.TransferNFTCondition.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:203 - ---- - -### getRoleAdminChangeds - -▸ **getRoleAdminChangeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFTCondition.md#multiqueryoptions)<[`RoleAdminChangedFilter`](subgraphs.TransferNFTCondition.md#roleadminchangedfilter), [`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult)\> | -| `args` | [`RoleAdminChangedArgs`](subgraphs.TransferNFTCondition.md#roleadminchangedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleAdminChangedResult`](subgraphs.TransferNFTCondition.md#roleadminchangedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:204 - ---- - -### getRoleGrantedById - -▸ **getRoleGrantedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFTCondition.md#singlequeryoptions) | -| `args` | [`RoleGrantedArgs`](subgraphs.TransferNFTCondition.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:248 - ---- - -### getRoleGranteds - -▸ **getRoleGranteds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFTCondition.md#multiqueryoptions)<[`RoleGrantedFilter`](subgraphs.TransferNFTCondition.md#rolegrantedfilter), [`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult)\> | -| `args` | [`RoleGrantedArgs`](subgraphs.TransferNFTCondition.md#rolegrantedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleGrantedResult`](subgraphs.TransferNFTCondition.md#rolegrantedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:249 - ---- - -### getRoleRevokedById - -▸ **getRoleRevokedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.TransferNFTCondition.md#singlequeryoptions) | -| `args` | [`RoleRevokedArgs`](subgraphs.TransferNFTCondition.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:293 - ---- - -### getRoleRevokeds - -▸ **getRoleRevokeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------------- | -| `K` | extends keyof [`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.TransferNFTCondition.md#multiqueryoptions)<[`RoleRevokedFilter`](subgraphs.TransferNFTCondition.md#rolerevokedfilter), [`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult)\> | -| `args` | [`RoleRevokedArgs`](subgraphs.TransferNFTCondition.md#rolerevokedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`RoleRevokedResult`](subgraphs.TransferNFTCondition.md#rolerevokedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/TransferNFTCondition.d.ts:294 diff --git a/docs/api-reference/modules/subgraphs.WhitelistingCondition.md b/docs/api-reference/modules/subgraphs.WhitelistingCondition.md deleted file mode 100644 index 8163c1a72..000000000 --- a/docs/api-reference/modules/subgraphs.WhitelistingCondition.md +++ /dev/null @@ -1,351 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / [subgraphs](subgraphs.md) / WhitelistingCondition - -# Namespace: WhitelistingCondition - -[subgraphs](subgraphs.md).WhitelistingCondition - -## Table of contents - -### Type Aliases - -- [InitializedArgs](subgraphs.WhitelistingCondition.md#initializedargs) -- [InitializedFields](subgraphs.WhitelistingCondition.md#initializedfields) -- [InitializedFilter](subgraphs.WhitelistingCondition.md#initializedfilter) -- [InitializedResult](subgraphs.WhitelistingCondition.md#initializedresult) -- [MultiQueryOptions](subgraphs.WhitelistingCondition.md#multiqueryoptions) -- [OwnershipTransferredArgs](subgraphs.WhitelistingCondition.md#ownershiptransferredargs) -- [OwnershipTransferredFields](subgraphs.WhitelistingCondition.md#ownershiptransferredfields) -- [OwnershipTransferredFilter](subgraphs.WhitelistingCondition.md#ownershiptransferredfilter) -- [OwnershipTransferredResult](subgraphs.WhitelistingCondition.md#ownershiptransferredresult) -- [SingleQueryOptions](subgraphs.WhitelistingCondition.md#singlequeryoptions) - -### Functions - -- [getInitializedById](subgraphs.WhitelistingCondition.md#getinitializedbyid) -- [getInitializeds](subgraphs.WhitelistingCondition.md#getinitializeds) -- [getOwnershipTransferredById](subgraphs.WhitelistingCondition.md#getownershiptransferredbyid) -- [getOwnershipTransferreds](subgraphs.WhitelistingCondition.md#getownershiptransferreds) - -## Type Aliases - -### InitializedArgs - -Ƭ **InitializedArgs**<`K`\>: { [Property in keyof Pick]: InitializedFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:46 - ---- - -### InitializedFields - -Ƭ **InitializedFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :----- | -| `id` | `true` | -| `version` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:42 - ---- - -### InitializedFilter - -Ƭ **InitializedFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `version?` | `number` \| `null` | -| `version_gt?` | `number` \| `null` | -| `version_gte?` | `number` \| `null` | -| `version_in?` | `number`[] | -| `version_lt?` | `number` \| `null` | -| `version_lte?` | `number` \| `null` | -| `version_not?` | `number` \| `null` | -| `version_not_in?` | `number`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:20 - ---- - -### InitializedResult - -Ƭ **InitializedResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `id` | `string` | -| `version` | `number` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:38 - ---- - -### MultiQueryOptions - -Ƭ **MultiQueryOptions**<`T`, `R`\>: `Object` - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `R` | - -#### Type declaration - -| Name | Type | -| :---------------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `first?` | `number` | -| `orderBy?` | keyof `R` | -| `orderDirection?` | `"asc"` \| `"desc"` | -| `where?` | `T` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:9 - ---- - -### OwnershipTransferredArgs - -Ƭ **OwnershipTransferredArgs**<`K`\>: { [Property in keyof Pick]: OwnershipTransferredFields[Property] } - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult) | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:83 - ---- - -### OwnershipTransferredFields - -Ƭ **OwnershipTransferredFields**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :----- | -| `id` | `true` | -| `newOwner` | `true` | -| `previousOwner` | `true` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:78 - ---- - -### OwnershipTransferredFilter - -Ƭ **OwnershipTransferredFilter**: `Object` - -#### Type declaration - -| Name | Type | -| :---------------------------- | :----------------- | -| `id?` | `string` \| `null` | -| `id_gt?` | `string` \| `null` | -| `id_gte?` | `string` \| `null` | -| `id_in?` | `string`[] | -| `id_lt?` | `string` \| `null` | -| `id_lte?` | `string` \| `null` | -| `id_not?` | `string` \| `null` | -| `id_not_in?` | `string`[] | -| `newOwner?` | `string` \| `null` | -| `newOwner_contains?` | `string` \| `null` | -| `newOwner_in?` | `string`[] | -| `newOwner_not?` | `string` \| `null` | -| `newOwner_not_contains?` | `string` \| `null` | -| `newOwner_not_in?` | `string`[] | -| `previousOwner?` | `string` \| `null` | -| `previousOwner_contains?` | `string` \| `null` | -| `previousOwner_in?` | `string`[] | -| `previousOwner_not?` | `string` \| `null` | -| `previousOwner_not_contains?` | `string` \| `null` | -| `previousOwner_not_in?` | `string`[] | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:51 - ---- - -### OwnershipTransferredResult - -Ƭ **OwnershipTransferredResult**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------- | :------- | -| `id` | `string` | -| `newOwner` | `string` | -| `previousOwner` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:73 - ---- - -### SingleQueryOptions - -Ƭ **SingleQueryOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :------- | :--------------------------------------------- | -| `block?` | { `number`: `number` } \| { `hash`: `string` } | -| `id` | `string` | - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:1 - -## Functions - -### getInitializedById - -▸ **getInitializedById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.WhitelistingCondition.md#singlequeryoptions) | -| `args` | [`InitializedArgs`](subgraphs.WhitelistingCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:49 - ---- - -### getInitializeds - -▸ **getInitializeds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------- | -| `K` | extends keyof [`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.WhitelistingCondition.md#multiqueryoptions)<[`InitializedFilter`](subgraphs.WhitelistingCondition.md#initializedfilter), [`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult)\> | -| `args` | [`InitializedArgs`](subgraphs.WhitelistingCondition.md#initializedargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`InitializedResult`](subgraphs.WhitelistingCondition.md#initializedresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:50 - ---- - -### getOwnershipTransferredById - -▸ **getOwnershipTransferredById**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult), `K`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`SingleQueryOptions`](subgraphs.WhitelistingCondition.md#singlequeryoptions) | -| `args` | [`OwnershipTransferredArgs`](subgraphs.WhitelistingCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult), `K`\>\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:86 - ---- - -### getOwnershipTransferreds - -▸ **getOwnershipTransferreds**<`K`\>(`url`, `options`, `args`): `Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------------------------------------------- | -| `K` | extends keyof [`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult) | - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | `string` | -| `options` | [`MultiQueryOptions`](subgraphs.WhitelistingCondition.md#multiqueryoptions)<[`OwnershipTransferredFilter`](subgraphs.WhitelistingCondition.md#ownershiptransferredfilter), [`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult)\> | -| `args` | [`OwnershipTransferredArgs`](subgraphs.WhitelistingCondition.md#ownershiptransferredargs)<`K`\> | - -#### Returns - -`Promise`<`Pick`<[`OwnershipTransferredResult`](subgraphs.WhitelistingCondition.md#ownershiptransferredresult), `K`\>[]\> - -#### Defined in - -node_modules/@nevermined-io/subgraphs/build/WhitelistingCondition.d.ts:87 diff --git a/docs/api-reference/modules/subgraphs.md b/docs/api-reference/modules/subgraphs.md deleted file mode 100644 index b447b6243..000000000 --- a/docs/api-reference/modules/subgraphs.md +++ /dev/null @@ -1,57 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / subgraphs - -# Namespace: subgraphs - -## Table of contents - -### Namespaces - -- [AaveBorrowCondition](subgraphs.AaveBorrowCondition.md) -- [AaveCollateralDepositCondition](subgraphs.AaveCollateralDepositCondition.md) -- [AaveCollateralWithdrawCondition](subgraphs.AaveCollateralWithdrawCondition.md) -- [AaveCreditTemplate](subgraphs.AaveCreditTemplate.md) -- [AaveRepayCondition](subgraphs.AaveRepayCondition.md) -- [AccessCondition](subgraphs.AccessCondition.md) -- [AccessProofCondition](subgraphs.AccessProofCondition.md) -- [AccessProofTemplate](subgraphs.AccessProofTemplate.md) -- [AccessTemplate](subgraphs.AccessTemplate.md) -- [AgreementStoreManager](subgraphs.AgreementStoreManager.md) -- [ComputeExecutionCondition](subgraphs.ComputeExecutionCondition.md) -- [ConditionStoreManager](subgraphs.ConditionStoreManager.md) -- [DIDRegistry](subgraphs.DIDRegistry.md) -- [DIDSalesTemplate](subgraphs.DIDSalesTemplate.md) -- [Dispenser](subgraphs.Dispenser.md) -- [DistributeNFTCollateralCondition](subgraphs.DistributeNFTCollateralCondition.md) -- [EscrowComputeExecutionTemplate](subgraphs.EscrowComputeExecutionTemplate.md) -- [EscrowPaymentCondition](subgraphs.EscrowPaymentCondition.md) -- [HashLockCondition](subgraphs.HashLockCondition.md) -- [LockPaymentCondition](subgraphs.LockPaymentCondition.md) -- [NFT721AccessProofTemplate](subgraphs.NFT721AccessProofTemplate.md) -- [NFT721AccessSwapTemplate](subgraphs.NFT721AccessSwapTemplate.md) -- [NFT721AccessTemplate](subgraphs.NFT721AccessTemplate.md) -- [NFT721EscrowPaymentCondition](subgraphs.NFT721EscrowPaymentCondition.md) -- [NFT721HolderCondition](subgraphs.NFT721HolderCondition.md) -- [NFT721LockCondition](subgraphs.NFT721LockCondition.md) -- [NFT721SalesTemplate](subgraphs.NFT721SalesTemplate.md) -- [NFT721SalesWithAccessTemplate](subgraphs.NFT721SalesWithAccessTemplate.md) -- [NFT721Upgradeable](subgraphs.NFT721Upgradeable.md) -- [NFTAccessCondition](subgraphs.NFTAccessCondition.md) -- [NFTAccessProofTemplate](subgraphs.NFTAccessProofTemplate.md) -- [NFTAccessSwapTemplate](subgraphs.NFTAccessSwapTemplate.md) -- [NFTAccessTemplate](subgraphs.NFTAccessTemplate.md) -- [NFTEscrowPaymentCondition](subgraphs.NFTEscrowPaymentCondition.md) -- [NFTHolderCondition](subgraphs.NFTHolderCondition.md) -- [NFTLockCondition](subgraphs.NFTLockCondition.md) -- [NFTSalesTemplate](subgraphs.NFTSalesTemplate.md) -- [NFTSalesWithAccessTemplate](subgraphs.NFTSalesWithAccessTemplate.md) -- [NeverminedConfig](subgraphs.NeverminedConfig.md) -- [NeverminedToken](subgraphs.NeverminedToken.md) -- [RewardsDistributor](subgraphs.RewardsDistributor.md) -- [SignCondition](subgraphs.SignCondition.md) -- [StandardRoyalties](subgraphs.StandardRoyalties.md) -- [TemplateStoreManager](subgraphs.TemplateStoreManager.md) -- [ThresholdCondition](subgraphs.ThresholdCondition.md) -- [TransferDIDOwnershipCondition](subgraphs.TransferDIDOwnershipCondition.md) -- [TransferNFT721Condition](subgraphs.TransferNFT721Condition.md) -- [TransferNFTCondition](subgraphs.TransferNFTCondition.md) -- [WhitelistingCondition](subgraphs.WhitelistingCondition.md) diff --git a/docs/api-reference/modules/templates.md b/docs/api-reference/modules/templates.md deleted file mode 100644 index 1e7686cd2..000000000 --- a/docs/api-reference/modules/templates.md +++ /dev/null @@ -1,47 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / templates - -# Namespace: templates - -## Table of contents - -### References - -- [AgreementTemplate](templates.md#agreementtemplate) - -### Classes - -- [AaveCreditTemplate](../classes/templates.AaveCreditTemplate.md) -- [AccessTemplate](../classes/templates.AccessTemplate.md) -- [BaseTemplate](../classes/templates.BaseTemplate.md) -- [DIDSalesTemplate](../classes/templates.DIDSalesTemplate.md) -- [EscrowComputeExecutionTemplate](../classes/templates.EscrowComputeExecutionTemplate.md) -- [NFT721AccessTemplate](../classes/templates.NFT721AccessTemplate.md) -- [NFT721SalesTemplate](../classes/templates.NFT721SalesTemplate.md) -- [NFTAccessTemplate](../classes/templates.NFTAccessTemplate.md) -- [NFTSalesTemplate](../classes/templates.NFTSalesTemplate.md) - -### Interfaces - -- [AgreementConditionsStatus](../interfaces/templates.AgreementConditionsStatus.md) -- [AgreementInstance](../interfaces/templates.AgreementInstance.md) -- [PaymentData](../interfaces/templates.PaymentData.md) - -### Type Aliases - -- [ParameterType](templates.md#parametertype) - -## References - -### AgreementTemplate - -Re-exports [AgreementTemplate](../classes/AgreementTemplate.md) - -## Type Aliases - -### ParameterType - -Ƭ **ParameterType**: `string` \| `number` \| `number`[] \| [`Account`](../classes/Account.md) \| [`BabyjubPublicKey`](../classes/KeyTransfer.BabyjubPublicKey.md) \| `Service` \| `ServiceType` \| `TxParameters` - -#### Defined in - -[src/keeper/contracts/templates/AgreementTemplate.abstract.ts:38](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/keeper/contracts/templates/AgreementTemplate.abstract.ts#L38) diff --git a/docs/api-reference/modules/utils.md b/docs/api-reference/modules/utils.md deleted file mode 100644 index 95fbe538e..000000000 --- a/docs/api-reference/modules/utils.md +++ /dev/null @@ -1,506 +0,0 @@ -[@nevermined-io/sdk](../code-reference.md) / utils - -# Namespace: utils - -## Table of contents - -### References - -- [LoggerInstance](utils.md#loggerinstance) - -### Enumerations - -- [LogLevel](../enums/utils.LogLevel.md) -- [OrderProgressStep](../enums/utils.OrderProgressStep.md) - -### Classes - -- [Logger](../classes/utils.Logger.md) -- [SubscribableObserver](../classes/utils.SubscribableObserver.md) -- [SubscribablePromise](../classes/utils.SubscribablePromise.md) - -### Variables - -- [ZeroAddress](utils.md#zeroaddress) - -### Functions - -- [didPrefixed](utils.md#didprefixed) -- [didTransformer](utils.md#didtransformer) -- [didZeroX](utils.md#didzerox) -- [eventToObject](utils.md#eventtoobject) -- [fillConditionsWithDDO](utils.md#fillconditionswithddo) -- [findServiceConditionByName](utils.md#findserviceconditionbyname) -- [generateId](utils.md#generateid) -- [getAssetPriceFromDDOByService](utils.md#getassetrewardsfromddobyservice) -- [getAssetPriceFromService](utils.md#getassetrewardsfromservice) -- [getDIDFromService](utils.md#getdidfromservice) -- [getNftAmountFromService](utils.md#getnftamountfromservice) -- [getNftHolderFromService](utils.md#getnftholderfromservice) -- [makeAccounts](utils.md#makeaccounts) -- [makeBuffer](utils.md#makebuffer) -- [noDidPrefixed](utils.md#nodidprefixed) -- [noZeroX](utils.md#nozerox) -- [objectPromiseAll](utils.md#objectpromiseall) -- [setAssetPriceFromDDOByService](utils.md#setassetrewardsfromddobyservice) -- [setNFTRewardsFromDDOByService](utils.md#setnftrewardsfromddobyservice) -- [zeroX](utils.md#zerox) -- [zeroXTransformer](utils.md#zeroxtransformer) - -## References - -### LoggerInstance - -Renames and re-exports [Logger](../code-reference.md#logger) - -## Variables - -### ZeroAddress - -• `Const` **ZeroAddress**: `"0x0000000000000000000000000000000000000000"` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:53](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L53) - -## Functions - -### didPrefixed - -▸ **didPrefixed**(`input`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `input` | `string` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:17](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L17) - ---- - -### didTransformer - -▸ **didTransformer**(`input?`, `prefixOutput`): `string` - -#### Parameters - -| Name | Type | Default value | -| :------------- | :-------- | :------------ | -| `input` | `string` | `''` | -| `prefixOutput` | `boolean` | `undefined` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:20](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L20) - ---- - -### didZeroX - -▸ **didZeroX**(`input`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `input` | `string` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:30](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L30) - ---- - -### eventToObject - -▸ **eventToObject**(`event`): `any` - -#### Parameters - -| Name | Type | -| :------ | :---- | -| `event` | `any` | - -#### Returns - -`any` - -#### Defined in - -[src/utils/Events.ts:1](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/Events.ts#L1) - ---- - -### fillConditionsWithDDO - -▸ **fillConditionsWithDDO**(`conditions`, `ddo`, `assetPrice?`, `erc20TokenContract?`, `nftTokenContract?`, `nftHolder?`, `nftAmount?`, `nftTransfer?`, `duration?`): `ServiceAgreementTemplateCondition`[] - -Fill some static parameters that depends on the metadata. - -#### Parameters - -| Name | Type | Default value | Description | -| :-------------------- | :------------------------------------ | :------------ | :------------------------------ | -| `conditions` | `ServiceAgreementTemplateCondition`[] | `undefined` | Conditions to fill. | -| `ddo` | [`DDO`](../classes/DDO.md) | `undefined` | DDO related to this conditions. | -| `assetPrice` | `default` | `undefined` | Rewards distribution | -| `erc20TokenContract?` | `string` | `undefined` | Number of nfts to handle | -| `nftTokenContract?` | `string` | `undefined` | Number of nfts to handle | -| `nftHolder?` | `string` | `undefined` | - | -| `nftAmount?` | `default` | `undefined` | Number of nfts to handle | -| `nftTransfer` | `boolean` | `false` | - | -| `duration` | `number` | `0` | - | - -#### Returns - -`ServiceAgreementTemplateCondition`[] - -Filled conditions. - -#### Defined in - -[src/utils/DDOHelpers.ts:71](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L71) - ---- - -### findServiceConditionByName - -▸ **findServiceConditionByName**(`service`, `name`): `ServiceAgreementTemplateCondition` - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | -| `name` | `ConditionType` | - -#### Returns - -`ServiceAgreementTemplateCondition` - -#### Defined in - -[src/utils/DDOHelpers.ts:100](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L100) - ---- - -### generateId - -▸ **generateId**(`length?`): `string` - -#### Parameters - -| Name | Type | Default value | -| :------- | :------- | :------------ | -| `length` | `number` | `64` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/GeneratorHelpers.ts:3](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/GeneratorHelpers.ts#L3) - ---- - -### getAssetPriceFromDDOByService - -▸ **getAssetPriceFromDDOByService**(`ddo`, `service`): `AssetPrice` - -#### Parameters - -| Name | Type | -| :-------- | :------------------------- | -| `ddo` | [`DDO`](../classes/DDO.md) | -| `service` | `ServiceType` | - -#### Returns - -`AssetPrice` - -#### Defined in - -[src/utils/DDOHelpers.ts:109](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L109) - ---- - -### getAssetPriceFromService - -▸ **getAssetPriceFromService**(`service`): `AssetPrice` - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -`AssetPrice` - -#### Defined in - -[src/utils/DDOHelpers.ts:148](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L148) - ---- - -### getDIDFromService - -▸ **getDIDFromService**(`service`): `string` - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/DDOHelpers.ts:167](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L167) - ---- - -### getNftAmountFromService - -▸ **getNftAmountFromService**(`service`): `BigNumber` - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -`BigNumber` - -#### Defined in - -[src/utils/DDOHelpers.ts:179](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L179) - ---- - -### getNftHolderFromService - -▸ **getNftHolderFromService**(`service`): `string` - -#### Parameters - -| Name | Type | -| :-------- | :-------------- | -| `service` | `ServiceCommon` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/DDOHelpers.ts:173](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L173) - ---- - -### makeAccounts - -▸ **makeAccounts**(`seedphrase`): `ethers.Wallet`[] - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `seedphrase` | `string` | - -#### Returns - -`ethers.Wallet`[] - -#### Defined in - -[src/utils/MakeAccounts.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/MakeAccounts.ts#L4) - ---- - -### makeBuffer - -▸ **makeBuffer**(`a`, `b`): `Buffer` - -#### Parameters - -| Name | Type | -| :--- | :---- | -| `a` | `any` | -| `b` | `any` | - -#### Returns - -`Buffer` - -#### Defined in - -[src/utils/index.ts:12](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/index.ts#L12) - ---- - -### noDidPrefixed - -▸ **noDidPrefixed**(`input`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `input` | `string` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:18](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L18) - ---- - -### noZeroX - -▸ **noZeroX**(`input`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `input` | `string` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:5](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L5) - ---- - -### objectPromiseAll - -▸ **objectPromiseAll**(`obj`): `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `obj` | `Object` | - -#### Returns - -`Promise`<`any`\> - -#### Defined in - -[src/utils/PromiseResolver.ts:11](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/PromiseResolver.ts#L11) - ---- - -### setAssetPriceFromDDOByService - -▸ **setAssetPriceFromDDOByService**(`ddo`, `serviceType`, `rewards`): `void` - -#### Parameters - -| Name | Type | -| :------------ | :------------------------- | -| `ddo` | [`DDO`](../classes/DDO.md) | -| `serviceType` | `ServiceType` | -| `rewards` | `default` | - -#### Returns - -`void` - -#### Defined in - -[src/utils/DDOHelpers.ts:132](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L132) - ---- - -### setNFTRewardsFromDDOByService - -▸ **setNFTRewardsFromDDOByService**(`ddo`, `serviceType`, `rewards`, `holderAddress`): `void` - -#### Parameters - -| Name | Type | -| :-------------- | :------------------------- | -| `ddo` | [`DDO`](../classes/DDO.md) | -| `serviceType` | `ServiceType` | -| `rewards` | `default` | -| `holderAddress` | `string` | - -#### Returns - -`void` - -#### Defined in - -[src/utils/DDOHelpers.ts:116](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/DDOHelpers.ts#L116) - ---- - -### zeroX - -▸ **zeroX**(`input`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `input` | `string` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:4](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L4) - ---- - -### zeroXTransformer - -▸ **zeroXTransformer**(`input?`, `zeroOutput`): `string` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :-------- | :------------ | -| `input` | `string` | `''` | -| `zeroOutput` | `boolean` | `undefined` | - -#### Returns - -`string` - -#### Defined in - -[src/utils/ConversionTypeHelpers.ts:7](https://github.com/nevermined-io/sdk-js/blob/55f88d2/src/utils/ConversionTypeHelpers.ts#L7) diff --git a/package.json b/package.json index ea655ee48..73bb82bd6 100644 --- a/package.json +++ b/package.json @@ -126,8 +126,8 @@ "tar": "^6.1.11", "terser-webpack-plugin": "^5.3.1", "ts-node": "^10.9.1", - "typedoc": "^0.24.7", - "typedoc-plugin-markdown": "^3.13.4", + "typedoc": "^0.25.2", + "typedoc-plugin-markdown": "^3.16.0", "typescript": "^5.1.6", "url": "^0.11.0", "webpack": "^5.69.1", From d77f41633a8e411d23bbf3d2e5329400499b6817 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:46:10 +0200 Subject: [PATCH 151/151] chore: bumping to v2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 91a553480..cd7679dde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.0-rc20", + "version": "2.0.0", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts",